From adcf7d10b97251b2933b8c717db522bd737e9e75 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Fri, 19 Oct 2012 02:37:59 +0000 Subject: [PATCH] MAPREDUCE-4735. Make arguments in TestDFSIO case insensitive. Contributed by Brandon Li. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1399952 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 9 ++++- .../java/org/apache/hadoop/fs/TestDFSIO.java | 37 ++++++++++--------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 3d4585fb15..7c73fe4801 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -42,7 +42,8 @@ Trunk (Unreleased) MAPREDUCE-3169. Create a new MiniMRCluster equivalent which only provides client APIs cross MR1 and MR2 (Ahmed via tucu) - MAPREDUCE-2944. Improve checking of input for JobClient.displayTasks() (XieXianshan via harsh) + MAPREDUCE-2944. Improve checking of input for JobClient.displayTasks() + (XieXianshan via harsh) MAPREDUCE-3956. Remove the use of the deprecated Syncable.sync() method from TeraOutputFormat in the terasort example. (szetszwo) @@ -61,7 +62,11 @@ Trunk (Unreleased) MAPREDUCE-4371. Check for cyclic dependencies in Jobcontrol job DAG (madhukara phatak via bobby) - MAPREDUCE-4686. hadoop-mapreduce-client-core fails compilation in Eclipse due to missing Avro-generated classes (Chris Nauroth via harsh) + MAPREDUCE-4686. hadoop-mapreduce-client-core fails compilation in Eclipse + due to missing Avro-generated classes (Chris Nauroth via harsh) + + MAPREDUCE-4735. Make arguments in TestDFSIO case insensitive. + (Brandon Li via suresh) BUG FIXES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java index e903c8dc80..2e336e6630 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java @@ -672,37 +672,38 @@ public int run(String[] args) throws IOException { return -1; } - for (int i = 0; i < args.length; i++) { // parse command line - if (args[i].startsWith("-read")) { + for (int i = 0; i < args.length; i++) { // parse command line + if (args[i].toLowerCase().startsWith("-read")) { testType = TestType.TEST_TYPE_READ; - } else if (args[i].equals("-write")) { + } else if (args[i].equalsIgnoreCase("-write")) { testType = TestType.TEST_TYPE_WRITE; - } else if (args[i].equals("-append")) { + } else if (args[i].equalsIgnoreCase("-append")) { testType = TestType.TEST_TYPE_APPEND; - } else if (args[i].equals("-random")) { - if(testType != TestType.TEST_TYPE_READ) return -1; + } else if (args[i].equalsIgnoreCase("-random")) { + if (testType != TestType.TEST_TYPE_READ) return -1; testType = TestType.TEST_TYPE_READ_RANDOM; - } else if (args[i].equals("-backward")) { - if(testType != TestType.TEST_TYPE_READ) return -1; + } else if (args[i].equalsIgnoreCase("-backward")) { + if (testType != TestType.TEST_TYPE_READ) return -1; testType = TestType.TEST_TYPE_READ_BACKWARD; - } else if (args[i].equals("-skip")) { - if(testType != TestType.TEST_TYPE_READ) return -1; + } else if (args[i].equalsIgnoreCase("-skip")) { + if (testType != TestType.TEST_TYPE_READ) return -1; testType = TestType.TEST_TYPE_READ_SKIP; - } else if (args[i].equals("-clean")) { + } else if (args[i].equalsIgnoreCase("-clean")) { testType = TestType.TEST_TYPE_CLEANUP; - } else if (args[i].startsWith("-seq")) { + } else if (args[i].toLowerCase().startsWith("-seq")) { isSequential = true; - } else if (args[i].startsWith("-compression")) { + } else if (args[i].toLowerCase().startsWith("-compression")) { compressionClass = args[++i]; - } else if (args[i].equals("-nrFiles")) { + } else if (args[i].equalsIgnoreCase("-nrfiles")) { nrFiles = Integer.parseInt(args[++i]); - } else if (args[i].equals("-fileSize") || args[i].equals("-size")) { + } else if (args[i].equalsIgnoreCase("-filesize") + || args[i].equalsIgnoreCase("-size")) { nrBytes = parseSize(args[++i]); - } else if (args[i].equals("-skipSize")) { + } else if (args[i].equalsIgnoreCase("-skipsize")) { skipSize = parseSize(args[++i]); - } else if (args[i].equals("-bufferSize")) { + } else if (args[i].equalsIgnoreCase("-buffersize")) { bufferSize = Integer.parseInt(args[++i]); - } else if (args[i].equals("-resFile")) { + } else if (args[i].equalsIgnoreCase("-resfile")) { resFileName = args[++i]; } else { System.err.println("Illegal argument: " + args[i]);