MAPREDUCE-5821. Avoid unintentional reallocation of byte arrays in segments
during merge. Contributed by Todd Lipcon git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1594654 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
561c014e77
commit
5bf7ef839b
|
@ -273,6 +273,9 @@ Release 2.4.1 - UNRELEASED
|
|||
MAPREDUCE-5835. Killing Task might cause the job to go to ERROR state
|
||||
(Ming Ma via jlowe)
|
||||
|
||||
MAPREDUCE-5821. Avoid unintentional reallocation of byte arrays in segments
|
||||
during merge. (Todd Lipcon via cdouglas)
|
||||
|
||||
Release 2.4.0 - 2014-04-07
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -537,6 +537,8 @@ public class Merger {
|
|||
}
|
||||
}
|
||||
minSegment = top();
|
||||
long startPos = minSegment.getPosition();
|
||||
key = minSegment.getKey();
|
||||
if (!minSegment.inMemory()) {
|
||||
//When we load the value from an inmemory segment, we reset
|
||||
//the "value" DIB in this class to the inmem segment's byte[].
|
||||
|
@ -547,11 +549,11 @@ public class Merger {
|
|||
//segment, we reset the "value" DIB to the byte[] in that (so
|
||||
//we reuse the disk segment DIB whenever we consider
|
||||
//a disk segment).
|
||||
minSegment.getValue(diskIFileValue);
|
||||
value.reset(diskIFileValue.getData(), diskIFileValue.getLength());
|
||||
}
|
||||
long startPos = minSegment.getPosition();
|
||||
key = minSegment.getKey();
|
||||
} else {
|
||||
minSegment.getValue(value);
|
||||
}
|
||||
long endPos = minSegment.getPosition();
|
||||
totalBytesProcessed += endPos - startPos;
|
||||
mergeProgress.set(totalBytesProcessed * progPerByte);
|
||||
|
|
Loading…
Reference in New Issue