Github user liyezhang556520 commented on a diff in the pull request:
https://github.com/apache/spark/pull/7753#discussion_r45585344
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala ---
@@ -228,6 +260,40 @@ 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)
+ if (toBeModifiedEvent.isEmpty) {
+ if (latestEvent.isDefined)
executorIdToModifiedMaxMetrics.update(executorId, latestEvent.get)
+ } else {
+ val toBeModifiedMetrics =
toBeModifiedEvent.get.executorMetrics.transportMetrics
+ if (toBeModifiedMetrics.isDefined) {
--- End diff --
`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.
Thank you for you cleaner code style example, I've updated in my code.
---
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]