Browse Source

HADOOP-3526. Fix contrib/data_join framework by cloning values retained in the
reduce. Contributed by Spyros Blanas.



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.18@669326 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 17 years ago
parent
commit
84d0d9236d

+ 3 - 0
CHANGES.txt

@@ -617,6 +617,9 @@ Release 0.18.0 - Unreleased
     HADOOP-3550. Fix the serialization data structures in MapTask where the
     value lengths are incorrectly calculated. (cdouglas)
 
+    HADOOP-3526. Fix contrib/data_join framework by cloning values retained
+    in the reduce. (Spyros Blanas via cdouglas)
+
 Release 0.17.1 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 3 - 2
src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/DataJoinReducerBase.java

@@ -24,6 +24,7 @@ import java.util.SortedMap;
 import java.util.TreeMap;
 
 import org.apache.hadoop.io.Text;
+import org.apache.hadoop.io.WritableUtils;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.Reporter;
@@ -103,13 +104,13 @@ public abstract class DataJoinReducerBase extends JobBase {
       if (this.numOfValues > this.maxNumOfValuesPerGroup) {
         continue;
       }
-      Object tag = aRecord.getTag();
+      Text tag = new Text((Text)aRecord.getTag());
       ResetableIterator data = retv.get(tag);
       if (data == null) {
         data = createResetableIterator();
         retv.put(tag, data);
       }
-      data.add(aRecord);
+      data.add(WritableUtils.clone(aRecord, job));
     }
     if (this.numOfValues > this.largestNumOfValues) {
       this.largestNumOfValues = numOfValues;