Package org.apache.hadoop.mapred
Class SequenceFileAsBinaryOutputFormat
java.lang.Object
org.apache.hadoop.mapred.FileOutputFormat<K,V>
org.apache.hadoop.mapred.SequenceFileOutputFormat<BytesWritable,BytesWritable>
org.apache.hadoop.mapred.SequenceFileAsBinaryOutputFormat
- All Implemented Interfaces:
OutputFormat<BytesWritable,BytesWritable>
@Public
@Stable
public class SequenceFileAsBinaryOutputFormat
extends SequenceFileOutputFormat<BytesWritable,BytesWritable>
An
OutputFormat that writes keys, values to
SequenceFiles in binary(raw) format-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classorg.apache.hadoop.mapred.SequenceFileAsBinaryOutputFormat.WritableValueBytesInner class used for appendRawNested classes/interfaces inherited from class org.apache.hadoop.mapred.FileOutputFormat
FileOutputFormat.Counter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckOutputSpecs(FileSystem ignored, JobConf job) Check for validity of the output-specification for the job.getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) Get theRecordWriterfor the given job.static Class<? extends WritableComparable>Get the key class for theSequenceFileGet the value class for theSequenceFilestatic voidsetSequenceFileOutputKeyClass(JobConf conf, Class<?> theClass) Set the key class for theSequenceFilestatic voidsetSequenceFileOutputValueClass(JobConf conf, Class<?> theClass) Set the value class for theSequenceFileMethods inherited from class org.apache.hadoop.mapred.SequenceFileOutputFormat
getOutputCompressionType, getReaders, setOutputCompressionTypeMethods inherited from class org.apache.hadoop.mapred.FileOutputFormat
getCompressOutput, getOutputCompressorClass, getOutputPath, getPathForCustomFile, getTaskOutputPath, getUniqueName, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputPath, setWorkOutputPath
-
Constructor Details
-
SequenceFileAsBinaryOutputFormat
public SequenceFileAsBinaryOutputFormat()
-
-
Method Details
-
setSequenceFileOutputKeyClass
Set the key class for theSequenceFileThis allows the user to specify the key class to be different from the actual class (
BytesWritable) used for writing- Parameters:
conf- theJobConfto modifytheClass- the SequenceFile output key class.
-
setSequenceFileOutputValueClass
Set the value class for theSequenceFileThis allows the user to specify the value class to be different from the actual class (
BytesWritable) used for writing- Parameters:
conf- theJobConfto modifytheClass- the SequenceFile output key class.
-
getSequenceFileOutputKeyClass
Get the key class for theSequenceFile- Returns:
- the key class of the
SequenceFile
-
getSequenceFileOutputValueClass
Get the value class for theSequenceFile- Returns:
- the value class of the
SequenceFile
-
getRecordWriter
public RecordWriter<BytesWritable,BytesWritable> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException Description copied from interface:OutputFormatGet theRecordWriterfor the given job.- Specified by:
getRecordWriterin interfaceOutputFormat<BytesWritable,BytesWritable> - Overrides:
getRecordWriterin classSequenceFileOutputFormat<BytesWritable,BytesWritable> 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
-
checkOutputSpecs
Description copied from interface:OutputFormatCheck for validity of the output-specification for the job.This is to validate the output specification for the job when it is a job is submitted. Typically checks that it does not already exist, throwing an exception when it already exists, so that output is not overwritten.
Implementations which write to filesystems which support delegation tokens usually collect the tokens for the destination path(s) and attach them to the job configuration.- Specified by:
checkOutputSpecsin interfaceOutputFormat<BytesWritable,BytesWritable> - Overrides:
checkOutputSpecsin classFileOutputFormat<BytesWritable,BytesWritable> job- job configuration.- Throws:
IOException- when output should not be attempted
-