otterc commented on code in PR #36165:
URL: https://github.com/apache/spark/pull/36165#discussion_r1043766268
##########
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:
##########
@@ -726,6 +736,61 @@ final class ShuffleBlockFetcherIterator(
}
}
+ // Number of map blocks in a ShuffleBlockChunk
+ private def getShuffleChunkCardinality(blockId: ShuffleBlockChunkId): Int = {
+
pushBasedFetchHelper.getRoaringBitMap(blockId).map(_.getCardinality).getOrElse(0)
+ }
+
+ // Check if the merged block is local to the host or not
+ private def isLocalMergedBlockAddress(address: BlockManagerId): Boolean = {
+ address.executorId.isEmpty && address.host ==
blockManager.blockManagerId.host
Review Comment:
Is the executorId empty? or it is a special string? Need to check.
##########
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:
##########
@@ -726,6 +736,61 @@ final class ShuffleBlockFetcherIterator(
}
}
+ // Number of map blocks in a ShuffleBlockChunk
+ private def getShuffleChunkCardinality(blockId: ShuffleBlockChunkId): Int = {
+
pushBasedFetchHelper.getRoaringBitMap(blockId).map(_.getCardinality).getOrElse(0)
+ }
+
+ // Check if the merged block is local to the host or not
+ private def isLocalMergedBlockAddress(address: BlockManagerId): Boolean = {
+ address.executorId.isEmpty && address.host ==
blockManager.blockManagerId.host
+ }
+
+ private def shuffleMetricsUpdate(
+ blockId: BlockId,
+ buf: ManagedBuffer,
+ local: Boolean): Unit = {
+ if (local) {
+ shuffleLocalMetricsUpdate(blockId, buf)
+ } else {
+ shuffleRemoteMetricsUpdate(blockId, buf)
+ }
+ }
+
+ private def shuffleLocalMetricsUpdate(blockId: BlockId, buf: ManagedBuffer):
Unit = {
+ // Check if the block is within the host-local blocks set, or if it is a
merged local
Review Comment:
Where is this check? Do we need to rephrase this comment?
##########
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:
##########
@@ -343,6 +352,7 @@ final class ShuffleBlockFetcherIterator(
val block = BlockId(blockId)
if (block.isShuffleChunk) {
remainingBlocks -= blockId
+ updateMergedReqsDuration(wasReqForMergedChunks = true)
Review Comment:
Note to self: We are updating these metrics from the netty thread and not
the task thread unlike other metrics. We do synchronize on the instance of the
iterator. Shouldn't be a problem.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]