Skip to content

Commit e76460d

Browse files
committed
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.17@669325 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1c5e333 commit e76460d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Release 0.17.1
2323
HADOOP-3550. Fix the serialization data structures in MapTask where the
2424
value lengths are incorrectly calculated. (cdouglas)
2525

26+
HADOOP-3526. Fix contrib/data_join framework by cloning values retained
27+
in the reduce. (Spyros Blanas via cdouglas)
28+
2629
Release 0.17.1 - Unreleased
2730

2831
INCOMPATIBLE CHANGES

src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/DataJoinReducerBase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.TreeMap;
2525

2626
import org.apache.hadoop.io.Text;
27+
import org.apache.hadoop.io.WritableUtils;
2728
import org.apache.hadoop.mapred.JobConf;
2829
import org.apache.hadoop.mapred.OutputCollector;
2930
import org.apache.hadoop.mapred.Reporter;
@@ -103,13 +104,13 @@ private SortedMap<Object, ResetableIterator> regroup(Object key,
103104
if (this.numOfValues > this.maxNumOfValuesPerGroup) {
104105
continue;
105106
}
106-
Object tag = aRecord.getTag();
107+
Text tag = new Text((Text)aRecord.getTag());
107108
ResetableIterator data = retv.get(tag);
108109
if (data == null) {
109110
data = createResetableIterator();
110111
retv.put(tag, data);
111112
}
112-
data.add(aRecord);
113+
data.add(WritableUtils.clone(aRecord, job));
113114
}
114115
if (this.numOfValues > this.largestNumOfValues) {
115116
this.largestNumOfValues = numOfValues;

0 commit comments

Comments
 (0)