hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject svn commit: r1433428 - in /hadoop/common/branches/branch-1: CHANGES.txt src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java
Date Tue, 15 Jan 2013 14:13:17 GMT
Author: harsh
Date: Tue Jan 15 14:13:16 2013
New Revision: 1433428

URL: http://svn.apache.org/viewvc?rev=1433428&view=rev
Log:
MAPREDUCE-4930. Backport MAPREDUCE-4678 and MAPREDUCE-4925 to branch-1. Contributed by Karthik
Kambatla and Chris McConnell. (harsh)

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1433428&r1=1433427&r2=1433428&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Tue Jan 15 14:13:16 2013
@@ -428,6 +428,9 @@ Release 1.2.0 - unreleased
     MAPREDUCE-4933. MR1 final merge asks for length of file it just wrote
     before flushing it. (Sandy Ryza via bobby)
 
+    MAPREDUCE-4930. Backport MAPREDUCE-4678 and MAPREDUCE-4925 to branch-1.
+    (Karthik Kambatla and Chris McConnell via harsh)
+
 Release 1.1.2 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1/src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java?rev=1433428&r1=1433427&r2=1433428&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java
(original)
+++ hadoop/common/branches/branch-1/src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java
Tue Jan 15 14:13:16 2013
@@ -162,17 +162,36 @@ public class DistributedPentomino extend
     int height = 10;
     Class<? extends Pentomino> pentClass;
     if (args.length == 0) {
-      System.out.println("pentomino <output>");
+      System.out
+          .println("Usage: pentomino <output> [-depth #] [-height #] [-width #]");
       ToolRunner.printGenericCommandUsage(System.out);
       return -1;
     }
     
     conf = new JobConf(getConf());
+
+    // Pick up the parameters, should the user set these
     width = conf.getInt("pent.width", width);
     height = conf.getInt("pent.height", height);
     depth = conf.getInt("pent.depth", depth);
     pentClass = conf.getClass("pent.class", OneSidedPentomino.class, Pentomino.class);
     
+    for (int i = 0; i < args.length; i++) {
+      if (args[i].equalsIgnoreCase("-depth")) {
+        depth = Integer.parseInt(args[++i].trim());
+      } else if (args[i].equalsIgnoreCase("-height")) {
+        height = Integer.parseInt(args[++i].trim());
+      } else if (args[i].equalsIgnoreCase("-width")) {
+        width = Integer.parseInt(args[++i].trim());
+      }
+    }
+
+    // Set parameters for MR tasks to pick up either which way the user sets
+    // them or not
+    conf.setInt("pent.width", width);
+    conf.setInt("pent.height", height);
+    conf.setInt("pent.depth", depth);
+
     Path output = new Path(args[0]);
     Path input = new Path(output + "_input");
     FileSystem fileSys = FileSystem.get(conf);



Mime
View raw message