Package oracle.kv.hadoop.hive.table
Class TableHiveRecordReader
- java.lang.Object
-
- oracle.kv.hadoop.hive.table.TableHiveRecordReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,RecordReader<Text,Text>
public class TableHiveRecordReader extends Object implements RecordReader<Text,Text>
Concrete implementation of RecordReader; used to read PrimaryKey/Row pairs from an InputSplit.Note that this RecordReader is based on version 1 of MapReduce (as required by the Hive infrastructure), but wraps and delegates to a YARN based (MapReduce version 2) RecordReader. This is done because the RecordReader provided by Oracle NoSQL Database to support Hadoop integration is YARN based, and this class wishes to exploit and reuse the functionality already provided by the YARN based RecordReader class. - Note on Logging - Two loggers are currently employed by this class:
- One logger based on Log4j version 1, accessed via the org.apache.commons.logging wrapper.
- One logger based on the Log4j2 API.
-
-
Constructor Summary
Constructors Constructor Description TableHiveRecordReader(JobConf jobConf, TableRecordReader v2RecordReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Text
createKey()
Get the current key.Text
createValue()
Get the current value.long
getPos()
float
getProgress()
boolean
next(Text key, Text value)
-
-
-
Constructor Detail
-
TableHiveRecordReader
public TableHiveRecordReader(JobConf jobConf, TableRecordReader v2RecordReader)
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceRecordReader<Text,Text>
- Throws:
IOException
-
getPos
public long getPos() throws IOException
- Specified by:
getPos
in interfaceRecordReader<Text,Text>
- Throws:
IOException
-
getProgress
public float getProgress()
- Specified by:
getProgress
in interfaceRecordReader<Text,Text>
-
next
public boolean next(Text key, Text value) throws IOException
- Specified by:
next
in interfaceRecordReader<Text,Text>
- Throws:
IOException
-
createKey
public Text createKey()
Get the current key.- Specified by:
createKey
in interfaceRecordReader<Text,Text>
- Returns:
- the current key or null if there is no current key
-
createValue
public Text createValue()
Get the current value.- Specified by:
createValue
in interfaceRecordReader<Text,Text>
- Returns:
- the object that was read
-
-