MAPREDUCE-4925. The pentomino option parser may be buggy. Contributed by Karthik Kambatla. (harsh)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1433414 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Harsh J 2013-01-15 13:53:18 +00:00
parent 0b9a1f908a
commit d9a21df34b
2 changed files with 9 additions and 6 deletions

View File

@ -699,6 +699,9 @@ Release 0.23.6 - UNRELEASED
MAPREDUCE-4678. Running the Pentomino example with defaults throws MAPREDUCE-4678. Running the Pentomino example with defaults throws
java.lang.NegativeArraySizeException (Chris McConnell via harsh) java.lang.NegativeArraySizeException (Chris McConnell via harsh)
MAPREDUCE-4925. The pentomino option parser may be buggy.
(Karthik Kambatla via harsh)
Release 0.23.5 - UNRELEASED Release 0.23.5 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -174,16 +174,16 @@ public int run(String[] args) throws Exception {
return 2; return 2;
} }
// check for passed parameters, otherwise use defaults // check for passed parameters, otherwise use defaults
int width = PENT_WIDTH; int width = conf.getInt(Pentomino.WIDTH, PENT_WIDTH);
int height = PENT_HEIGHT; int height = conf.getInt(Pentomino.HEIGHT, PENT_HEIGHT);
int depth = PENT_DEPTH; int depth = conf.getInt(Pentomino.DEPTH, PENT_DEPTH);
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
if (args[i].equalsIgnoreCase("-depth")) { if (args[i].equalsIgnoreCase("-depth")) {
depth = Integer.parseInt(args[i++].trim()); depth = Integer.parseInt(args[++i].trim());
} else if (args[i].equalsIgnoreCase("-height")) { } else if (args[i].equalsIgnoreCase("-height")) {
height = Integer.parseInt(args[i++].trim()); height = Integer.parseInt(args[++i].trim());
} else if (args[i].equalsIgnoreCase("-width") ) { } else if (args[i].equalsIgnoreCase("-width") ) {
width = Integer.parseInt(args[i++].trim()); width = Integer.parseInt(args[++i].trim());
} }
} }
// now set the values within conf for M/R tasks to read, this // now set the values within conf for M/R tasks to read, this