K
- The type of key to write.V
- The type of value to write.public class AvroKeyValueWithMetadataRecordWriter<K,V>
extends org.apache.hadoop.mapreduce.RecordWriter<K,V>
Each entry in the Avro 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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TEXT_PREFIX
The configuration key prefix for a text output metadata.
|
Constructor and Description |
---|
AvroKeyValueWithMetadataRecordWriter(org.apache.avro.hadoop.io.AvroDatumConverter<K,?> keyConverter,
org.apache.avro.hadoop.io.AvroDatumConverter<V,?> valueConverter,
org.apache.avro.file.CodecFactory compressionCodec,
java.io.OutputStream outputStream,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
close(org.apache.hadoop.mapreduce.TaskAttemptContext context) |
org.apache.avro.Schema |
getWriterSchema()
Gets the writer schema for the key/value pair generic record.
|
void |
write(K key,
V value) |
public static final java.lang.String TEXT_PREFIX
public AvroKeyValueWithMetadataRecordWriter(org.apache.avro.hadoop.io.AvroDatumConverter<K,?> keyConverter, org.apache.avro.hadoop.io.AvroDatumConverter<V,?> valueConverter, org.apache.avro.file.CodecFactory compressionCodec, java.io.OutputStream outputStream, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
java.io.IOException