Return-Path: Delivered-To: apmail-lucene-hadoop-commits-archive@locus.apache.org Received: (qmail 41276 invoked from network); 20 Jun 2007 21:54:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jun 2007 21:54:39 -0000 Received: (qmail 26590 invoked by uid 500); 20 Jun 2007 21:54:42 -0000 Delivered-To: apmail-lucene-hadoop-commits-archive@lucene.apache.org Received: (qmail 26569 invoked by uid 500); 20 Jun 2007 21:54:42 -0000 Mailing-List: contact hadoop-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-commits@lucene.apache.org Received: (qmail 26560 invoked by uid 99); 20 Jun 2007 21:54:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2007 14:54:42 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2007 14:54:38 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id CB8361A981A; Wed, 20 Jun 2007 14:54:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: hadoop-commits@lucene.apache.org From: cutting@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070620215417.CB8361A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 ] // Configuration for job"); + System.out.println(" [-jobconf , , ...]" + + " // add/override configuration for job." + + " (Multiple comma delimited key=value pairs" + + " can be passed)"); System.out.println(" [-input ] // Input directory"); System.out.println(" [-output ] // Output directory"); System.out.println(" [-jar // 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();