public class SDFFeederViaStateAndTimers<InputT,RestrictionT>
extends java.lang.Object
PTransformTranslation.SPLITTABLE_PROCESS_ELEMENTS_URN
transform, implementing checkpointing
only, by using state and timers for storing the last element/restriction pair, similarly to
SplittableParDoViaKeyedWorkItems.ProcessFn
but in a portable
fashion.Constructor and Description |
---|
SDFFeederViaStateAndTimers(org.apache.beam.runners.core.StateInternals stateInternals,
org.apache.beam.runners.core.TimerInternals timerInternals,
Coder<InputT> elementWireCoder,
Coder<RestrictionT> restrictionWireCoder,
Coder<BoundedWindow> windowCoder)
Initializes the feeder.
|
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commits the state and timers: clears both if no checkpoint happened, or adjusts the restriction
and sets a wake-up timer if a checkpoint happened.
|
org.apache.beam.sdk.util.WindowedValue<KV<InputT,RestrictionT>> |
resume(org.apache.beam.runners.core.TimerInternals.TimerData timer)
Resumes from a timer and returns the current element/restriction pair (with an up-to-date value
of the restriction).
|
void |
seed(org.apache.beam.sdk.util.WindowedValue<KV<InputT,RestrictionT>> elementRestriction)
Passes the initial element/restriction pair.
|
void |
split(java.util.List<org.apache.beam.model.fnexecution.v1.BeamFnApi.BundleApplication> primaryRoots,
java.util.List<org.apache.beam.model.fnexecution.v1.BeamFnApi.DelayedBundleApplication> residualRoots)
Signals that a split happened.
|
public SDFFeederViaStateAndTimers(org.apache.beam.runners.core.StateInternals stateInternals, org.apache.beam.runners.core.TimerInternals timerInternals, Coder<InputT> elementWireCoder, Coder<RestrictionT> restrictionWireCoder, Coder<BoundedWindow> windowCoder)
public void seed(org.apache.beam.sdk.util.WindowedValue<KV<InputT,RestrictionT>> elementRestriction)
public org.apache.beam.sdk.util.WindowedValue<KV<InputT,RestrictionT>> resume(org.apache.beam.runners.core.TimerInternals.TimerData timer)
public void commit() throws java.io.IOException
java.io.IOException
public void split(java.util.List<org.apache.beam.model.fnexecution.v1.BeamFnApi.BundleApplication> primaryRoots, java.util.List<org.apache.beam.model.fnexecution.v1.BeamFnApi.DelayedBundleApplication> residualRoots)