hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r1198914 - in /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project: CHANGES.txt hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Reducer.java
Date Mon, 07 Nov 2011 20:16:12 GMT
Author: tomwhite
Date: Mon Nov  7 20:16:12 2011
New Revision: 1198914

URL: http://svn.apache.org/viewvc?rev=1198914&view=rev
Log:
Merge -r 1198909:1198910 from trunk to branch-0.23. Fixes: MAPREDUCE-3344.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Reducer.java

Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt?rev=1198914&r1=1198913&r2=1198914&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt Mon Nov  7 20:16:12
2011
@@ -31,6 +31,9 @@ Release 0.23.1 - Unreleased
     MAPREDUCE-3291. App fail to launch due to delegation token not 
     found in cache (Robert Evans via mahadev)
 
+    MAPREDUCE-3344. o.a.h.mapreduce.Reducer since 0.21 blindly casts to
+    ReduceContext.ValueIterator. (Brock Noland via tomwhite)
+
 Release 0.23.0 - 2011-11-01 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Reducer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Reducer.java?rev=1198914&r1=1198913&r2=1198914&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Reducer.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Reducer.java
Mon Nov  7 20:16:12 2011
@@ -26,6 +26,8 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.io.RawComparator;
 import org.apache.hadoop.mapred.RawKeyValueIterator;
 
+import java.util.Iterator;
+
 /** 
  * Reduces a set of intermediate values which share a key to a smaller set of
  * values.  
@@ -162,14 +164,15 @@ public class Reducer<KEYIN,VALUEIN,KEYOU
    * {@link #run(org.apache.hadoop.mapreduce.Reducer.Context)} method to
    * control how the reduce task works.
    */
-  @SuppressWarnings("unchecked")
   public void run(Context context) throws IOException, InterruptedException {
     setup(context);
     while (context.nextKey()) {
       reduce(context.getCurrentKey(), context.getValues(), context);
       // If a back up store is used, reset it
-      ((ReduceContext.ValueIterator)
-          (context.getValues().iterator())).resetBackupStore();
+      Iterator<VALUEIN> iter = context.getValues().iterator();
+      if(iter instanceof ReduceContext.ValueIterator) {
+        ((ReduceContext.ValueIterator<VALUEIN>)iter).resetBackupStore();        
+      }
     }
     cleanup(context);
   }



Mime
View raw message