hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r808415 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/util/GenericOptionsParser.java src/test/core/org/apache/hadoop/util/TestGenericsUtil.java
Date Thu, 27 Aug 2009 13:55:19 GMT
Author: sharad
Date: Thu Aug 27 13:55:19 2009
New Revision: 808415

URL: http://svn.apache.org/viewvc?rev=808415&view=rev
Log:
HADOOP-6215. fix GenericOptionParser to deal with -D with '=' in the value. Contributed by
Amar Kamat.

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/util/GenericOptionsParser.java
    hadoop/common/trunk/src/test/core/org/apache/hadoop/util/TestGenericsUtil.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=808415&r1=808414&r2=808415&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Thu Aug 27 13:55:19 2009
@@ -944,6 +944,9 @@
     HADOOP-6152. Fix classpath variables in bin/hadoop-config.sh and some
     other scripts.  (Aaron Kimball via szetszwo)
 
+    HADOOP-6215. fix GenericOptionParser to deal with -D with '=' in the 
+    value. (Amar Kamat via sharad)
+
 Release 0.20.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/util/GenericOptionsParser.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/util/GenericOptionsParser.java?rev=808415&r1=808414&r2=808415&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/util/GenericOptionsParser.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/util/GenericOptionsParser.java Thu Aug
27 13:55:19 2009
@@ -281,7 +281,7 @@
     if (line.hasOption('D')) {
       String[] property = line.getOptionValues('D');
       for(String prop : property) {
-        String[] keyval = prop.split("=");
+        String[] keyval = prop.split("=", 2);
         if (keyval.length == 2) {
           conf.set(keyval[0], keyval[1]);
         }

Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/util/TestGenericsUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/util/TestGenericsUtil.java?rev=808415&r1=808414&r2=808415&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/util/TestGenericsUtil.java (original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/util/TestGenericsUtil.java Thu Aug
27 13:55:19 2009
@@ -103,6 +103,12 @@
      GenericOptionsParser parser = new GenericOptionsParser(
         new Configuration(), new String[] {"-jt"});
     assertEquals(parser.getRemainingArgs().length, 0);
+    
+    //  test if -D accepts -Dx=y=z
+    parser = 
+      new GenericOptionsParser(new Configuration(), 
+                               new String[] {"-Dx=y=z"});
+    assertEquals(parser.getConfiguration().get("x"), "y=z");
   }
   
   public void testGetClass() {



Mime
View raw message