Package org.apache.avro.mapreduce

# Class AvroOutputFormatBase<K,V>

java.lang.Object
org.apache.hadoop.mapreduce.OutputFormat<K,V>
org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>
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 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

`FileOutputFormat.Counter`

## Field Summary

### Fields inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat

`BASE_OUTPUT_NAME, COMPRESS, COMPRESS_CODEC, COMPRESS_TYPE, OUTDIR, PART`

## Constructor Summary

Constructors
Constructor
Description
`AvroOutputFormatBase()`

## Method Summary

Modifier and Type
Method
Description
`protected OutputStream`
`getAvroFileOutputStream(TaskAttemptContext context)`
Gets the target output stream where the Avro container file should be written.
`protected static org.apache.avro.file.CodecFactory`
`getCompressionCodec(TaskAttemptContext context)`
Gets the configured compression codec from the task context.
`protected static int`
`getSyncInterval(TaskAttemptContext context)`
Gets the configured sync interval from the task context.

### Methods inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat

`checkOutputSpecs, getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputName, getOutputPath, getPathForWorkFile, getRecordWriter, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputName, setOutputPath`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AvroOutputFormatBase

public AvroOutputFormatBase()

## Method Details

### getCompressionCodec

protected static org.apache.avro.file.CodecFactory getCompressionCodec(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(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`

### getSyncInterval

protected static int getSyncInterval(TaskAttemptContext context)
Gets the configured sync interval from the task context.

Parameters:
  `context` - The task attempt context.
Returns:
  The sync interval to use for the output Avro container file.