org.elasticsearch.hadoop.mr
Class EsInputFormat<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.InputFormat<K,V>
org.elasticsearch.hadoop.mr.EsInputFormat<K,V>
- All Implemented Interfaces:
- InputFormat<K,V>
- Direct Known Subclasses:
- EsHiveInputFormat, EsPigInputFormat
public class EsInputFormat<K,V>
- extends InputFormat<K,V>
- implements InputFormat<K,V>
ElasticSearch InputFormat
for streaming data (typically based on a query) from ElasticSearch.
Returns the document ID as key and its content as value.
This class implements both the "old" (org.apache.hadoop.mapred) and the "new" (org.apache.hadoop.mapreduce) API.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EsInputFormat
public EsInputFormat()
getSplits
public List<InputSplit> getSplits(JobContext context)
throws IOException
- Specified by:
getSplits
in class InputFormat<K,V>
- Throws:
IOException
createRecordReader
public EsInputFormat.ShardRecordReader<K,V> createRecordReader(InputSplit split,
TaskAttemptContext context)
- Specified by:
createRecordReader
in class InputFormat<K,V>
getSplits
public InputSplit[] getSplits(JobConf job,
int numSplits)
throws IOException
- Specified by:
getSplits
in interface InputFormat<K,V>
- Throws:
IOException
getRecordReader
public EsInputFormat.ShardRecordReader<K,V> getRecordReader(InputSplit split,
JobConf job,
Reporter reporter)
- Specified by:
getRecordReader
in interface InputFormat<K,V>