K
- The type of key to write.V
- The type of value to write.public class AvroKeyValueRecordWriter<K,V> extends 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) |
Modifier and Type | Method and Description |
---|---|
void |
close(TaskAttemptContext context) |
Schema |
getWriterSchema()
Gets the writer schema for the key/value pair generic record.
|
void |
write(K key,
V value) |
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 RecordWriter<K,V>
IOException
public void close(TaskAttemptContext context) throws IOException
close
in class RecordWriter<K,V>
IOException
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.