|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.lib.db.DBInputFormat.DBRecordReader
protected class DBInputFormat.DBRecordReader
A RecordReader that reads records from a SQL table. Emits LongWritables containing the record number as key and DBWritables as value.
Constructor Summary | |
---|---|
protected |
DBInputFormat.DBRecordReader(DBInputFormat.DBInputSplit split,
Class<T> inputClass,
JobConf job)
|
Method Summary | |
---|---|
void |
close()
Close this InputSplit to future operations. |
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. |
float |
getProgress()
How much of the input has the RecordReader consumed i.e. |
protected String |
getSelectQuery()
Returns the query for selecting the records, subclasses can override this for custom behaviour. |
boolean |
next(LongWritable key,
T value)
Reads the next key/value pair from the input for processing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DBInputFormat.DBRecordReader(DBInputFormat.DBInputSplit split, Class<T> inputClass, JobConf job) throws SQLException
split
- The InputSplit to read data for
SQLException
Method Detail |
---|
protected String getSelectQuery()
public void close() throws IOException
InputSplit
to future operations.
close
in interface RecordReader<LongWritable,T extends DBWritable>
IOException
public LongWritable createKey()
createKey
in interface RecordReader<LongWritable,T extends DBWritable>
public T createValue()
createValue
in interface RecordReader<LongWritable,T extends DBWritable>
public long getPos() throws IOException
getPos
in interface RecordReader<LongWritable,T extends DBWritable>
IOException
public float getProgress() throws IOException
RecordReader
consumed i.e.
has been processed by?
getProgress
in interface RecordReader<LongWritable,T extends DBWritable>
0.0
to 1.0
.
IOException
public boolean next(LongWritable key, T value) throws IOException
next
in interface RecordReader<LongWritable,T extends DBWritable>
key
- the key to read data intovalue
- the value to read data into
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |