|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cloudera.sqoop.tool.SqoopTool
com.cloudera.sqoop.tool.BaseSqoopTool
com.cloudera.sqoop.tool.ImportTool
public class ImportTool
Tool that performs database imports to HDFS.
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Fields inherited from class com.cloudera.sqoop.tool.SqoopTool |
---|
extraArguments |
Constructor Summary | |
---|---|
ImportTool()
|
|
ImportTool(java.lang.String toolName,
boolean allTables)
|
Method Summary | |
---|---|
void |
applyOptions(org.apache.commons.cli.CommandLine in,
SqoopOptions out)
Generate the SqoopOptions containing actual argument values from the extracted CommandLine arguments. |
void |
configureOptions(ToolOptions toolOptions)
Configure the command-line arguments we expect to receive. |
java.util.List<java.lang.String> |
getGeneratedJarFiles()
|
protected RelatedOptions |
getImportOptions()
Construct the set of options that control imports, either of one table or a batch of tables. |
protected void |
importTable(SqoopOptions options,
java.lang.String tableName,
HiveImport hiveImport)
|
protected boolean |
init(SqoopOptions sqoopOpts)
Should be called at the beginning of the run() method to initialize the connection manager, etc. |
void |
printHelp(ToolOptions toolOptions)
Print the help message for this tool. |
int |
run(SqoopOptions options)
Main body of code to run the tool. |
protected void |
validateImportOptions(SqoopOptions options)
Validate import-specific arguments. |
void |
validateOptions(SqoopOptions options)
Validates options and ensures that any required options are present and that any mutually-exclusive options are not selected. |
Methods inherited from class com.cloudera.sqoop.tool.SqoopTool |
---|
appendArgs, getTool, getToolDescription, getToolName, getToolNames, parseArguments, setToolName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public ImportTool()
public ImportTool(java.lang.String toolName, boolean allTables)
Method Detail |
---|
protected boolean init(SqoopOptions sqoopOpts)
BaseSqoopTool
init
in class BaseSqoopTool
public java.util.List<java.lang.String> getGeneratedJarFiles()
protected void importTable(SqoopOptions options, java.lang.String tableName, HiveImport hiveImport) throws java.io.IOException, ImportException
java.io.IOException
ImportException
public int run(SqoopOptions options)
SqoopTool
run
in class SqoopTool
options
- the SqoopOptions configured via
configureOptions()/applyOptions().
protected RelatedOptions getImportOptions()
public void configureOptions(ToolOptions toolOptions)
SqoopTool
configureOptions
in class SqoopTool
toolOptions
- a ToolOptions that should be populated with sets of
RelatedOptions for the tool.public void printHelp(ToolOptions toolOptions)
SqoopTool
printHelp
in class SqoopTool
toolOptions
- the configured tool optionspublic void applyOptions(org.apache.commons.cli.CommandLine in, SqoopOptions out) throws SqoopOptions.InvalidOptionsException
SqoopTool
applyOptions
in class SqoopTool
in
- the CLI CommandLine that contain the user's set Options.out
- the SqoopOptions with all fields applied.
SqoopOptions.InvalidOptionsException
- if there's a problem.protected void validateImportOptions(SqoopOptions options) throws SqoopOptions.InvalidOptionsException
options
- the configured SqoopOptions to check
SqoopOptions.InvalidOptionsException
public void validateOptions(SqoopOptions options) throws SqoopOptions.InvalidOptionsException
SqoopTool
validateOptions
in class SqoopTool
SqoopOptions.InvalidOptionsException
- if there's a problem.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |