Abacn commented on code in PR #37886:
URL: https://github.com/apache/beam/pull/37886#discussion_r2963355442


##########
runners/samza/src/main/java/org/apache/beam/runners/samza/runtime/SamzaDoFnRunners.java:
##########
@@ -433,6 +498,20 @@ public <KeyT> void onTimer(
         Instant outputTimestamp,
         TimeDomain timeDomain,
         CausedByDrain causedByDrain) {
+      // SDF checkpoint timers are handled by loading the stored residual and 
re-processing it.
+      if 
(BundleCheckpointHandlers.StateAndTimerBundleCheckpointHandler.isSdfTimer(timerId))
 {
+        StateInternals stateInternals = 
nonKeyedStateInternalsFactory.stateInternalsForKey(null);
+        WindowedValue<InT> residual =
+            stateInternals
+                .state(
+                    StateNamespaces.window(windowCoder, window),
+                    StateTags.value(timerId, windowedValueCoder))
+                .read();
+        if (residual != null) {
+          processElement(residual);
+        }

Review Comment:
   ~```suggestion
           org.apache.beam.sdk.state.ValueState<WindowedValue<InT>> 
residualState =
               stateInternals.state(
                   StateNamespaces.window(windowCoder, window),
                   StateTags.value(timerId, windowedValueCoder));
           WindowedValue<InT> residual = residualState.read();
           if (residual != null) {
             residualState.clear();
             processElement(residual);
           }~
   ```
   
   ~Gemini was able to find this and tests looks good~
   
   edit: actually it doesn't help



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

Reply via email to