mirror of
https://github.com/apache/sqoop.git
synced 2025-05-17 09:20:43 +08:00
SQOOP-981: The --hadoop-home command line parameter is no longer accepted
(Venkat Ranganathan via Jarek Jarcec Cecho)
This commit is contained in:
parent
f5006b6005
commit
2d3341488f
@ -401,6 +401,11 @@ protected RelatedOptions getCommonOptions() {
|
|||||||
.withLongOpt(HADOOP_MAPRED_HOME_ARG)
|
.withLongOpt(HADOOP_MAPRED_HOME_ARG)
|
||||||
.create());
|
.create());
|
||||||
|
|
||||||
|
commonOpts.addOption(OptionBuilder.withArgName("hdir")
|
||||||
|
.hasArg().withDescription("Override $HADOOP_MAPRED_HOME_ARG")
|
||||||
|
.withLongOpt(HADOOP_HOME_ARG)
|
||||||
|
.create());
|
||||||
|
|
||||||
// misc (common)
|
// misc (common)
|
||||||
commonOpts.addOption(OptionBuilder
|
commonOpts.addOption(OptionBuilder
|
||||||
.withDescription("Print more information while working")
|
.withDescription("Print more information while working")
|
||||||
@ -749,11 +754,12 @@ protected void applyCommonOptions(CommandLine in, SqoopOptions out)
|
|||||||
|
|
||||||
applyCredentialsOptions(in, out);
|
applyCredentialsOptions(in, out);
|
||||||
|
|
||||||
if (in.hasOption(HADOOP_HOME_ARG)) {
|
|
||||||
out.setHadoopMapRedHome(in.getOptionValue(HADOOP_HOME_ARG));
|
|
||||||
}
|
|
||||||
if (in.hasOption(HADOOP_MAPRED_HOME_ARG)) {
|
if (in.hasOption(HADOOP_MAPRED_HOME_ARG)) {
|
||||||
out.setHadoopMapRedHome(in.getOptionValue(HADOOP_MAPRED_HOME_ARG));
|
out.setHadoopMapRedHome(in.getOptionValue(HADOOP_MAPRED_HOME_ARG));
|
||||||
|
// Only consider HADOOP_HOME if HADOOP_MAPRED_HOME is not set
|
||||||
|
} else if (in.hasOption(HADOOP_HOME_ARG)) {
|
||||||
|
out.setHadoopMapRedHome(in.getOptionValue(HADOOP_HOME_ARG));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,4 +357,25 @@ public void testPropertySerialization2() {
|
|||||||
connParams, in.getConnectionParams());
|
connParams, in.getConnectionParams());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test that hadoop-home is accepted as an option
|
||||||
|
public void testHadoopHome() throws Exception {
|
||||||
|
String [] args = {
|
||||||
|
"--hadoop-home",
|
||||||
|
"/usr/lib/hadoop",
|
||||||
|
};
|
||||||
|
|
||||||
|
SqoopOptions opts = parse(args);
|
||||||
|
assertEquals("/usr/lib/hadoop", opts.getHadoopMapRedHome());
|
||||||
|
}
|
||||||
|
|
||||||
|
// test that hadoop-home is accepted as an option
|
||||||
|
public void testHadoopMapRedOverridesHadoopHome() throws Exception {
|
||||||
|
String[] args = { "--hadoop-home", "/usr/lib/hadoop-ignored",
|
||||||
|
"--hadoop-mapred-home", "/usr/lib/hadoop", };
|
||||||
|
|
||||||
|
SqoopOptions opts = parse(args);
|
||||||
|
assertEquals("/usr/lib/hadoop", opts.getHadoopMapRedHome());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user