Package org.apache.trevni.avro
Class AvroColumnWriter<D>
java.lang.Object
org.apache.trevni.avro.AvroColumnWriter<D>
Write Avro records to a Trevni column file.
Each primitive type is written to a separate column.
Output is buffered until writeTo(OutputStream)
is called. The
sizeEstimate()
indicates both the amount of data buffered and the
size of the file that will be written.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAvroColumnWriter
(Schema s, ColumnFileMetaData meta) AvroColumnWriter
(Schema s, ColumnFileMetaData meta, GenericData model) -
Method Summary
Modifier and TypeMethodDescriptionlong
Return the approximate size of the file that will be written.void
Add a row to the file.void
Write all rows added to the named file.void
writeTo
(OutputStream out) Write all rows added to the named output stream.
-
Field Details
-
SCHEMA_KEY
- See Also:
-
-
Constructor Details
-
AvroColumnWriter
- Throws:
IOException
-
AvroColumnWriter
- Throws:
IOException
-
-
Method Details
-
sizeEstimate
public long sizeEstimate()Return the approximate size of the file that will be written. Tries to slightly over-estimate. Indicates both the size in memory of the buffered data as well as the size of the file that will be written bywriteTo(OutputStream)
. -
writeTo
Write all rows added to the named output stream.- Throws:
IOException
-
writeTo
Write all rows added to the named file.- Throws:
IOException
-
write
Add a row to the file.- Throws:
IOException
-