K - The type of key to write.V - The type of value to write.public class AvroTrevniKeyValueRecordWriter<K,V> extends AvroTrevniRecordWriterBase<AvroKey<K>,AvroValue<V>,GenericRecord>
Each entry in the Trevni container file will be a generic record with two fields, named 'key' and 'value'. The input types may be basic Writable objects like Text or IntWritable, or they may be AvroWrapper subclasses (AvroKey or AvroValue). Writable objects will be converted to their corresponding Avro types when written to the generic record key/value pair.
EXT, meta, META_PREFIX, part, schema, writer| Constructor and Description |
|---|
AvroTrevniKeyValueRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Schema |
initSchema(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Use the task context to construct a schema for writing
|
void |
write(AvroKey<K> key,
AvroValue<V> value) |
close, flushpublic AvroTrevniKeyValueRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws IOException
context - The TaskAttempContext to supply the writer with information
form the job configurationIOExceptionpublic void write(AvroKey<K> key, AvroValue<V> value) throws IOException, InterruptedException
write in class org.apache.hadoop.mapreduce.RecordWriter<AvroKey<K>,AvroValue<V>>IOExceptionInterruptedExceptionprotected Schema initSchema(org.apache.hadoop.mapreduce.TaskAttemptContext context)
initSchema in class AvroTrevniRecordWriterBase<AvroKey<K>,AvroValue<V>,GenericRecord>Copyright © 2009–2020 The Apache Software Foundation. All rights reserved.