hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r549260 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/pipes/Submitter.java
Date Wed, 20 Jun 2007 21:54:17 GMT
Author: cutting
Date: Wed Jun 20 14:54:16 2007
New Revision: 549260

URL: http://svn.apache.org/viewvc?view=rev&rev=549260
Log:
HADOOP-1455.  Permit specification of arbitrary job options on pipes command line.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/pipes/Submitter.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=549260&r1=549259&r2=549260
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Jun 20 14:54:16 2007
@@ -220,6 +220,9 @@
  66. HADOOP-1489.  Fix text input truncation bug due to mark/reset.
      Add a unittest. (Bwolen Yang via cutting)
 
+ 67. HADOOP-1455.  Permit specification of arbitrary job options on
+     pipes command line.  (Devaraj Das via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/pipes/Submitter.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/pipes/Submitter.java?view=diff&rev=549260&r1=549259&r2=549260
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/pipes/Submitter.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/pipes/Submitter.java Wed Jun 20
14:54:16 2007
@@ -23,6 +23,7 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.util.StringTokenizer;
 
 import org.apache.commons.cli2.CommandLine;
 import org.apache.commons.cli2.OptionException;
@@ -283,6 +284,10 @@
       // to make it print something reasonable.
       System.out.println("bin/hadoop pipes");
       System.out.println("  [-conf <path>]  // Configuration for job");
+      System.out.println("  [-jobconf <key=value>, <key=value>, ...]" +
+                         "  // add/override configuration for job." +
+                         " (Multiple comma delimited key=value pairs" +
+                         " can be passed)");
       System.out.println("  [-input <path>] // Input directory");
       System.out.println("  [-output <path>] // Output directory");
       System.out.println("  [-jar <jar file> // jar filename");
@@ -328,6 +333,9 @@
     cli.addOption("writer", false, "java classname of OutputFormat", "class");
     cli.addOption("program", false, "URI to application executable", "class");
     cli.addOption("reduces", false, "number of reduces", "num");
+    cli.addOption("jobconf", false, 
+        "\"n1=v1,n2=v2,..\" Optional. Add or override a JobConf property.",
+        "key=val");
     Parser parser = cli.createParser();
     try {
       CommandLine results = parser.parse(args);
@@ -375,6 +383,15 @@
       }
       if (results.hasOption("-program")) {
         setExecutable(conf, (String) results.getValue("-program"));
+      }
+      if (results.hasOption("-jobconf")) {
+        String options = (String)results.getValue("-jobconf");
+        StringTokenizer tokenizer = new StringTokenizer(options, ",");
+        while (tokenizer.hasMoreTokens()) {
+          String keyVal = tokenizer.nextToken().trim();
+          String[] keyValSplit = keyVal.split("=");
+          conf.set(keyValSplit[0], keyValSplit[1]);
+        }
       }
       // if they gave us a jar file, include it into the class path
       String jarFile = conf.getJar();



Mime
View raw message