hit-lacus commented on a change in pull request #1538:
URL: https://github.com/apache/kylin/pull/1538#discussion_r551940804



##########
File path: 
core-metrics/src/main/java/org/apache/kylin/metrics/QuerySparkMetrics.java
##########
@@ -0,0 +1,331 @@
+package org.apache.kylin.metrics;
+
+import org.apache.kylin.shaded.com.google.common.collect.Maps;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
+import java.util.stream.Collectors;
+
+public class QuerySparkMetrics {
+    private static Map<String, List<SparkJobMetrics>> sparkJobMetricsMap = 
Maps.newConcurrentMap();
+    private static List<SparkStageMetrics> sparkStageMetricsList = new 
ArrayList<>();

Review comment:
       Use a static collection is not a good practice . Maybe using a 
`BlockingQueue` is better, like [Producer-Consumer 
pattern](https://dzone.com/articles/producer-consumer-pattern) , or send 
directly to `AbstractActiveReservoir` is also good to me.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to