Package org.jfleet.avro
Class JFleetAvroWriter<T>
java.lang.Object
org.jfleet.avro.JFleetAvroWriter<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,Consumer<T>
-
Constructor Summary
ConstructorsConstructorDescriptionJFleetAvroWriter(OutputStream outputStream, Class<T> clazz) JFleetAvroWriter(OutputStream outputStream, AvroConfiguration<T> avroConfiguration) JFleetAvroWriter(OutputStream outputStream, org.jfleet.EntityInfo entityInfo) -
Method Summary
Modifier and TypeMethodDescriptionvoidWrites the specified Java object to an Avro file implementing Consumer of Tvoidclose()voidWrites the specified Java object to an Avro file.voidwriteAll(Collection<T> entities) Writes the specified Collection of Java objects to an Avro file.voidWrites the specified stream of Java objects to an Avro file.
-
Constructor Details
-
JFleetAvroWriter
public JFleetAvroWriter(OutputStream outputStream, org.jfleet.EntityInfo entityInfo) throws IOException - Throws:
IOException
-
JFleetAvroWriter
- Throws:
IOException
-
JFleetAvroWriter
public JFleetAvroWriter(OutputStream outputStream, AvroConfiguration<T> avroConfiguration) throws IOException - Throws:
IOException
-
-
Method Details
-
writeAll
Writes the specified Collection of Java objects to an Avro file.- Parameters:
entities- the collection of objects to write- Throws:
IOException- if an error occurs while writing the records
-
writeAll
Writes the specified stream of Java objects to an Avro file.- Parameters:
entities- the stream of objects to write- Throws:
IOException- if an error occurs while writing the records
-
write
Writes the specified Java object to an Avro file.- Parameters:
entity- object to write- Throws:
IOException- if an error occurs while writing the records
-
accept
Writes the specified Java object to an Avro file implementing Consumer of T- Specified by:
acceptin interfaceConsumer<T>- Parameters:
entity- object to write- Throws:
UncheckedIOException- if an error occurs while writing the records
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-