You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by hi...@apache.org on 2014/03/26 18:56:30 UTC

git commit: TEZ-976. WordCount example does not handle -D args. (Tassapol Athiapinya via hitesh)

Repository: incubator-tez
Updated Branches:
  refs/heads/master ba97f7f35 -> f31aba7bc


TEZ-976. WordCount example does not handle -D<param> args. (Tassapol Athiapinya via hitesh)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/f31aba7b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/f31aba7b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/f31aba7b

Branch: refs/heads/master
Commit: f31aba7bca4ff85dec69a4ac949c37e24f7eed1e
Parents: ba97f7f
Author: Hitesh Shah <hi...@apache.org>
Authored: Tue Mar 25 15:52:03 2014 -0700
Committer: Hitesh Shah <hi...@apache.org>
Committed: Tue Mar 25 15:52:03 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/tez/mapreduce/examples/WordCount.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/f31aba7b/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/WordCount.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/WordCount.java b/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/WordCount.java
index de4cc6c..b1cede3 100644
--- a/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/WordCount.java
+++ b/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/WordCount.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.mapreduce.security.TokenCache;
 import org.apache.hadoop.mapreduce.split.TezGroupedSplitsInputFormat;
 import org.apache.hadoop.security.Credentials;
 import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.util.GenericOptionsParser;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.LocalResource;
 import org.apache.tez.client.AMConfiguration;
@@ -396,12 +397,15 @@ public class WordCount {
   }
 
   public static void main(String[] args) throws Exception {
-    if ((args.length%2) != 0) {
+    Configuration conf = new Configuration();
+    String [] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
+
+    if (otherArgs.length != 2) {
       printUsage();
       System.exit(2);
     }
     WordCount job = new WordCount();
-    job.run(args[0], args[1], null);
+    job.run(otherArgs[0], otherArgs[1], conf);
   }
 
 }