org.apache.hadoop.mapred
Class OutputFormatBase

java.lang.Object
  extended by org.apache.hadoop.mapred.OutputFormatBase
All Implemented Interfaces:
OutputFormat
Direct Known Subclasses:
MapFileOutputFormat, SequenceFileOutputFormat, TextOutputFormat

public abstract class OutputFormatBase
extends Object
implements OutputFormat

A base class for OutputFormat.


Constructor Summary
OutputFormatBase()
           
 
Method Summary
 void checkOutputSpecs(FileSystem fs, JobConf job)
          Check whether the output specification for a job is appropriate.
abstract  RecordWriter getRecordWriter(FileSystem fs, JobConf job, String name)
          Construct a RecordWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputFormatBase

public OutputFormatBase()
Method Detail

getRecordWriter

public abstract RecordWriter getRecordWriter(FileSystem fs,
                                             JobConf job,
                                             String name)
                                      throws IOException
Description copied from interface: OutputFormat
Construct a RecordWriter.

Specified by:
getRecordWriter in interface OutputFormat
Parameters:
fs - the file system to write to
job - the job whose output is being written
name - the unique name for this part of the output
Returns:
a RecordWriter
Throws:
IOException

checkOutputSpecs

public void checkOutputSpecs(FileSystem fs,
                             JobConf job)
                      throws IOException
Description copied from interface: OutputFormat
Check whether the output specification for a job is appropriate. Called when 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.

Specified by:
checkOutputSpecs in interface OutputFormat
job - the job whose output will be written
Throws:
IOException - when output should not be attempted


Copyright © 2006 The Apache Software Foundation