MAPREDUCE-6063. Correct spill size calculation for spills wrapping the circular buffer. Contributed by zhihai xu.

This commit is contained in:
Chris Douglas 2014-09-03 14:32:35 -07:00
parent d9a03e272a
commit a18424e724
2 changed files with 4 additions and 3 deletions

View File

@ -267,6 +267,9 @@ Release 2.6.0 - UNRELEASED
MAPREDUCE-5931. Validate SleepJob command line parameters (Gera Shegalov MAPREDUCE-5931. Validate SleepJob command line parameters (Gera Shegalov
via jlowe) via jlowe)
MAPREDUCE-6063. Correct spill size calculation for spills wrapping the
circular buffer. (zhihai xu via cdouglas)
Release 2.5.1 - UNRELEASED Release 2.5.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1575,9 +1575,7 @@ public class MapTask extends Task {
InterruptedException { InterruptedException {
//approximate the length of the output file to be the length of the //approximate the length of the output file to be the length of the
//buffer + header lengths for the partitions //buffer + header lengths for the partitions
final long size = (bufend >= bufstart final long size = distanceTo(bufstart, bufend, bufvoid) +
? bufend - bufstart
: (bufvoid - bufend) + bufstart) +
partitions * APPROX_HEADER_LENGTH; partitions * APPROX_HEADER_LENGTH;
FSDataOutputStream out = null; FSDataOutputStream out = null;
try { try {