public class BufferingDoFnRunner<InputT,OutputT>
extends java.lang.Object
implements org.apache.beam.runners.core.DoFnRunner<InputT,OutputT>
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.
| Modifier and Type | Method and Description |
|---|---|
void |
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> |
create(org.apache.beam.runners.core.DoFnRunner<InputT,OutputT> doFnRunner,
java.lang.String stateName,
org.apache.beam.sdk.coders.Coder windowedInputCoder,
org.apache.beam.sdk.coders.Coder windowCoder,
org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend,
@Nullable org.apache.flink.runtime.state.KeyedStateBackend<java.lang.Object> keyedStateBackend,
int maxConcurrentCheckpoints,
org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions) |
void |
finishBundle() |
org.apache.beam.sdk.transforms.DoFn<InputT,OutputT> |
getFn() |
<KeyT> void |
onTimer(java.lang.String timerId,
java.lang.String timerFamilyId,
KeyT key,
org.apache.beam.sdk.transforms.windowing.BoundedWindow window,
org.joda.time.Instant timestamp,
org.joda.time.Instant outputTimestamp,
org.apache.beam.sdk.state.TimeDomain timeDomain) |
<KeyT> void |
onWindowExpiration(org.apache.beam.sdk.transforms.windowing.BoundedWindow window,
org.joda.time.Instant timestamp,
KeyT key) |
void |
processElement(org.apache.beam.sdk.util.WindowedValue<InputT> elem) |
void |
startBundle() |
public static <InputT,OutputT> BufferingDoFnRunner<InputT,OutputT> create(org.apache.beam.runners.core.DoFnRunner<InputT,OutputT> doFnRunner, java.lang.String stateName, org.apache.beam.sdk.coders.Coder windowedInputCoder, org.apache.beam.sdk.coders.Coder windowCoder, org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend, @Nullable org.apache.flink.runtime.state.KeyedStateBackend<java.lang.Object> keyedStateBackend, int maxConcurrentCheckpoints, org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions) throws java.lang.Exception
java.lang.Exceptionpublic void startBundle()
public void processElement(org.apache.beam.sdk.util.WindowedValue<InputT> elem)
public <KeyT> void onTimer(java.lang.String timerId,
java.lang.String timerFamilyId,
KeyT key,
org.apache.beam.sdk.transforms.windowing.BoundedWindow window,
org.joda.time.Instant timestamp,
org.joda.time.Instant outputTimestamp,
org.apache.beam.sdk.state.TimeDomain timeDomain)
public void finishBundle()
public <KeyT> void onWindowExpiration(org.apache.beam.sdk.transforms.windowing.BoundedWindow window,
org.joda.time.Instant timestamp,
KeyT key)
public void checkpoint(long checkpointId)
throws java.lang.Exception
java.lang.Exceptionpublic void checkpointCompleted(long checkpointId)
throws java.lang.Exception
java.lang.Exception