edwinalu commented on a change in pull request #23767: [SPARK-26329][CORE][WIP]
Faster polling of executor memory metrics.
URL: https://github.com/apache/spark/pull/23767#discussion_r257384077
##########
File path: core/src/main/scala/org/apache/spark/executor/Executor.scala
##########
@@ -412,6 +478,21 @@ private[spark] class Executor(
env.mapOutputTracker.asInstanceOf[MapOutputTrackerWorker].updateEpoch(task.epoch)
}
+ val stageId = task.stageId
+ val stageAttemptId = task.stageAttemptId
+ val count = new AtomicLong(0)
+ val old = activeStages.putIfAbsent((stageId, stageAttemptId), count)
+ val stageCount =
+ if (old != null) {
+ old.incrementAndGet()
+ } else {
+ logDebug(s"added ($stageId, $stageAttemptId) to activeStages")
+ count.incrementAndGet()
+ }
+ logDebug(s"activeStages: ($stageId, $stageAttemptId) -> $stageCount")
+ stageMetricPeaks.putIfAbsent((stageId, stageAttemptId),
Review comment:
computeIfAbsent?
----------------------------------------------------------------
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]