K
- The type of key. If an Avro type, it must be wrapped in an AvroKey
.V
- The type of value. If an Avro type, it must be wrapped in an AvroValue
.public class AvroKeyValueOutputFormat<K,V> extends AvroOutputFormatBase<K,V>
Since Avro container files can only contain records (not key/value pairs), this output format puts the key and value into an Avro generic record with two fields, named 'key' and 'value'.
The keys and values given to this output format may be Avro objects wrapped in
AvroKey
or AvroValue
objects. The basic Writable types are
also supported (e.g., IntWritable, Text); they will be converted to their corresponding
Avro types.
FileOutputFormat.Counter
Constructor and Description |
---|
AvroKeyValueOutputFormat() |
Modifier and Type | Method and Description |
---|---|
RecordWriter<K,V> |
getRecordWriter(TaskAttemptContext context) |
getAvroFileOutputStream, getCompressionCodec
checkOutputSpecs, getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputPath, getPathForWorkFile, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputPath
public RecordWriter<K,V> getRecordWriter(TaskAttemptContext context) throws IOException
getRecordWriter
in class FileOutputFormat<K,V>
IOException
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.