Skip to content

Commit 53affd4

Browse files
author
yucai
committed
Simplify length in convertMapStatuses
1 parent e947bcb commit 53affd4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/src/main/scala/org/apache/spark/MapOutputTracker.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,14 +812,13 @@ private[spark] object MapOutputTracker extends Logging {
812812
logError(errorMessage)
813813
throw new MetadataFetchFailedException(shuffleId, startPartition, errorMessage)
814814
} else {
815-
var n = 0
816815
var totalSize = 0L
817816
for (part <- startPartition until endPartition) {
818-
n += 1
819817
totalSize += status.getSizeForBlock(part)
820818
}
821819
splitsByAddress.getOrElseUpdate(status.location, ArrayBuffer()) +=
822-
((ShuffleBlockId(shuffleId, mapId, startPartition, n), totalSize))
820+
((ShuffleBlockId(shuffleId, mapId, startPartition, endPartition - startPartition),
821+
totalSize))
823822
}
824823
}
825824

0 commit comments

Comments
 (0)