nwangtw commented on a change in pull request #3107: Change concurrent Map
URL: https://github.com/apache/incubator-heron/pull/3107#discussion_r232410097
 
 

 ##########
 File path: heron/api/src/java/org/apache/heron/api/metric/MultiCountMetric.java
 ##########
 @@ -38,7 +38,7 @@ public CountMetric scope(String key) {
 
   @Override
   public Map<String, Long> getValueAndReset() {
-    Map<String, Long> ret = new HashMap<>();
+    Map<String, Long> ret = new ConcurrentHashMap<>();
 
 Review comment:
   ConcurrentHashMap might not be necessary in getValueAndReset(). This 
function is called every X seconds to sample the current metrics and export by 
Heron instance, so it is not called from multiple threads.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to