Package oracle.kv.hadoop.table
Class TableInputFormat
A Hadoop InputFormat class for reading data from an Oracle NoSQL Database.
Map/reduce keys and values are returned as PrimaryKey and Row objects
respectively.
For information on the parameters that may be passed to this class,
refer to the javadoc for the parent class of this class;
TableInputFormatBase
.
A simple example demonstrating the Oracle NoSQL DB Hadoop oracle.kv.hadoop.table.TableInputFormat class can be found in the KVHOME/example/table/hadoop directory. It demonstrates how, in a MapReduce job, to read records from an Oracle NoSQL Database that were written using Table API. The javadoc for that program describes the simple Map/Reduce processing as well as how to invoke the program in Hadoop.
- Since:
- 3.1
-
Nested Class Summary
Nested classes/interfaces inherited from class oracle.kv.hadoop.table.TableInputFormatBase
TableInputFormatBase.TopologyLocatorWrapper
-
Field Summary
Fields inherited from class oracle.kv.hadoop.table.TableInputFormatBase
topologyLocator, USER_SECURITY_DIR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateRecordReader
(InputSplit split, TaskAttemptContext context) Returns the RecordReader for the given InputSplit.void
setTopologyLocator
(TableInputFormatBase.TopologyLocatorWrapper newTopologyLocator) Special setter method that used by tests that wish to mock the wrapper for the TopologyLocator employed by the getSplits method of this class to connect to a store to retrieve the splits.Methods inherited from class oracle.kv.hadoop.table.TableInputFormatBase
clearLocalKVSecurity, setBatchSize, setConsistency, setDirection, setFieldRangeProperty, setKVHadoopHosts, setKVHelperHosts, setKVSecurity, setKVStoreName, setMaxBatches, setMaxRequests, setPrimaryKeyProperty, setQueryInfo, setTableName, setTimeout, setTimeoutUnit
-
Constructor Details
-
TableInputFormat
public TableInputFormat()No-arg constructor.
-
-
Method Details
-
createRecordReader
public RecordReader<PrimaryKey,Row> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException Returns the RecordReader for the given InputSplit.- Specified by:
createRecordReader
in classInputFormat<PrimaryKey,
Row> - Throws:
IOException
InterruptedException
-
setTopologyLocator
Special setter method that used by tests that wish to mock the wrapper for the TopologyLocator employed by the getSplits method of this class to connect to a store to retrieve the splits. This method is used by the tests to tell the TableInputFormat to use the given TopologyLocator mocked by the test rather than the non-mocked TopologyLocator created by the no-arg constructor of this class.
-