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
.
Writes a directory of files per task, each comprising a single filesystem block. To reduce the number of files, increase the default filesystem block size for the job. Each task also requires enough memory to buffer a filesystem block.
public class AvroTrevniKeyValueOutputFormat<K,V> extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<AvroKey<K>,AvroValue<V>>
OutputFormat
that writes Avro data to
Trevni files.
This implement was modeled off
AvroKeyValueOutputFormat
to allow for easy
transition
* FileOutputFormat for writing Trevni container files of key/value pairs.
Since Trevni 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.
Constructor and Description |
---|
AvroTrevniKeyValueOutputFormat() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.mapreduce.RecordWriter<AvroKey<K>,AvroValue<V>> |
getRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context) |
checkOutputSpecs, getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputPath, getPathForWorkFile, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputPath
public org.apache.hadoop.mapreduce.RecordWriter<AvroKey<K>,AvroValue<V>> getRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException
getRecordWriter
in class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<AvroKey<K>,AvroValue<V>>
IOException
InterruptedException
Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.