You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "arunpandianp (via GitHub)" <gi...@apache.org> on 2026/04/10 18:08:10 UTC

Re: [PR] [WIP] Use trigger state to know if a window is new [beam]

arunpandianp commented on code in PR #37574:
URL: https://github.com/apache/beam/pull/37574#discussion_r3065981608


##########
runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachineRunner.java:
##########
@@ -187,12 +199,9 @@ private void persistFinishedSet(
     }
 
     ValueState<BitSet> finishedSetState = state.access(FINISHED_BITS_TAG);
-    if (!readFinishedBits(finishedSetState).equals(modifiedFinishedSet)) {
-      if (modifiedFinishedSet.getBitSet().isEmpty()) {
-        finishedSetState.clear();
-      } else {
-        finishedSetState.write(modifiedFinishedSet.getBitSet());
-      }
+    @Nullable BitSet currentBits = finishedSetState.read();
+    if (currentBits == null || !currentBits.equals(modifiedFinishedSet.getBitSet())) {
+      finishedSetState.write(modifiedFinishedSet.getBitSet());

Review Comment:
   Need to make sure this doesn't cause unbounded state growth with global windows



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org