elasticsearch-hadoop

org.elasticsearch.hadoop.hive
Class EsHiveInputFormat

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputFormat<K,V>
      extended by org.elasticsearch.hadoop.mr.EsInputFormat<Text,Map<Writable,Writable>>
          extended by org.elasticsearch.hadoop.hive.EsHiveInputFormat
All Implemented Interfaces:
InputFormat<Text,Map<Writable,Writable>>

public class EsHiveInputFormat
extends EsInputFormat<Text,Map<Writable,Writable>>

Hive specific InputFormat. Since Hive code base makes a lot of assumptions about the tables being actual files in HDFS (using instanceof checks without proper else) this class tries to 'fix' this by adding a dummy FileInputFormat to ESInputFormat.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.elasticsearch.hadoop.mr.EsInputFormat
EsInputFormat.ShardInputSplit, EsInputFormat.ShardRecordReader<K,V>, EsInputFormat.WritableShardRecordReader
 
Constructor Summary
EsHiveInputFormat()
           
 
Method Summary
 EsInputFormat.WritableShardRecordReader getRecordReader(InputSplit split, JobConf job, Reporter reporter)
           
 FileSplit[] getSplits(JobConf job, int numSplits)
           
 
Methods inherited from class org.elasticsearch.hadoop.mr.EsInputFormat
createRecordReader, getSplits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EsHiveInputFormat

public EsHiveInputFormat()
Method Detail

getSplits

public FileSplit[] getSplits(JobConf job,
                             int numSplits)
                      throws IOException
Specified by:
getSplits in interface InputFormat<Text,Map<Writable,Writable>>
Overrides:
getSplits in class EsInputFormat<Text,Map<Writable,Writable>>
Throws:
IOException

getRecordReader

public EsInputFormat.WritableShardRecordReader getRecordReader(InputSplit split,
                                                               JobConf job,
                                                               Reporter reporter)
Specified by:
getRecordReader in interface InputFormat<Text,Map<Writable,Writable>>
Overrides:
getRecordReader in class EsInputFormat<Text,Map<Writable,Writable>>

elasticsearch-hadoop