vanzin commented on a change in pull request #23649: [SPARK-26726] The amount
of memory used by the broadcast variable is …
URL: https://github.com/apache/spark/pull/23649#discussion_r251993736
##########
File path: core/src/main/scala/org/apache/spark/status/AppStatusListener.scala
##########
@@ -995,6 +978,44 @@ private[spark] class AppStatusListener(
}
}
+ private def updateBroadcastBlock(
+ event: SparkListenerBlockUpdated,
+ broadcast: BroadcastBlockId): Unit = {
+ val now = System.nanoTime()
+ val executorId = event.blockUpdatedInfo.blockManagerId.executorId
+ val storageLevel = event.blockUpdatedInfo.storageLevel
+
+ // Whether values are being added to or removed from the existing
accounting.
+ val diskDelta = event.blockUpdatedInfo.diskSize * (if
(storageLevel.useDisk) 1 else -1)
+ val memoryDelta = event.blockUpdatedInfo.memSize * (if
(storageLevel.useMemory) 1 else -1)
+
+ val maybeExec = liveExecutors.get(executorId)
+ updateExecutorMemoryDiskInfo(maybeExec, storageLevel, memoryDelta,
diskDelta, None, None)
+ maybeExec.foreach(exec => maybeUpdate(exec, now))
+
+ }
+
+ // update executor memory and disk usage info
+ private def updateExecutorMemoryDiskInfo(
+ maybeExec: Option[LiveExecutor],
+ storageLevel: StorageLevel,
+ memoryDelta: Long,
+ diskDelta: Long,
+ OffHeapDelta: Option[Long],
Review comment:
Variable names start with lower case.
I'd also avoid the `Option` here. That causes extra allocations + boxing
which this code should avoid.
In the broadcast update you could just repeat `memoryDelta` as the
parameter, since that's what this boils down to...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]