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(TaskAttemptContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Schema |
initSchema(TaskAttemptContext context)
Use the task context to construct a schema for writing
|
void |
write(AvroKey<K> key,
AvroValue<V> value) |
close, flush
public AvroTrevniKeyValueRecordWriter(TaskAttemptContext context) throws IOException
context
- The TaskAttempContext to supply the writer with information
form the job configurationIOException
public void write(AvroKey<K> key, AvroValue<V> value) throws IOException, InterruptedException
write
in class RecordWriter<AvroKey<K>,AvroValue<V>>
IOException
InterruptedException
protected Schema initSchema(TaskAttemptContext context)
initSchema
in class AvroTrevniRecordWriterBase<AvroKey<K>,AvroValue<V>,GenericRecord>
Copyright © 2009–2022 The Apache Software Foundation. All rights reserved.