protected class DBInputFormat.DBRecordReader extends DBRecordReader<T> implements RecordReader<org.apache.hadoop.io.LongWritable,T>
statement
Modifier | Constructor and Description |
---|---|
protected |
DBRecordReader(DBInputFormat.DBInputSplit split,
Class<T> inputClass,
JobConf job)
The constructor is kept to be compatible with M/R 1.x
|
protected |
DBRecordReader(DBInputFormat.DBInputSplit split,
Class<T> inputClass,
JobConf job,
Connection conn,
DBConfiguration dbConfig,
String cond,
String[] fields,
String table) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.io.LongWritable |
createKey()
Create an object of the appropriate type to be used as a key.
|
T |
createValue()
Create an object of the appropriate type to be used as a value.
|
long |
getPos()
Returns the current position in the input.
|
boolean |
next(org.apache.hadoop.io.LongWritable key,
T value)
Reads the next key/value pair from the input for processing.
|
close, executeQuery, getConditions, getConnection, getCurrentKey, getCurrentValue, getDBConf, getFieldNames, getProgress, getSelectQuery, getSplit, getStatement, getTableName, initialize, nextKeyValue, setStatement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getProgress
protected DBRecordReader(DBInputFormat.DBInputSplit split, Class<T> inputClass, JobConf job) throws SQLException
split
- The InputSplit to read data forSQLException
protected DBRecordReader(DBInputFormat.DBInputSplit split, Class<T> inputClass, JobConf job, Connection conn, DBConfiguration dbConfig, String cond, String[] fields, String table) throws SQLException
split
- The InputSplit to read data forSQLException
public org.apache.hadoop.io.LongWritable createKey()
createKey
in interface RecordReader<org.apache.hadoop.io.LongWritable,T extends DBWritable>
public T createValue()
createValue
in interface RecordReader<org.apache.hadoop.io.LongWritable,T extends DBWritable>
createValue
in class DBRecordReader<T extends DBWritable>
public long getPos() throws IOException
RecordReader
getPos
in interface RecordReader<org.apache.hadoop.io.LongWritable,T extends DBWritable>
getPos
in class DBRecordReader<T extends DBWritable>
IOException
public boolean next(org.apache.hadoop.io.LongWritable key, T value) throws IOException
next
in interface RecordReader<org.apache.hadoop.io.LongWritable,T extends DBWritable>
next
in class DBRecordReader<T extends DBWritable>
key
- the key to read data intovalue
- the value to read data intoIOException
Copyright © 2017 Apache Software Foundation. All Rights Reserved.