|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.crunch.contrib.io.jdbc.DataBaseSource<T>
T - The input type of this sourcepublic class DataBaseSource<T extends org.apache.hadoop.mapreduce.lib.db.DBWritable & org.apache.hadoop.io.Writable>
Source from reading from a database via a JDBC connection. Underlying
database reading is provided by DBInputFormat.
A type that is input via this class must be a Writable that also implements
DBWritable. On the DBWritable.readFields(java.sql.ResultSet) method
needs to be fully implemented form DBWritable.
| Field Summary | |
|---|---|
String |
countClause
|
| Method Summary | |
|---|---|
void |
configureSource(org.apache.hadoop.mapreduce.Job job,
int inputId)
Configure the given job to use this source as an input. |
Converter<?,?,?,?> |
getConverter()
Returns the Converter used for mapping the inputs from this instance
into PCollection or PTable values. |
long |
getLastModifiedAt(org.apache.hadoop.conf.Configuration configuration)
Returns the time (in milliseconds) that this Source was most recently
modified (e.g., because an input file was edited or new files were added to
a directory.) |
long |
getSize(org.apache.hadoop.conf.Configuration configuration)
Returns the number of bytes in this Source. |
PType<T> |
getType()
Returns the PType for this source. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public String countClause
| Method Detail |
|---|
public void configureSource(org.apache.hadoop.mapreduce.Job job,
int inputId)
throws IOException
Source
configureSource in interface Source<T extends org.apache.hadoop.mapreduce.lib.db.DBWritable & org.apache.hadoop.io.Writable>job - The job to configureinputId - For a multi-input job, an identifier for this input to the job
IOExceptionpublic long getSize(org.apache.hadoop.conf.Configuration configuration)
SourceSource.
getSize in interface Source<T extends org.apache.hadoop.mapreduce.lib.db.DBWritable & org.apache.hadoop.io.Writable>public long getLastModifiedAt(org.apache.hadoop.conf.Configuration configuration)
SourceSource was most recently
modified (e.g., because an input file was edited or new files were added to
a directory.)
getLastModifiedAt in interface Source<T extends org.apache.hadoop.mapreduce.lib.db.DBWritable & org.apache.hadoop.io.Writable>public PType<T> getType()
SourcePType for this source.
getType in interface Source<T extends org.apache.hadoop.mapreduce.lib.db.DBWritable & org.apache.hadoop.io.Writable>public Converter<?,?,?,?> getConverter()
SourceConverter used for mapping the inputs from this instance
into PCollection or PTable values.
getConverter in interface Source<T extends org.apache.hadoop.mapreduce.lib.db.DBWritable & org.apache.hadoop.io.Writable>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||