HADOOP-11509. Change parsing sequence in GenericOptionsParser to parse
-D parameters before -files. Contributed by Xuan Gong
(cherry picked from commit 0bf333911c
)
This commit is contained in:
parent
0ada35c912
commit
f93fa39384
|
@ -409,6 +409,9 @@ Release 2.7.0 - UNRELEASED
|
|||
|
||||
HADOOP-6221 RPC Client operations cannot be interrupted. (stevel)
|
||||
|
||||
HADOOP-11509. Change parsing sequence in GenericOptionsParser to parse -D
|
||||
parameters before -files. (xgong)
|
||||
|
||||
Release 2.6.1 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -284,6 +284,17 @@ public class GenericOptionsParser {
|
|||
conf.addResource(new Path(value));
|
||||
}
|
||||
}
|
||||
|
||||
if (line.hasOption('D')) {
|
||||
String[] property = line.getOptionValues('D');
|
||||
for(String prop : property) {
|
||||
String[] keyval = prop.split("=", 2);
|
||||
if (keyval.length == 2) {
|
||||
conf.set(keyval[0], keyval[1], "from command line");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (line.hasOption("libjars")) {
|
||||
conf.set("tmpjars",
|
||||
validateFiles(line.getOptionValue("libjars"), conf),
|
||||
|
@ -307,15 +318,6 @@ public class GenericOptionsParser {
|
|||
validateFiles(line.getOptionValue("archives"), conf),
|
||||
"from -archives command line option");
|
||||
}
|
||||
if (line.hasOption('D')) {
|
||||
String[] property = line.getOptionValues('D');
|
||||
for(String prop : property) {
|
||||
String[] keyval = prop.split("=", 2);
|
||||
if (keyval.length == 2) {
|
||||
conf.set(keyval[0], keyval[1], "from command line");
|
||||
}
|
||||
}
|
||||
}
|
||||
conf.setBoolean("mapreduce.client.genericoptionsparser.used", true);
|
||||
|
||||
// tokensFile
|
||||
|
|
Loading…
Reference in New Issue