org.apache.avro.mapreduce
Class AvroOutputFormatBase<K,V>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.OutputFormat<K,V>
      extended by org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>
          extended by org.apache.avro.mapreduce.AvroOutputFormatBase<K,V>
Type Parameters:
K - The type of key to write.
V - The type of value to write.
Direct Known Subclasses:
AvroKeyOutputFormat, AvroKeyValueOutputFormat

public abstract class AvroOutputFormatBase<K,V>
extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>

Abstract base class for output formats that write Avro container files.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.Counter
 
Constructor Summary
AvroOutputFormatBase()
           
 
Method Summary
protected  OutputStream getAvroFileOutputStream(org.apache.hadoop.mapreduce.TaskAttemptContext context)
          Gets the target output stream where the Avro container file should be written.
protected static org.apache.avro.file.CodecFactory getCompressionCodec(org.apache.hadoop.mapreduce.TaskAttemptContext context)
          Gets the configured compression codec from the task context.
 
Methods inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
checkOutputSpecs, getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputPath, getPathForWorkFile, getRecordWriter, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroOutputFormatBase

public AvroOutputFormatBase()
Method Detail

getCompressionCodec

protected static org.apache.avro.file.CodecFactory getCompressionCodec(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Gets the configured compression codec from the task context.

Parameters:
context - The task attempt context.
Returns:
The compression codec to use for the output Avro container file.

getAvroFileOutputStream

protected OutputStream getAvroFileOutputStream(org.apache.hadoop.mapreduce.TaskAttemptContext context)
                                        throws IOException
Gets the target output stream where the Avro container file should be written.

Parameters:
context - The task attempt context.
Returns:
The target output stream.
Throws:
IOException


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.