@PublicApi @ThreadSafe public final class KeyValueOutputFormat extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
OutputFormat
implementation to let MapReduce job write to a key-value store under the
MapReduce output directory.
There are different key-value stores under the output directory configured via MapReduce property
mapreduce.output.fileoutputformat.outputdir
for different tasks. The stores are merged
into one key-value store under the MapReduce output directory by KeyValueOutputCommitter
.
Constructor and Description |
---|
KeyValueOutputFormat()
Constructs a new
KeyValueOutputFormat . |
Modifier and Type | Method and Description |
---|---|
void |
checkOutputSpecs(org.apache.hadoop.mapreduce.JobContext jobContext) |
static AlluxioURI |
getJobOutputURI(org.apache.hadoop.mapreduce.JobContext jobContext) |
org.apache.hadoop.mapreduce.OutputCommitter |
getOutputCommitter(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) |
org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable> |
getRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext taskAttemptContext) |
static AlluxioURI |
getTaskOutputURI(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) |
getCompressOutput, getDefaultWorkFile, getOutputCompressorClass, getOutputName, getOutputPath, getPathForWorkFile, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputName, setOutputPath
public KeyValueOutputFormat()
KeyValueOutputFormat
.public static AlluxioURI getTaskOutputURI(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext)
taskContext
- MapReduce task contextpublic static AlluxioURI getJobOutputURI(org.apache.hadoop.mapreduce.JobContext jobContext)
jobContext
- MapReduce job configurationpublic org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable> getRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext taskAttemptContext) throws IOException
getRecordWriter
in class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
IOException
public void checkOutputSpecs(org.apache.hadoop.mapreduce.JobContext jobContext) throws IOException
This method is called immediately when job is submitted, a key-value store is created at the job's output directory, key-value stores created by MapReduce tasks will be merged into this store when task is submitted.
checkOutputSpecs
in class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
IOException
public org.apache.hadoop.mapreduce.OutputCommitter getOutputCommitter(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) throws IOException
getOutputCommitter
in class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
taskContext
- MapReduce task configurationKeyValueOutputCommitter
IOException
Copyright © 2023. All Rights Reserved.