|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.RecordReader<LongWritable,T>
org.apache.hadoop.mapreduce.lib.db.DBRecordReader<T>
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,
Connection conn,
DBConfiguration dbConfig,
String cond,
String[] fields,
String table)
|
| Method Summary | |
|---|---|
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(LongWritable key,
T value)
Reads the next key/value pair from the input for processing. |
| Methods inherited from class org.apache.hadoop.mapreduce.lib.db.DBRecordReader |
|---|
close, executeQuery, getConditions, getConnection, getCurrentKey, getCurrentValue, getDBConf, getFieldNames, getProgress, getSelectQuery, getSplit, getStatement, getTableName, initialize, nextKeyValue, setStatement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.hadoop.mapred.RecordReader |
|---|
close, getProgress |
| Constructor Detail |
|---|
protected DBInputFormat.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 for
SQLException| Method Detail |
|---|
public LongWritable createKey()
createKey in interface RecordReader<LongWritable,T extends DBWritable>public T createValue()
createValue in interface RecordReader<LongWritable,T extends DBWritable>createValue in class DBRecordReader<T extends DBWritable>
public long getPos()
throws IOException
RecordReader
getPos in interface RecordReader<LongWritable,T extends DBWritable>getPos in class DBRecordReader<T extends DBWritable>IOException
public boolean next(LongWritable key,
T value)
throws IOException
next in interface RecordReader<LongWritable,T extends DBWritable>next in class DBRecordReader<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 | |||||||||