|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cloudera.sqoop.manager.ConnManager
com.cloudera.sqoop.manager.SqlManager
com.cloudera.sqoop.manager.GenericJdbcManager
com.cloudera.sqoop.manager.MySQLManager
public class MySQLManager
Manages connections to MySQL databases.
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Fields inherited from class com.cloudera.sqoop.manager.SqlManager |
---|
options |
Constructor Summary | |
---|---|
|
MySQLManager(SqoopOptions opts)
|
protected |
MySQLManager(SqoopOptions opts,
boolean ignored)
|
Method Summary | |
---|---|
java.lang.String |
escapeColName(java.lang.String colName)
When using a column name in a generated SQL query, how (if at all) should we escape that column name? e.g., a column named "table" may need to be quoted with backtiks: "`table`". |
java.lang.String |
escapeTableName(java.lang.String tableName)
When using a table name in a generated SQL query, how (if at all) should we escape that column name? e.g., a table named "table" may need to be quoted with backtiks: "`table`". |
void |
execAndPrint(java.lang.String s)
Poor man's SQL query interface; used for debugging. |
protected java.sql.ResultSet |
execute(java.lang.String stmt,
java.lang.Object... args)
Executes an arbitrary SQL statement. |
protected java.lang.String |
getColNamesQuery(java.lang.String tableName)
|
void |
importTable(ImportJobContext context)
Default implementation of importTable() is to launch a MapReduce job via DataDrivenImportJob to read the table with DataDrivenDBInputFormat. |
java.lang.String[] |
listDatabases()
Return a list of all databases on a server. |
protected static void |
markWarningPrinted()
Set a flag to prevent printing the --direct warning twice. |
void |
release()
If a method of this ConnManager has returned a ResultSet to you, you are responsible for calling release() after you close the ResultSet object, to free internal resources. |
Methods inherited from class com.cloudera.sqoop.manager.GenericJdbcManager |
---|
close, discardConnection, getConnection, getDriverClass, hasOpenConnection |
Methods inherited from class com.cloudera.sqoop.manager.SqlManager |
---|
exportTable, formatAndPrintResultSet, getColTypesQuery, getColumnNames, getColumnTypes, getPrimaryKey, getSplitColumn, listTables, makeConnection, readTable, toHiveType, toJavaType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public MySQLManager(SqoopOptions opts)
protected MySQLManager(SqoopOptions opts, boolean ignored)
Method Detail |
---|
protected java.lang.String getColNamesQuery(java.lang.String tableName)
getColNamesQuery
in class SqlManager
public java.lang.String[] listDatabases()
ConnManager
listDatabases
in class SqlManager
public void importTable(ImportJobContext context) throws java.io.IOException, ImportException
SqlManager
importTable
in class SqlManager
java.io.IOException
ImportException
protected static void markWarningPrinted()
protected java.sql.ResultSet execute(java.lang.String stmt, java.lang.Object... args) throws java.sql.SQLException
execute
in class SqlManager
stmt
- The SQL statement to execute
java.sql.SQLException
public void execAndPrint(java.lang.String s)
SqlManager
execAndPrint
in class SqlManager
s
- the SQL statement to execute.public void release()
ConnManager
release
in class SqlManager
public java.lang.String escapeColName(java.lang.String colName)
escapeColName
in class ConnManager
colName
- the column name as provided by the user, etc.
public java.lang.String escapeTableName(java.lang.String tableName)
escapeTableName
in class ConnManager
tableName
- the table name as provided by the user, etc.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |