Skip to content

Commit

Permalink
More minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed May 7, 2015
1 parent e67f1ea commit 5e8cf75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.LinkedList;

import org.apache.spark.storage.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ private long[] mergeSpills(SpillInfo[] spills) throws IOException {
for (int partition = 0; partition < numPartitions; partition++) {
for (int i = 0; i < spills.length; i++) {
final long partitionLengthInSpill = spills[i].partitionLengths[partition];
long bytesRemainingToBeTransferred = partitionLengthInSpill;
long bytesToTransfer = partitionLengthInSpill;
final FileChannel spillInputChannel = spillInputChannels[i];
while (bytesRemainingToBeTransferred > 0) {
while (bytesToTransfer > 0) {
final long actualBytesTransferred = spillInputChannel.transferTo(
spillInputChannelPositions[i],
bytesRemainingToBeTransferred,
bytesToTransfer,
mergedFileOutputChannel);
spillInputChannelPositions[i] += actualBytesTransferred;
bytesRemainingToBeTransferred -= actualBytesTransferred;
bytesToTransfer -= actualBytesTransferred;
}
partitionLengths[partition] += partitionLengthInSpill;
}
Expand Down

0 comments on commit 5e8cf75

Please sign in to comment.