|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapreduce.lib.db.DBConfiguration
@InterfaceAudience.Public @InterfaceStability.Stable public class DBConfiguration
A container for configuration property names for jobs with DB input/output.
The job can be configured using the static methods in this class,
DBInputFormat
, and DBOutputFormat
.
Alternatively, the properties can be set in the configuration with proper
values.
configureDB(Configuration, String, String, String, String)
,
DBInputFormat.setInput(Job, Class, String, String)
,
DBInputFormat.setInput(Job, Class, String, String, String, String...)
,
DBOutputFormat.setOutput(Job, String, String...)
Field Summary | |
---|---|
static String |
DRIVER_CLASS_PROPERTY
The JDBC Driver class name |
static String |
INPUT_BOUNDING_QUERY
Input query to get the max and min values of the jdbc.input.query |
static String |
INPUT_CLASS_PROPERTY
Class name implementing DBWritable which will hold input tuples |
static String |
INPUT_CONDITIONS_PROPERTY
WHERE clause in the input SELECT statement |
static String |
INPUT_COUNT_QUERY
Input query to get the count of records |
static String |
INPUT_FIELD_NAMES_PROPERTY
Field names in the Input table |
static String |
INPUT_ORDER_BY_PROPERTY
ORDER BY clause in the input SELECT statement |
static String |
INPUT_QUERY
Whole input query, exluding LIMIT...OFFSET |
static String |
INPUT_TABLE_NAME_PROPERTY
Input table name |
static String |
OUTPUT_FIELD_COUNT_PROPERTY
Number of fields in the Output table |
static String |
OUTPUT_FIELD_NAMES_PROPERTY
Field names in the Output table |
static String |
OUTPUT_TABLE_NAME_PROPERTY
Output table name |
static String |
PASSWORD_PROPERTY
Password to access the database |
static String |
URL_PROPERTY
JDBC Database access URL |
static String |
USERNAME_PROPERTY
User name to access the database |
Constructor Summary | |
---|---|
DBConfiguration(Configuration job)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DRIVER_CLASS_PROPERTY
public static final String URL_PROPERTY
public static final String USERNAME_PROPERTY
public static final String PASSWORD_PROPERTY
public static final String INPUT_TABLE_NAME_PROPERTY
public static final String INPUT_FIELD_NAMES_PROPERTY
public static final String INPUT_CONDITIONS_PROPERTY
public static final String INPUT_ORDER_BY_PROPERTY
public static final String INPUT_QUERY
public static final String INPUT_COUNT_QUERY
public static final String INPUT_BOUNDING_QUERY
public static final String INPUT_CLASS_PROPERTY
public static final String OUTPUT_TABLE_NAME_PROPERTY
public static final String OUTPUT_FIELD_NAMES_PROPERTY
public static final String OUTPUT_FIELD_COUNT_PROPERTY
Constructor Detail |
---|
public DBConfiguration(Configuration job)
Method Detail |
---|
public static void configureDB(Configuration conf, String driverClass, String dbUrl, String userName, String passwd)
Configuration
.
conf
- the configurationdriverClass
- JDBC Driver class namedbUrl
- JDBC DB access URL.userName
- DB access usernamepasswd
- DB access passwdpublic static void configureDB(Configuration job, String driverClass, String dbUrl)
job
- the jobdriverClass
- JDBC Driver class namedbUrl
- JDBC DB access URL.public Connection getConnection() throws ClassNotFoundException, SQLException
ClassNotFoundException
SQLException
public Configuration getConf()
public String getInputTableName()
public void setInputTableName(String tableName)
public String[] getInputFieldNames()
public void setInputFieldNames(String... fieldNames)
public String getInputConditions()
public void setInputConditions(String conditions)
public String getInputOrderBy()
public void setInputOrderBy(String orderby)
public String getInputQuery()
public void setInputQuery(String query)
public String getInputCountQuery()
public void setInputCountQuery(String query)
public void setInputBoundingQuery(String query)
public String getInputBoundingQuery()
public Class<?> getInputClass()
public void setInputClass(Class<? extends DBWritable> inputClass)
public String getOutputTableName()
public void setOutputTableName(String tableName)
public String[] getOutputFieldNames()
public void setOutputFieldNames(String... fieldNames)
public void setOutputFieldCount(int fieldCount)
public int getOutputFieldCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |