turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1835165381
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -210,10 +211,18 @@ class LifecycleManager(val appUniqueId: String, val conf:
CelebornConf) extends
appUniqueId,
conf,
masterClient,
- () => commitManager.commitMetrics() ->
shuffleFallbackCount.sumThenReset(),
+ () => {
+ commitManager.commitMetrics() ->
+ (shuffleCount.sumThenReset(), resetShuffleFallbackCounts())
+ },
workerStatusTracker,
registeredShuffle,
reason => cancelAllActiveStages(reason))
+ private def resetShuffleFallbackCounts(): Map[String, java.lang.Long] = {
+ val fallbackCounts = shuffleFallbackCounts.asScala.filter(_._2 > 0L).toMap
+ shuffleFallbackCounts.replaceAll((_, _) => 0L)
+ fallbackCounts
Review Comment:
```
val fallbackCounts = new util.HashMap[String, java.lang.Long]()
shuffleFallbackCounts.keys().asScala.foreach { key =>
Option(shuffleFallbackCounts.remove(key)).filter(_ >
0).foreach(fallbackCounts.put(key, _))
}
fallbackCounts.asScala.toMap
```
--
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]