@InterfaceAudience.Public @InterfaceStability.Evolving public class DBRecordReader<T extends DBWritable> extends RecordReader<LongWritable,T>
限定符和类型 | 字段和说明 |
---|---|
protected PreparedStatement |
statement |
构造器和说明 |
---|
DBRecordReader(DBInputFormat.DBInputSplit split,
Class<T> inputClass,
Configuration conf,
Connection conn,
DBConfiguration dbConfig,
String cond,
String[] fields,
String table) |
限定符和类型 | 方法和说明 |
---|---|
void |
close()
Close the record reader.
|
T |
createValue()
已过时。
|
protected ResultSet |
executeQuery(String query) |
protected String |
getConditions() |
protected Connection |
getConnection() |
LongWritable |
getCurrentKey()
Get the current key
|
T |
getCurrentValue()
Get the current value.
|
protected DBConfiguration |
getDBConf() |
protected String[] |
getFieldNames() |
long |
getPos()
已过时。
|
float |
getProgress()
The current progress of the record reader through its data.
|
protected String |
getSelectQuery()
Returns the query for selecting the records,
subclasses can override this for custom behaviour.
|
protected DBInputFormat.DBInputSplit |
getSplit() |
protected PreparedStatement |
getStatement() |
protected String |
getTableName() |
void |
initialize(InputSplit split,
TaskAttemptContext context)
Called once at initialization.
|
boolean |
next(LongWritable key,
T value)
已过时。
Use
nextKeyValue() |
boolean |
nextKeyValue()
Read the next key, value pair.
|
protected void |
setStatement(PreparedStatement stmt) |
protected PreparedStatement statement
public DBRecordReader(DBInputFormat.DBInputSplit split, Class<T> inputClass, Configuration conf, Connection conn, DBConfiguration dbConfig, String cond, String[] fields, String table) throws SQLException
split
- The InputSplit to read data forSQLException
protected ResultSet executeQuery(String query) throws SQLException
SQLException
protected String getSelectQuery()
public void close() throws IOException
close
在接口中 Closeable
close
在接口中 AutoCloseable
close
在类中 RecordReader<LongWritable,T extends DBWritable>
IOException
public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException
RecordReader
initialize
在类中 RecordReader<LongWritable,T extends DBWritable>
split
- the split that defines the range of records to readcontext
- the information about the taskIOException
InterruptedException
public LongWritable getCurrentKey()
getCurrentKey
在类中 RecordReader<LongWritable,T extends DBWritable>
public T getCurrentValue()
getCurrentValue
在类中 RecordReader<LongWritable,T extends DBWritable>
@Deprecated public T createValue()
@Deprecated public long getPos() throws IOException
IOException
@Deprecated public boolean next(LongWritable key, T value) throws IOException
nextKeyValue()
IOException
public float getProgress() throws IOException
getProgress
在类中 RecordReader<LongWritable,T extends DBWritable>
IOException
public boolean nextKeyValue() throws IOException
nextKeyValue
在类中 RecordReader<LongWritable,T extends DBWritable>
IOException
protected DBInputFormat.DBInputSplit getSplit()
protected String[] getFieldNames()
protected String getTableName()
protected String getConditions()
protected DBConfiguration getDBConf()
protected Connection getConnection()
protected PreparedStatement getStatement()
protected void setStatement(PreparedStatement stmt)
Copyright © 2009 The Apache Software Foundation