@InterfaceAudience.Public
public class MRInput
extends org.apache.tez.mapreduce.input.base.MRInputBase
MRInput is an Input which provides key/values pairs
for the consumer.
It is compatible with all standard Apache Hadoop MapReduce
InputFormat implementations.
This class is not meant to be extended by external projects.| Modifier and Type | Field and Description |
|---|---|
protected org.apache.tez.mapreduce.lib.MRReader |
mrReader |
protected org.apache.hadoop.mapreduce.split.JobSplit.TaskSplitIndex |
splitMetaInfo |
| Constructor and Description |
|---|
MRInput(org.apache.tez.runtime.api.InputContext inputContext,
int numPhysicalInputs) |
| Modifier and Type | Method and Description |
|---|---|
List<org.apache.tez.runtime.api.Event> |
close() |
static org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder |
createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
Class<?> inputFormat)
Create an
MRInput.MRInputConfigBuilder |
static org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder |
createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
Class<?> inputFormat,
String inputPaths)
Create an
MRInput.MRInputConfigBuilder
for FileInputFormat
or FileInputFormat format based InputFormats. |
org.apache.hadoop.conf.Configuration |
getConfigUpdates()
MRInput sets some additional parameters like split location when using
the new API. |
float |
getProgress() |
org.apache.tez.runtime.library.api.KeyValueReader |
getReader()
Returns a
KeyValueReader that can be used to read
Map Reduce compatible key value data. |
void |
handleEvents(List<org.apache.tez.runtime.api.Event> inputEvents) |
List<org.apache.tez.runtime.api.Event> |
initialize() |
void |
start() |
protected org.apache.tez.mapreduce.lib.MRReader mrReader
protected org.apache.hadoop.mapreduce.split.JobSplit.TaskSplitIndex splitMetaInfo
public MRInput(org.apache.tez.runtime.api.InputContext inputContext,
int numPhysicalInputs)
public static org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
@Nullable
Class<?> inputFormat)
MRInput.MRInputConfigBuilder
The preferred usage model is to provide all of the parameters, and use methods to configure
the Input.
For legacy applications, which may already have a fully configured Configuration
instance, the inputFormat can be specified as nullconf - Configuration for the MRInput. This configuration instance will be
modified in placeinputFormat - InputFormat derived class. This can be null. If the InputFormat specified
is
null, the provided configuration should be complete.MRInput.MRInputConfigBuilderpublic static org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
@Nullable
Class<?> inputFormat,
@Nullable
String inputPaths)
MRInput.MRInputConfigBuilder
for FileInputFormat
or FileInputFormat format based InputFormats.
The preferred usage model is to provide all of the parameters, and use methods to configure
the Input.
For legacy applications, which may already have a fully configured Configuration
instance, the inputFormat and inputPath can be specified as nullconf - Configuration for the MRInput. This configuration instance will be
modified in placeinputFormat - InputFormat derived class. This can be null. If the InputFormat specified
is
null, the provided configuration should be complete.inputPaths - Comma separated input pathsMRInput.MRInputConfigBuilderpublic List<org.apache.tez.runtime.api.Event> initialize() throws IOException
initialize in interface org.apache.tez.runtime.api.InputFrameworkInterfaceinitialize in class org.apache.tez.mapreduce.input.base.MRInputBaseIOExceptionpublic void start()
public org.apache.tez.runtime.library.api.KeyValueReader getReader()
throws IOException
KeyValueReader that can be used to read
Map Reduce compatible key value data. An exception will be thrown if next()
is invoked after false, either from the framework or from the underlying InputFormatgetReader in interface org.apache.tez.runtime.api.InputgetReader in class org.apache.tez.mapreduce.input.base.MRInputBaseIOExceptionpublic void handleEvents(List<org.apache.tez.runtime.api.Event> inputEvents) throws Exception
Exceptionpublic List<org.apache.tez.runtime.api.Event> close() throws IOException
IOExceptionpublic org.apache.hadoop.conf.Configuration getConfigUpdates()
MRInput sets some additional parameters like split location when using
the new API. This methods returns the list of additional updates, and
should be used by Processors using the old MapReduce API with MRInput.MRInputpublic float getProgress()
throws org.apache.tez.runtime.api.ProgressFailedException,
InterruptedException
getProgress in class org.apache.tez.runtime.api.AbstractLogicalInputorg.apache.tez.runtime.api.ProgressFailedExceptionInterruptedExceptionCopyright © 2017 Apache Software Foundation. All rights reserved.