K
- The type of key to write.V
- The type of value to write.public class AvroKeyValueRecordWriter<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.
Constructor and Description |
---|
AvroKeyValueRecordWriter(AvroDatumConverter<K,?> keyConverter,
AvroDatumConverter<V,?> valueConverter,
CodecFactory compressionCodec,
OutputStream outputStream) |
public AvroKeyValueRecordWriter(AvroDatumConverter<K,?> keyConverter, AvroDatumConverter<V,?> valueConverter, CodecFactory compressionCodec, OutputStream outputStream) throws IOException
IOException
public Schema getWriterSchema()
public void write(K key, V value) throws IOException
write
in class org.apache.hadoop.mapreduce.RecordWriter<K,V>
IOException
public void close(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException
close
in class org.apache.hadoop.mapreduce.RecordWriter<K,V>
IOException
Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.