public final class AvroSinks extends Object
Modifier and Type | Method and Description |
---|---|
static <R> Sink<R> |
files(String directoryName,
Class<R> recordClass,
org.apache.avro.Schema schema)
Convenience for
files(String, Schema,
SupplierEx) which uses either SpecificDatumWriter or
ReflectDatumWriter depending on the supplied recordClass . |
static Sink<org.apache.avro.generic.IndexedRecord> |
files(String directoryName,
org.apache.avro.Schema schema)
Convenience for
files(String, Schema,
SupplierEx) which uses GenericDatumWriter . |
static <R> Sink<R> |
files(String directoryName,
org.apache.avro.Schema schema,
SupplierEx<org.apache.avro.io.DatumWriter<R>> datumWriterSupplier)
Returns a sink that that writes the items it receives to Apache Avro
files.
|
@Nonnull public static <R> Sink<R> files(@Nonnull String directoryName, @Nonnull org.apache.avro.Schema schema, @Nonnull SupplierEx<org.apache.avro.io.DatumWriter<R>> datumWriterSupplier)
The sink creates a DataFileWriter
for each processor using the
supplied datumWriterSupplier
with the given Schema
.
No state is saved to snapshot for this sink. After the job is restarted, the items will be missing since files will be overwritten.
The default local parallelism for this sink is 1.
R
- the type of the recorddirectoryName
- directory to create the files in. Will be created
if it doesn't exist. Must be the same on all members.schema
- the record schemadatumWriterSupplier
- the record writer supplier@Nonnull public static <R> Sink<R> files(@Nonnull String directoryName, @Nonnull Class<R> recordClass, @Nonnull org.apache.avro.Schema schema)
files(String, Schema,
SupplierEx)
which uses either SpecificDatumWriter
or
ReflectDatumWriter
depending on the supplied recordClass
.Copyright © 2024 Hazelcast, Inc.. All rights reserved.