mrunit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbe...@apache.org
Subject svn commit: r1373314 - in /mrunit/trunk/src/main/java/org/apache/hadoop/mrunit: MapReduceDriver.java MapReduceDriverBase.java mapreduce/MapReduceDriver.java
Date Wed, 15 Aug 2012 10:23:56 GMT
Author: dbeech
Date: Wed Aug 15 10:23:55 2012
New Revision: 1373314

URL: http://svn.apache.org/viewvc?rev=1373314&view=rev
Log:
MRUNIT-142: withKeyGroupingComparator/withKeyOrderComparator should be in MapReduceDriverBase
(contrib. Bertrand Dechoux)

Modified:
    mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java
    mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriverBase.java
    mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java

Modified: mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java
URL: http://svn.apache.org/viewvc/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java?rev=1373314&r1=1373313&r2=1373314&view=diff
==============================================================================
--- mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java (original)
+++ mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java Wed Aug 15 10:23:55
2012
@@ -25,7 +25,6 @@ import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.io.RawComparator;
 import org.apache.hadoop.mapred.Counters;
 import org.apache.hadoop.mapred.InputFormat;
 import org.apache.hadoop.mapred.Mapper;
@@ -274,34 +273,6 @@ public class MapReduceDriver<K1, V1, K2,
   }
 
   /**
-   * Identical to {@link #setKeyGroupingComparator(RawComparator)}, but with a
-   * fluent programming style
-   * 
-   * @param groupingComparator
-   *          Comparator to use in the shuffle stage for key grouping
-   * @return this
-   */
-  public MapReduceDriver<K1, V1, K2, V2, K3, V3> withKeyGroupingComparator(
-      final RawComparator<K2> groupingComparator) {
-    setKeyGroupingComparator(groupingComparator);
-    return this;
-  }
-
-  /**
-   * Identical to {@link #setKeyOrderComparator(RawComparator)}, but with a
-   * fluent programming style
-   * 
-   * @param orderComparator
-   *          Comparator to use in the shuffle stage for key value ordering
-   * @return this
-   */
-  public MapReduceDriver<K1, V1, K2, V2, K3, V3> withKeyOrderComparator(
-      final RawComparator<K2> orderComparator) {
-    setKeyOrderComparator(orderComparator);
-    return this;
-  }
-
-  /**
    * Returns a new MapReduceDriver without having to specify the generic types
    * on the right hand side of the object create statement.
    * 

Modified: mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriverBase.java
URL: http://svn.apache.org/viewvc/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriverBase.java?rev=1373314&r1=1373313&r2=1373314&view=diff
==============================================================================
--- mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriverBase.java (original)
+++ mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriverBase.java Wed Aug 15
10:23:55 2012
@@ -317,4 +317,30 @@ public abstract class MapReduceDriverBas
         orderComparator.getClass(), getConfiguration());
   }
 
+  /**
+   * Identical to {@link #setKeyGroupingComparator(RawComparator)}, but with a
+   * fluent programming style
+   * 
+   * @param groupingComparator
+   *          Comparator to use in the shuffle stage for key grouping
+   * @return this
+   */
+  public T withKeyGroupingComparator(final RawComparator<K2> groupingComparator) {
+    setKeyGroupingComparator(groupingComparator);
+    return thisAsMapReduceDriver();
+  }
+
+  /**
+   * Identical to {@link #setKeyOrderComparator(RawComparator)}, but with a
+   * fluent programming style
+   * 
+   * @param orderComparator
+   *          Comparator to use in the shuffle stage for key value ordering
+   * @return this
+   */
+  public T withKeyOrderComparator(final RawComparator<K2> orderComparator) {
+    setKeyOrderComparator(orderComparator);
+    return thisAsMapReduceDriver();
+  }
+
 }

Modified: mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java
URL: http://svn.apache.org/viewvc/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java?rev=1373314&r1=1373313&r2=1373314&view=diff
==============================================================================
--- mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java (original)
+++ mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java Wed
Aug 15 10:23:55 2012
@@ -25,7 +25,6 @@ import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.io.RawComparator;
 import org.apache.hadoop.mapreduce.Counters;
 import org.apache.hadoop.mapreduce.InputFormat;
 import org.apache.hadoop.mapreduce.Mapper;
@@ -268,34 +267,6 @@ public class MapReduceDriver<K1, V1, K2,
   }
 
   /**
-   * Identical to {@link #setKeyGroupingComparator(RawComparator)}, but with a
-   * fluent programming style
-   * 
-   * @param groupingComparator
-   *          Comparator to use in the shuffle stage for key grouping
-   * @return this
-   */
-  public MapReduceDriver<K1, V1, K2, V2, K3, V3> withKeyGroupingComparator(
-      final RawComparator<K2> groupingComparator) {
-    setKeyGroupingComparator(groupingComparator);
-    return this;
-  }
-
-  /**
-   * Identical to {@link #setKeyOrderComparator(RawComparator)}, but with a
-   * fluent programming style
-   * 
-   * @param orderComparator
-   *          Comparator to use in the shuffle stage for key value ordering
-   * @return this
-   */
-  public MapReduceDriver<K1, V1, K2, V2, K3, V3> withKeyOrderComparator(
-      final RawComparator<K2> orderComparator) {
-    setKeyOrderComparator(orderComparator);
-    return this;
-  }
-
-  /**
    * Returns a new MapReduceDriver without having to specify the generic types
    * on the right hand side of the object create statement.
    * 



Mime
View raw message