Class HadoopInputFormat<K,V>
- java.lang.Object
-
- org.apache.flink.api.common.io.RichInputFormat<T,SPITTYPE>
-
- org.apache.flink.api.java.hadoop.common.HadoopInputFormatCommonBase<T,HadoopInputSplit>
-
- org.apache.flink.api.java.hadoop.mapred.HadoopInputFormatBase<K,V,Tuple2<K,V>>
-
- org.apache.flink.api.java.hadoop.mapred.HadoopInputFormat<K,V>
-
- Type Parameters:
K
- Type of the keyV
- Type of the value.
- All Implemented Interfaces:
Serializable
,InputFormat<Tuple2<K,V>,HadoopInputSplit>
,ResultTypeQueryable<Tuple2<K,V>>
,InputSplitSource<HadoopInputSplit>
@Public public class HadoopInputFormat<K,V> extends HadoopInputFormatBase<K,V,Tuple2<K,V>> implements ResultTypeQueryable<Tuple2<K,V>>
Wrapper for using HadoopInputFormats (mapred-variant) with Flink.The IF is returning a
Tuple2<K,V>
.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.flink.api.java.hadoop.mapred.HadoopInputFormatBase
fetched, hasNext, key, keyClass, value, valueClass
-
Fields inherited from class org.apache.flink.api.java.hadoop.common.HadoopInputFormatCommonBase
credentials
-
-
Constructor Summary
Constructors Constructor Description HadoopInputFormat(org.apache.hadoop.mapred.InputFormat<K,V> mapredInputFormat, Class<K> key, Class<V> value)
HadoopInputFormat(org.apache.hadoop.mapred.InputFormat<K,V> mapredInputFormat, Class<K> key, Class<V> value, org.apache.hadoop.mapred.JobConf job)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeInformation<Tuple2<K,V>>
getProducedType()
Gets the data type (as aTypeInformation
) produced by this function or input format.Tuple2<K,V>
nextRecord(Tuple2<K,V> record)
Reads the next record from the input.-
Methods inherited from class org.apache.flink.api.java.hadoop.mapred.HadoopInputFormatBase
close, configure, createInputSplits, fetchNext, getInputSplitAssigner, getJobConf, getStatistics, open, reachedEnd
-
Methods inherited from class org.apache.flink.api.java.hadoop.common.HadoopInputFormatCommonBase
getCredentialsFromUGI, read, write
-
Methods inherited from class org.apache.flink.api.common.io.RichInputFormat
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
-
-
-
-
Method Detail
-
nextRecord
public Tuple2<K,V> nextRecord(Tuple2<K,V> record) throws IOException
Description copied from interface:InputFormat
Reads the next record from the input.When this method is called, the input format it guaranteed to be opened.
- Specified by:
nextRecord
in interfaceInputFormat<K,V>
- Parameters:
record
- Object that may be reused.- Returns:
- Read record.
- Throws:
IOException
- Thrown, if an I/O error occurred.
-
getProducedType
public TypeInformation<Tuple2<K,V>> getProducedType()
Description copied from interface:ResultTypeQueryable
Gets the data type (as aTypeInformation
) produced by this function or input format.- Specified by:
getProducedType
in interfaceResultTypeQueryable<K>
- Returns:
- The data type produced by this function or input format.
-
-