Package org.apache.hadoop.mapred.lib
Class LazyOutputFormat<K,V>
java.lang.Object
org.apache.hadoop.mapred.lib.FilterOutputFormat<K,V>
org.apache.hadoop.mapred.lib.LazyOutputFormat<K,V>
- All Implemented Interfaces:
OutputFormat<K,V>
A Convenience class that creates output lazily.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapred.lib.FilterOutputFormat
org.apache.hadoop.mapred.lib.FilterOutputFormat.FilterRecordWriter<K,V> -
Field Summary
Fields inherited from class org.apache.hadoop.mapred.lib.FilterOutputFormat
baseOut -
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 voidsetOutputFormatClass(JobConf job, Class<? extends OutputFormat> theClass) Set the underlying output format for LazyOutputFormat.
-
Constructor Details
-
LazyOutputFormat
public LazyOutputFormat()
-
-
Method Details
-
setOutputFormatClass
Set the underlying output format for LazyOutputFormat.- Parameters:
job- theJobConfto modifytheClass- the underlying class
-
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> - Overrides:
getRecordWriterin classFilterOutputFormat<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
-
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<K,V> - Overrides:
checkOutputSpecsin classFilterOutputFormat<K,V> job- job configuration.- Throws:
IOException- when output should not be attempted
-