m-trieu commented on code in PR #31504:
URL: https://github.com/apache/beam/pull/31504#discussion_r1634148623
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/ActiveWorkState.java:
##########
@@ -331,6 +333,22 @@ synchronized ImmutableList<HeartbeatRequest>
getKeyHeartbeats(
.collect(toImmutableList());
}
+ synchronized ImmutableListMultimap<ShardedKey, Work> getReadOnlyActiveWork()
{
+ // Do not return a reference to the underlying workQueue as iterations
over it will cause a
+ // ConcurrentModificationException as it is not a thread-safe data
structure.
+ ImmutableListMultimap.Builder<ShardedKey, Work> readOnlyActiveWork =
+ ImmutableListMultimap.builder();
+ for (Entry<ShardedKey, Deque<ExecutableWork>> keyedWorkQueues :
activeWork.entrySet()) {
Review Comment:
done
nice
--
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]