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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAvroColumnWriter(Schema s, ColumnFileMetaData meta) AvroColumnWriter(Schema s, ColumnFileMetaData meta, GenericData model) -
Method Summary
Modifier and TypeMethodDescriptionlongReturn the approximate size of the file that will be written.voidAdd a row to the file.voidWrite all rows added to the named file.voidwriteTo(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
-