Class MapFileOutputFormat
java.lang.Object
org.apache.hadoop.mapreduce.OutputFormat<K,V>
org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<WritableComparable<?>,Writable>
org.apache.hadoop.mapreduce.lib.output.MapFileOutputFormat
@Public
@Stable
public class MapFileOutputFormat
extends FileOutputFormat<WritableComparable<?>,Writable>
An
OutputFormat that writes
MapFiles.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
FileOutputFormat.Counter -
Field Summary
Fields 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 TypeMethodDescriptionstatic <K extends WritableComparable<?>,V extends Writable>
WritablegetEntry(org.apache.hadoop.io.MapFile.Reader[] readers, Partitioner<K, V> partitioner, K key, V value) Get an entry from output generated by this class.static org.apache.hadoop.io.MapFile.Reader[]getReaders(Path dir, Configuration conf) Open the output generated by this format.getRecordWriter(TaskAttemptContext context) Get theRecordWriterfor the given task.Methods inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
checkOutputSpecs, getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputName, getOutputPath, getPathForWorkFile, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputName, setOutputPath
-
Constructor Details
-
MapFileOutputFormat
public MapFileOutputFormat()
-
-
Method Details
-
getRecordWriter
public RecordWriter<WritableComparable<?>,Writable> getRecordWriter(TaskAttemptContext context) throws IOException Description copied from class:OutputFormatGet theRecordWriterfor the given task.- Specified by:
getRecordWriterin classFileOutputFormat<WritableComparable<?>,Writable> - Parameters:
context- the information about the current task.- Returns:
- a
RecordWriterto write the output for the job. - Throws:
IOException
-
getReaders
public static org.apache.hadoop.io.MapFile.Reader[] getReaders(Path dir, Configuration conf) throws IOException Open the output generated by this format.- Throws:
IOException
-
getEntry
public static <K extends WritableComparable<?>,V extends Writable> Writable getEntry(org.apache.hadoop.io.MapFile.Reader[] readers, Partitioner<K, V> partitioner, K key, V value) throws IOExceptionGet an entry from output generated by this class.- Throws:
IOException
-