Package org.apache.trevni.avro.mapreduce
Class AvroTrevniRecordWriterBase<K,V,T>
java.lang.Object
org.apache.hadoop.mapreduce.RecordWriter<K,V>
org.apache.trevni.avro.mapreduce.AvroTrevniRecordWriterBase<K,V,T>
- Type Parameters:
K
- The type of key the record writer should generate.V
- The type of value the record wrtier should generate.T
- The type of the entries within the Trevni container file being written.
- Direct Known Subclasses:
AvroTrevniKeyRecordWriter
,AvroTrevniKeyValueRecordWriter
Abstract base class for
RecordWriter
s that writes Trevni
container files.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
trevni file extensionprotected ColumnFileMetaData
meta data to be stored in the output file.static final String
prefix of job configs that we care aboutprotected int
Counter that increments as new trevni files are create because the current file has exceeded the block sizeprotected Schema
Provided avro schema from the contextprotected AvroColumnWriter
<T> Trevni file writer -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(TaskAttemptContext arg0) void
flush()
A Trevni flush will close the current file and prep a new writerprotected abstract Schema
initSchema
(TaskAttemptContext context) Use the task context to construct a schema for writingMethods inherited from class org.apache.hadoop.mapreduce.RecordWriter
write
-
Field Details
-
EXT
trevni file extension- See Also:
-
META_PREFIX
prefix of job configs that we care about- See Also:
-
part
protected int partCounter that increments as new trevni files are create because the current file has exceeded the block size -
writer
Trevni file writer -
schema
Provided avro schema from the context -
meta
meta data to be stored in the output file.
-
-
Constructor Details
-
AvroTrevniRecordWriterBase
Constructor.- Parameters:
context
- The TaskAttempContext to supply the writer with information form the job configuration- Throws:
IOException
-
-
Method Details
-
initSchema
Use the task context to construct a schema for writing- Throws:
IOException
-
flush
A Trevni flush will close the current file and prep a new writer- Throws:
IOException
-
close
- Specified by:
close
in classRecordWriter<K,
V> - Throws:
IOException
InterruptedException
-