@InterfaceAudience.Public
public class MROutput
extends org.apache.tez.runtime.api.AbstractLogicalOutput
MROutput
is an Output
which allows key/values pairs
to be written by a processor.
It is compatible with all standard Apache Hadoop MapReduce
OutputFormat implementations.
This class is not meant to be extended by external projects.Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.mapreduce.OutputCommitter |
committer |
protected AtomicBoolean |
flushed |
protected org.apache.hadoop.mapred.JobConf |
jobConf |
protected org.apache.tez.common.counters.TezCounter |
outputRecordCounter |
Constructor and Description |
---|
MROutput(org.apache.tez.runtime.api.OutputContext outputContext,
int numPhysicalOutputs) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
MROutput expects that a Processor call abort in case of any error
( including an error during commit ) prior to the Processor's completion
|
List<org.apache.tez.runtime.api.Event> |
close() |
void |
commit()
MROutput expects that a Processor call commit prior to the
Processor's completion
|
static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder |
createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
Class<?> outputFormat)
Create an
MROutput.MROutputConfigBuilder |
static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder |
createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
Class<?> outputFormat,
boolean useLazyOutputFormat) |
static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder |
createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
Class<?> outputFormat,
String outputPath)
Create an
MROutput.MROutputConfigBuilder for a FileOutputFormat
or FileOutputFormat based OutputFormats. |
static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder |
createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
Class<?> outputFormat,
String outputPath,
boolean useLazyOutputFormat) |
void |
flush()
Call this in the processor before finishing to ensure outputs that
outputs have been flushed.
|
protected String |
getOutputFileNamePrefix() |
protected String |
getOutputName(String prefix) |
org.apache.tez.runtime.library.api.KeyValueWriter |
getWriter()
Get a key value write to write Map Reduce compatible output
|
void |
handleEvents(List<org.apache.tez.runtime.api.Event> outputEvents) |
void |
initCommitter(org.apache.hadoop.mapred.JobConf job,
boolean useNewApi) |
List<org.apache.tez.runtime.api.Event> |
initialize() |
protected List<org.apache.tez.runtime.api.Event> |
initializeBase() |
boolean |
isCommitRequired() |
void |
start() |
protected org.apache.hadoop.mapred.JobConf jobConf
protected AtomicBoolean flushed
protected org.apache.tez.common.counters.TezCounter outputRecordCounter
protected org.apache.hadoop.mapreduce.OutputCommitter committer
public MROutput(org.apache.tez.runtime.api.OutputContext outputContext, int numPhysicalOutputs)
public static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder createConfigBuilder(org.apache.hadoop.conf.Configuration conf, @Nullable Class<?> outputFormat)
MROutput.MROutputConfigBuilder
The preferred usage model is to provide all of the parameters, and use methods to configure
the Output.
For legacy applications, which may already have a fully configured Configuration
instance, the outputFormat can be specified as nullconf
- Configuration for the MROutput
. This configuration instance will be
modified in placeoutputFormat
- OutputFormat derived class. If the OutputFormat specified is
null, the provided configuration should be complete.MROutput.MROutputConfigBuilder
public static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder createConfigBuilder(org.apache.hadoop.conf.Configuration conf, @Nullable Class<?> outputFormat, boolean useLazyOutputFormat)
public static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder createConfigBuilder(org.apache.hadoop.conf.Configuration conf, @Nullable Class<?> outputFormat, @Nullable String outputPath)
MROutput.MROutputConfigBuilder
for a FileOutputFormat
or FileOutputFormat
based OutputFormats.
The preferred usage model is to provide all of the parameters, and use methods to configure the
Output.
For legacy applications, which may already have a fully configured Configuration
instance, the outputFormat and outputPath can be specified as nullconf
- Configuration for the MROutput
. This configuration instance will be
modified in placeoutputFormat
- FileInputFormat derived class. If the InputFormat specified is
null, the provided configuration should be complete.outputPath
- Output path. This can be null if already setup in the configurationMROutput.MROutputConfigBuilder
public static org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder createConfigBuilder(org.apache.hadoop.conf.Configuration conf, @Nullable Class<?> outputFormat, @Nullable String outputPath, boolean useLazyOutputFormat)
public List<org.apache.tez.runtime.api.Event> initialize() throws IOException, InterruptedException
initialize
in interface org.apache.tez.runtime.api.OutputFrameworkInterface
initialize
in class org.apache.tez.runtime.api.AbstractLogicalOutput
IOException
InterruptedException
protected List<org.apache.tez.runtime.api.Event> initializeBase() throws IOException, InterruptedException
IOException
InterruptedException
public void start()
public void initCommitter(org.apache.hadoop.mapred.JobConf job, boolean useNewApi) throws IOException, InterruptedException
IOException
InterruptedException
public boolean isCommitRequired() throws IOException
IOException
protected String getOutputFileNamePrefix()
public org.apache.tez.runtime.library.api.KeyValueWriter getWriter() throws IOException
IOException
public void handleEvents(List<org.apache.tez.runtime.api.Event> outputEvents)
public List<org.apache.tez.runtime.api.Event> close() throws IOException
IOException
public void flush() throws IOException
IOException
public void commit() throws IOException
IOException
public void abort() throws IOException
IOException
Copyright © 2024 Apache Software Foundation. All rights reserved.