hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r808414 - in /hadoop/common/branches/branch-0.20: CHANGES.txt src/core/org/apache/hadoop/util/GenericOptionsParser.java src/test/org/apache/hadoop/util/TestGenericsUtil.java
Date Thu, 27 Aug 2009 13:49:16 GMT
Author: sharad
Date: Thu Aug 27 13:49:16 2009
New Revision: 808414

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

Modified:
    hadoop/common/branches/branch-0.20/CHANGES.txt
    hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
    hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/util/TestGenericsUtil.java

Modified: hadoop/common/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/CHANGES.txt?rev=808414&r1=808413&r2=808414&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20/CHANGES.txt Thu Aug 27 13:49:16 2009
@@ -241,6 +241,9 @@
     MAPREDUCE-430. Fix a bug related to task getting stuck in case of 
     OOM error. (Amar Kamat via ddas)
 
+    HADOOP-6215. fix GenericOptionParser to deal with -D with '=' in the 
+    value. (Amar Kamat via sharad)
+
 Release 0.20.0 - 2009-04-15
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java?rev=808414&r1=808413&r2=808414&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
(original)
+++ hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
Thu Aug 27 13:49:16 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/branches/branch-0.20/src/test/org/apache/hadoop/util/TestGenericsUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/util/TestGenericsUtil.java?rev=808414&r1=808413&r2=808414&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/util/TestGenericsUtil.java
(original)
+++ hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/util/TestGenericsUtil.java
Thu Aug 27 13:49:16 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