JoshRosen commented on code in PR #43250:
URL: https://github.com/apache/spark/pull/43250#discussion_r1355983329
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala:
##########
@@ -490,7 +490,12 @@ private class LiveExecutionData(val executionId: Long)
extends LiveEntity {
var details: String = null
var physicalPlanDescription: String = null
var modifiedConfigs: Map[String, String] = _
- var metrics = collection.Seq[SQLPlanMetric]()
+ private var _metrics = collection.Seq[SQLPlanMetric]()
+ def metrics: collection.Seq[SQLPlanMetric] = _metrics
+ // This mapping is shared across all LiveStageMetrics instances associated
with
+ // this LiveExecutionData, helping to reduce memory overhead by avoiding
waste
+ // from separate immutable maps with largely overlapping sets of entries.
+ val metricAccumulatorIdToMetricType = new ConcurrentHashMap[Long, String]()
Review Comment:
Our Spark fork contains a codepath that performs multi-threaded access to
this data structure, so that's why I used a thread-safe data structure here.
If you would prefer that I avoid leaking those proprietary thread-safety
concerns into OSS Apache Spark then I would be glad to refactor this to use a
`mutable.Map` instead and keep the thread-safe version in our fork.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]