Class BufferingDoFnRunner<InputT,OutputT>
java.lang.Object
org.apache.beam.runners.flink.translation.wrappers.streaming.stableinput.BufferingDoFnRunner<InputT,OutputT>
- All Implemented Interfaces:
org.apache.beam.runners.core.DoFnRunner<InputT,
OutputT>
public class BufferingDoFnRunner<InputT,OutputT>
extends Object
implements org.apache.beam.runners.core.DoFnRunner<InputT,OutputT>
A
DoFnRunner
which buffers data for supporting DoFn.RequiresStableInput
.
When a DoFn is annotated with @RequiresStableInput we are only allowed to process elements after a checkpoint has completed. This ensures that the input is stable and we produce idempotent results on failures.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkpoint
(long checkpointId) Should be called when a checkpoint is created.void
checkpointCompleted
(long checkpointId) Should be called when a checkpoint is completed.static <InputT,
OutputT>
BufferingDoFnRunner<InputT, OutputT> create
(org.apache.beam.runners.core.DoFnRunner<InputT, OutputT> doFnRunner, String stateName, Coder windowedInputCoder, Coder windowCoder, org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend, @Nullable org.apache.flink.runtime.state.KeyedStateBackend<Object> keyedStateBackend, int maxConcurrentCheckpoints, org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions) static <InputT,
OutputT>
BufferingDoFnRunner<InputT, OutputT> create
(org.apache.beam.runners.core.DoFnRunner<InputT, OutputT> doFnRunner, String stateName, Coder windowedInputCoder, Coder windowCoder, org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend, @Nullable org.apache.flink.runtime.state.KeyedStateBackend<Object> keyedStateBackend, int maxConcurrentCheckpoints, org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions, @Nullable Supplier<Locker> locker, @Nullable Function<InputT, Object> keySelector, @Nullable Runnable finishBundleCallback) void
getFn()
long
<KeyT> void
onTimer
(String timerId, String timerFamilyId, KeyT key, BoundedWindow window, Instant timestamp, Instant outputTimestamp, TimeDomain timeDomain) <KeyT> void
onWindowExpiration
(BoundedWindow window, Instant timestamp, KeyT key) void
processElement
(WindowedValue<InputT> elem) void
-
Method Details
-
create
public static <InputT,OutputT> BufferingDoFnRunner<InputT,OutputT> create(org.apache.beam.runners.core.DoFnRunner<InputT, OutputT> doFnRunner, String stateName, Coder windowedInputCoder, Coder windowCoder, org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend, @Nullable org.apache.flink.runtime.state.KeyedStateBackend<Object> keyedStateBackend, int maxConcurrentCheckpoints, org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions) throws Exception- Throws:
Exception
-
create
public static <InputT,OutputT> BufferingDoFnRunner<InputT,OutputT> create(org.apache.beam.runners.core.DoFnRunner<InputT, OutputT> doFnRunner, String stateName, Coder windowedInputCoder, Coder windowCoder, org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend, @Nullable org.apache.flink.runtime.state.KeyedStateBackend<Object> keyedStateBackend, int maxConcurrentCheckpoints, org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions, @Nullable Supplier<Locker> locker, @Nullable Function<InputT, throws ExceptionObject> keySelector, @Nullable Runnable finishBundleCallback) - Throws:
Exception
-
startBundle
public void startBundle() -
processElement
-
onTimer
public <KeyT> void onTimer(String timerId, String timerFamilyId, KeyT key, BoundedWindow window, Instant timestamp, Instant outputTimestamp, TimeDomain timeDomain) -
finishBundle
public void finishBundle() -
onWindowExpiration
-
getFn
-
checkpoint
Should be called when a checkpoint is created.- Throws:
Exception
-
checkpointCompleted
Should be called when a checkpoint is completed.- Throws:
Exception
-
getOutputWatermarkHold
public long getOutputWatermarkHold()
-