@InterfaceAudience.Public public class MRInput extends 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 | Class and Description |
---|---|
static class |
MRInput.MRInputConfigBuilder
Helper class to configure
MRInput |
Modifier and Type | Field and Description |
---|---|
protected MRReader |
mrReader |
protected org.apache.hadoop.mapreduce.split.JobSplit.TaskSplitIndex |
splitMetaInfo |
static String |
TEZ_MAPREDUCE_APPLICATION_ID |
static String |
TEZ_MAPREDUCE_DAG_ATTEMPT_NUMBER |
static String |
TEZ_MAPREDUCE_DAG_INDEX |
static String |
TEZ_MAPREDUCE_DAG_NAME |
static String |
TEZ_MAPREDUCE_INPUT_INDEX |
static String |
TEZ_MAPREDUCE_INPUT_NAME |
static String |
TEZ_MAPREDUCE_TASK_ATTEMPT_INDEX |
static String |
TEZ_MAPREDUCE_TASK_INDEX |
static String |
TEZ_MAPREDUCE_UNIQUE_IDENTIFIER |
static String |
TEZ_MAPREDUCE_VERTEX_INDEX |
static String |
TEZ_MAPREDUCE_VERTEX_NAME |
inputRecordCounter, jobConf, useNewApi
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 MRInput.MRInputConfigBuilder |
createConfigBuilder(org.apache.hadoop.conf.Configuration conf,
Class<?> inputFormat)
Create an
MRInput.MRInputConfigBuilder |
static 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() |
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_DAG_INDEX
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_DAG_NAME
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_VERTEX_INDEX
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_VERTEX_NAME
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_TASK_INDEX
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_TASK_ATTEMPT_INDEX
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_INPUT_INDEX
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_INPUT_NAME
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_APPLICATION_ID
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_UNIQUE_IDENTIFIER
@InterfaceAudience.Private public static final String TEZ_MAPREDUCE_DAG_ATTEMPT_NUMBER
protected MRReader mrReader
protected org.apache.hadoop.mapreduce.split.JobSplit.TaskSplitIndex splitMetaInfo
public MRInput(org.apache.tez.runtime.api.InputContext inputContext, int numPhysicalInputs)
public static 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.MRInputConfigBuilder
public static 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.MRInputConfigBuilder
public List<org.apache.tez.runtime.api.Event> initialize() throws IOException
initialize
in interface org.apache.tez.runtime.api.InputFrameworkInterface
initialize
in class MRInputBase
IOException
public 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.Input
getReader
in class MRInputBase
IOException
public void handleEvents(List<org.apache.tez.runtime.api.Event> inputEvents) throws Exception
Exception
public List<org.apache.tez.runtime.api.Event> close() throws IOException
IOException
public 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
.MRInput
public float getProgress() throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2016 Apache Software Foundation. All rights reserved.