Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/7753#discussion_r45928969
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala ---
@@ -228,6 +261,46 @@ private[spark] class EventLoggingListener(
fileSystem.rename(new Path(logPath + IN_PROGRESS), target)
}
+ /**
+ * According to the updated event to modify the maintained event's
metrics
+ * @param executorId the executor whose metrics will be modified
+ */
+ private def updateModifiedMetrics(executorId: String): Unit = {
+ val toBeModifiedEvent = executorIdToModifiedMaxMetrics.get(executorId)
+ val latestEvent = executorIdToLatestMetrics.get(executorId)
+ toBeModifiedEvent match {
+ case None => if (latestEvent.isDefined)
executorIdToModifiedMaxMetrics.update(
+ executorId, latestEvent.get)
--- End diff --
Bringing back a comment from an old diff -- I had mentioned that
`latestEvent` should always be defined, and you responded:
> `latestEvent` should not always be defined when
`toBeModifiedEvent.isEmpty` is true. The case is that at the beginning, the
`latestEvent` is empty before the first metrics update event received.
I don't follow. `updateModifiedMetrics` is only called from one place,
`onExecutorMetricsUpdated`, L240. And just before that, on L239,
`executorIdToLatestMetrics(execId)` is set. so I don't see how it could be
undefined. In fact, you could just change this method to take `latestEvent:
SparkListenerExecutorMetricsUpdate` and then L240 becomes
`updateModifiedMetrics(lightEvent)`, and here you get the executorId from that
event.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]