K
- The type of the internalInputFormat's keysV
- The type of the internalInputFormat's values
public class AdapterInputFormat<K,V>
extends org.apache.hadoop.mapred.FileInputFormat<K,V>
implements org.apache.hadoop.mapred.JobConfigurable
This input format works as an adapter for subclasses of the new API' org.apache.hadoop.mapreduce.lib.input.FileInputFormat
The internal InputFormat class must be set using the static method AdapterInputFormat#setInternalInputFormatClass(JobConf, Class)
Note that when using a new API' InputFormat with SpatialIndexingMapper
it will be not possible to get the start position for each record so the index' entries will not contain the record pointer information (offset and length).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NEW_INPUT_FORMAT |
Constructor and Description |
---|
AdapterInputFormat() |
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.hadoop.mapred.JobConf conf) |
org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V> |
getInternalInputFormat(org.apache.hadoop.mapred.JobConf conf)
Gets an instance of the class set as the internal input format
|
static <K,V> java.lang.Class<? extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V>> |
getInternalInputFormatClass(org.apache.hadoop.mapred.JobConf conf)
Gets the internal input format type which is used to actually read the data.
|
org.apache.hadoop.mapred.RecordReader<K,V> |
getRecordReader(org.apache.hadoop.mapred.InputSplit split, org.apache.hadoop.mapred.JobConf conf, org.apache.hadoop.mapred.Reporter reporter) |
org.apache.hadoop.mapred.InputSplit[] |
getSplits(org.apache.hadoop.mapred.JobConf conf, int arg1) |
static <K,V> void |
setInternalInputFormatClass(org.apache.hadoop.mapred.JobConf conf, java.lang.Class<? extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V>> inputFormatClass)
Sets the internal input format type which is used to actually read the data.
|
addInputPath, addInputPathRecursively, addInputPaths, computeSplitSize, getBlockIndex, getInputPathFilter, getInputPaths, getSplitHosts, isSplitable, listStatus, makeSplit, makeSplit, setInputPathFilter, setInputPaths, setInputPaths, setMinSplitSize
public static final java.lang.String NEW_INPUT_FORMAT
public static <K,V> void setInternalInputFormatClass(org.apache.hadoop.mapred.JobConf conf, java.lang.Class<? extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V>> inputFormatClass)
conf
- the job configurationinputFormatClass
- a class of type org.apache.hadoop.mapreduce.lib.input.FileInputFormatpublic static <K,V> java.lang.Class<? extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V>> getInternalInputFormatClass(org.apache.hadoop.mapred.JobConf conf)
conf
- the job configurationpublic org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V> getInternalInputFormat(org.apache.hadoop.mapred.JobConf conf)
conf
- the job configurationpublic void configure(org.apache.hadoop.mapred.JobConf conf)
configure
in interface org.apache.hadoop.mapred.JobConfigurable
public org.apache.hadoop.mapred.RecordReader<K,V> getRecordReader(org.apache.hadoop.mapred.InputSplit split, org.apache.hadoop.mapred.JobConf conf, org.apache.hadoop.mapred.Reporter reporter) throws java.io.IOException
public org.apache.hadoop.mapred.InputSplit[] getSplits(org.apache.hadoop.mapred.JobConf conf, int arg1) throws java.io.IOException