y1chi commented on a change in pull request #13702:
URL: https://github.com/apache/beam/pull/13702#discussion_r555270486



##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/ExecutionStateTracker.java
##########
@@ -44,6 +44,9 @@
   private static final Map<Thread, ExecutionStateTracker> CURRENT_TRACKERS =
       new ConcurrentHashMap<>();
 
+  private static final Map<Long, ExecutionStateTracker> 
CURRENT_TRACKERS_FOR_THREAD_ID =

Review comment:
       The main reason is that CURRENT_TRACKERS map is keyed by Thread 
reference and in a log entry we only record the thread id, which means we need 
to enumerate through CURRENT_TRACKER entry set or the current thread group when 
we want to find the ExecutionStateTracker with the thread id, which seems more 
costly then just hold another map for thread id -> ExecutionStateTracker.




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