mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 03:09:57 +08:00
SQOOP-191. Supplying programmatic configuration.
(Aaron Kimball via Arvind Prabhakar) From: Arvind Prabhakar <arvind@cloudera.com> git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150027 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aa41d0635e
commit
79fd6b4d84
@ -193,7 +193,7 @@ public static int runSqoop(Sqoop sqoop, String [] args) {
|
||||
* Entry-point that parses the correct SqoopTool to use from the args,
|
||||
* but does not call System.exit() as main() will.
|
||||
*/
|
||||
public static int runTool(String [] args) {
|
||||
public static int runTool(String [] args, Configuration conf) {
|
||||
// Expand the options
|
||||
String[] expandedArgs = null;
|
||||
try {
|
||||
@ -206,7 +206,7 @@ public static int runTool(String [] args) {
|
||||
}
|
||||
|
||||
String toolName = expandedArgs[0];
|
||||
Configuration pluginConf = SqoopTool.loadPlugins(new Configuration());
|
||||
Configuration pluginConf = SqoopTool.loadPlugins(conf);
|
||||
SqoopTool tool = SqoopTool.getTool(toolName);
|
||||
if (null == tool) {
|
||||
System.err.println("No such sqoop tool: " + toolName
|
||||
@ -220,6 +220,14 @@ public static int runTool(String [] args) {
|
||||
Arrays.copyOfRange(expandedArgs, 1, expandedArgs.length));
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry-point that parses the correct SqoopTool to use from the args,
|
||||
* but does not call System.exit() as main() will.
|
||||
*/
|
||||
public static int runTool(String [] args) {
|
||||
return runTool(args, new Configuration());
|
||||
}
|
||||
|
||||
public static void main(String [] args) {
|
||||
if (args.length == 0) {
|
||||
System.err.println("Try 'sqoop help' for usage.");
|
||||
|
Loading…
Reference in New Issue
Block a user