Package org.elasticsearch.hadoop.mr
Class EsInputFormat.EsInputRecordReader<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<K,V>
org.elasticsearch.hadoop.mr.EsInputFormat.EsInputRecordReader<K,V>
- All Implemented Interfaces:
Closeable,AutoCloseable,RecordReader<K,V>
- Direct Known Subclasses:
EsInputFormat.AbstractWritableEsInputRecordReader
- Enclosing class:
- EsInputFormat<K,
V>
protected abstract static class EsInputFormat.EsInputRecordReader<K,V>
extends RecordReader<K,V>
implements RecordReader<K,V>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()abstract Kabstract VlonggetPos()floatvoidinitialize(InputSplit split, TaskAttemptContext context) booleanbooleanprotected abstract KsetCurrentKey(K hadoopKey, Object object) Sets the current key.protected abstract VsetCurrentValue(V hadoopValue, Object object) Sets the current value.
-
Constructor Details
-
EsInputRecordReader
public EsInputRecordReader() -
EsInputRecordReader
-
-
Method Details
-
initialize
- Specified by:
initializein classRecordReader<K,V> - Throws:
IOException
-
nextKeyValue
- Specified by:
nextKeyValuein classRecordReader<K,V> - Throws:
IOException
-
getCurrentKey
- Specified by:
getCurrentKeyin classRecordReader<K,V> - Throws:
IOException
-
getCurrentValue
- Specified by:
getCurrentValuein classRecordReader<K,V>
-
getProgress
public float getProgress()- Specified by:
getProgressin interfaceRecordReader<K,V> - Specified by:
getProgressin classRecordReader<K,V>
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceRecordReader<K,V> - Specified by:
closein classRecordReader<K,V> - Throws:
IOException
-
next
- Specified by:
nextin interfaceRecordReader<K,V> - Throws:
IOException
-
createKey
- Specified by:
createKeyin interfaceRecordReader<K,V>
-
createValue
- Specified by:
createValuein interfaceRecordReader<K,V>
-
setCurrentKey
Sets the current key.- Parameters:
hadoopKey- hadoop keyobject- the actual value to read- Returns:
- returns the key to be used; needed in scenario where the key is immutable
-
setCurrentValue
Sets the current value.- Parameters:
hadoopValue- hadoop valueobject- the actual value to read- Returns:
- returns the value to be used; needed in scenario where the passed value is immutable
-
getPos
public long getPos()- Specified by:
getPosin interfaceRecordReader<K,V>
-