Class SequenceFileOutputFormat<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.OutputFormat<K,V>
org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>
org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat<K,V>
- Direct Known Subclasses:
SequenceFileAsBinaryOutputFormat
An
OutputFormat that writes SequenceFiles.-
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic SequenceFile.CompressionTypeGet theSequenceFile.CompressionTypefor the outputSequenceFile.getRecordWriter(TaskAttemptContext context) Get theRecordWriterfor the given task.protected org.apache.hadoop.io.SequenceFile.WritergetSequenceWriter(TaskAttemptContext context, Class<?> keyClass, Class<?> valueClass) static voidsetOutputCompressionType(Job job, SequenceFile.CompressionType style) Set theSequenceFile.CompressionTypefor the outputSequenceFile.Methods inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
checkOutputSpecs, getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputName, getOutputPath, getPathForWorkFile, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputName, setOutputPath
-
Constructor Details
-
SequenceFileOutputFormat
public SequenceFileOutputFormat()
-
-
Method Details
-
getSequenceWriter
protected org.apache.hadoop.io.SequenceFile.Writer getSequenceWriter(TaskAttemptContext context, Class<?> keyClass, Class<?> valueClass) throws IOException - Throws:
IOException
-
getRecordWriter
public RecordWriter<K,V> getRecordWriter(TaskAttemptContext context) throws IOException, InterruptedException Description copied from class:OutputFormatGet theRecordWriterfor the given task.- Specified by:
getRecordWriterin classFileOutputFormat<K,V> - Parameters:
context- the information about the current task.- Returns:
- a
RecordWriterto write the output for the job. - Throws:
IOExceptionInterruptedException
-
getOutputCompressionType
Get theSequenceFile.CompressionTypefor the outputSequenceFile.- Parameters:
job- theJob- Returns:
- the
SequenceFile.CompressionTypefor the outputSequenceFile, defaulting toSequenceFile.CompressionType.RECORD
-
setOutputCompressionType
Set theSequenceFile.CompressionTypefor the outputSequenceFile.- Parameters:
job- theJobto modifystyle- theSequenceFile.CompressionTypefor the outputSequenceFile
-