MAPREDUCE-6923. Optimize MapReduce Shuffle I/O for small partitions. Contributed by Robert Schmidtke.
This commit is contained in:
parent
b5c02f95b5
commit
ac7d0604bc
@ -111,7 +111,10 @@ long customShuffleTransfer(WritableByteChannel target, long position)
|
||||
|
||||
long trans = actualCount;
|
||||
int readSize;
|
||||
ByteBuffer byteBuffer = ByteBuffer.allocate(this.shuffleBufferSize);
|
||||
ByteBuffer byteBuffer = ByteBuffer.allocate(
|
||||
Math.min(
|
||||
this.shuffleBufferSize,
|
||||
trans > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) trans));
|
||||
|
||||
while(trans > 0L &&
|
||||
(readSize = fileChannel.read(byteBuffer, this.position+position)) > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user