Package org.apache.hadoop.mapred
Class SequenceFileOutputFormat<K,V>
java.lang.Object
org.apache.hadoop.mapred.FileOutputFormat<K,V>
org.apache.hadoop.mapred.SequenceFileOutputFormat<K,V>
- All Implemented Interfaces:
OutputFormat<K,V>
- Direct Known Subclasses:
SequenceFileAsBinaryOutputFormat
An
OutputFormat that writes SequenceFiles.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapred.FileOutputFormat
FileOutputFormat.Counter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SequenceFile.CompressionTypeGet theSequenceFile.CompressionTypefor the outputSequenceFile.static org.apache.hadoop.io.SequenceFile.Reader[]getReaders(Configuration conf, Path dir) Open the output generated by this format.getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) Get theRecordWriterfor the given job.static voidsetOutputCompressionType(JobConf conf, SequenceFile.CompressionType style) Set theSequenceFile.CompressionTypefor the outputSequenceFile.Methods inherited from class org.apache.hadoop.mapred.FileOutputFormat
checkOutputSpecs, getCompressOutput, getOutputCompressorClass, getOutputPath, getPathForCustomFile, getTaskOutputPath, getUniqueName, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputPath, setWorkOutputPath
-
Constructor Details
-
SequenceFileOutputFormat
public SequenceFileOutputFormat()
-
-
Method Details
-
getRecordWriter
public RecordWriter<K,V> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException Description copied from interface:OutputFormatGet theRecordWriterfor the given job.- Specified by:
getRecordWriterin interfaceOutputFormat<K,V> - Specified by:
getRecordWriterin classFileOutputFormat<K,V> job- configuration for the job whose output is being written.name- the unique name for this part of the output.progress- mechanism for reporting progress while writing to file.- Returns:
- a
RecordWriterto write the output for the job. - Throws:
IOException
-
getReaders
public static org.apache.hadoop.io.SequenceFile.Reader[] getReaders(Configuration conf, Path dir) throws IOException Open the output generated by this format.- Throws:
IOException
-
getOutputCompressionType
Get theSequenceFile.CompressionTypefor the outputSequenceFile.- Parameters:
conf- theJobConf- Returns:
- the
SequenceFile.CompressionTypefor the outputSequenceFile, defaulting toSequenceFile.CompressionType.RECORD
-
setOutputCompressionType
Set theSequenceFile.CompressionTypefor the outputSequenceFile.- Parameters:
conf- theJobConfto modifystyle- theSequenceFile.CompressionTypefor the outputSequenceFile
-