Class SequenceFileAsBinaryOutputFormat
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<BytesWritable,BytesWritable>
org.apache.hadoop.mapreduce.lib.output.SequenceFileAsBinaryOutputFormat
@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 TypeClassDescriptionstatic classorg.apache.hadoop.mapreduce.lib.output.SequenceFileAsBinaryOutputFormat.WritableValueBytesInner class used for appendRawNested classes/interfaces inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
FileOutputFormat.Counter -
Field Summary
FieldsFields 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 TypeMethodDescriptionvoidCheck for validity of the output-specification for the job.getRecordWriter(TaskAttemptContext context) Get theRecordWriterfor the given task.static Class<? extends WritableComparable>Get the key class for theSequenceFileGet the value class for theSequenceFilestatic voidsetSequenceFileOutputKeyClass(Job job, Class<?> theClass) Set the key class for theSequenceFilestatic voidsetSequenceFileOutputValueClass(Job job, Class<?> theClass) Set the value class for theSequenceFileMethods inherited from class org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat
getOutputCompressionType, getSequenceWriter, setOutputCompressionTypeMethods inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputName, getOutputPath, getPathForWorkFile, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputName, setOutputPath
-
Field Details
-
KEY_CLASS
-
VALUE_CLASS
-
-
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:
job- theJobto 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:
job- theJobto 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(TaskAttemptContext context) throws IOException Description copied from class:OutputFormatGet theRecordWriterfor the given task.- Overrides:
getRecordWriterin classSequenceFileOutputFormat<BytesWritable,BytesWritable> - Parameters:
context- the information about the current task.- Returns:
- a
RecordWriterto write the output for the job. - Throws:
IOException
-
checkOutputSpecs
Description copied from class: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 context's JobConf.- Overrides:
checkOutputSpecsin classFileOutputFormat<BytesWritable,BytesWritable> - Parameters:
job- information about the job- Throws:
IOException- when output should not be attempted
-