Class BundleCheckpointHandlers.StateAndTimerBundleCheckpointHandler<T>

java.lang.Object
org.apache.beam.runners.fnexecution.control.BundleCheckpointHandlers.StateAndTimerBundleCheckpointHandler<T>
All Implemented Interfaces:
BundleCheckpointHandler
Enclosing class:
BundleCheckpointHandlers

public static class BundleCheckpointHandlers.StateAndTimerBundleCheckpointHandler<T> extends Object implements BundleCheckpointHandler
A BundleCheckpointHandler which uses TimerInternals.TimerData and MapState to reschedule BeamFnApi.DelayedBundleApplication.
  • Field Details

    • SDF_PREFIX

      public static final String SDF_PREFIX
      See Also:
    • SDF_RESIDUAL_STATE

      public static final String SDF_RESIDUAL_STATE
      The state id under which all SDF self-checkpoint residuals for a key/window are stored.
      See Also:
  • Constructor Details

    • StateAndTimerBundleCheckpointHandler

      public StateAndTimerBundleCheckpointHandler(org.apache.beam.runners.core.TimerInternalsFactory<T> timerInternalsFactory, org.apache.beam.runners.core.StateInternalsFactory<T> stateInternalsFactory, Coder<WindowedValue<T>> residualCoder, Coder windowCoder)
  • Method Details

    • isSdfTimer

      public static boolean isSdfTimer(String timerId)
      A helper function to help check whether the given timer is the timer which is set for rescheduling BeamFnApi.DelayedBundleApplication.
    • residualStateTag

      public static <T> org.apache.beam.runners.core.StateTag<MapState<String,WindowedValue<T>>> residualStateTag(Coder<WindowedValue<T>> residualCoder)
      The single, stable state tag holding every SDF self-checkpoint residual for a key/window, keyed by the per-residual checkpoint id. Storing all residuals under one stable descriptor, instead of a fresh StateTags.value(java.lang.String, org.apache.beam.sdk.coders.Coder<T>) per residual, keeps a polling SDF's keyed state bounded. See https://github.com/apache/beam/issues/27648.
    • onCheckpoint

      public void onCheckpoint(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleResponse response)
      Specified by:
      onCheckpoint in interface BundleCheckpointHandler