cloud-fan commented on a change in pull request #33063:
URL: https://github.com/apache/spark/pull/33063#discussion_r657972515
##########
File path:
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala
##########
@@ -435,26 +438,24 @@ final class ShuffleBlockFetcherIterator(
collectedRemoteRequests: ArrayBuffer[FetchRequest]): Unit = {
val iterator = blockInfos.iterator
var curRequestSize = 0L
- var curBlocks = Seq.empty[FetchBlockInfo]
+ var curBlocks = new ArrayBuffer[FetchBlockInfo]()
while (iterator.hasNext) {
val (blockId, size, mapIndex) = iterator.next()
assertPositiveBlockSize(blockId, size)
- curBlocks = curBlocks ++ Seq(FetchBlockInfo(blockId, size, mapIndex))
+ curBlocks += FetchBlockInfo(blockId, size, mapIndex)
curRequestSize += size
// For batch fetch, the actual block in flight should count for merged
block.
val mayExceedsMaxBlocks = !doBatchFetch && curBlocks.size >=
maxBlocksInFlightPerAddress
if (curRequestSize >= targetRemoteRequestSize || mayExceedsMaxBlocks) {
curBlocks = createFetchRequests(curBlocks, address, isLast = false,
- collectedRemoteRequests)
+ collectedRemoteRequests).to[ArrayBuffer]
curRequestSize = curBlocks.map(_.size).sum
}
}
// Add in the final request
if (curBlocks.nonEmpty) {
- curBlocks = createFetchRequests(curBlocks, address, isLast = true,
- collectedRemoteRequests)
- curRequestSize = curBlocks.map(_.size).sum
+ createFetchRequests(curBlocks, address, isLast = true,
collectedRemoteRequests)
Review comment:
ah, we are leaving this method and no need to update local variables
here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]