public class UnboundedSourceWrapper<OutputT,CheckpointMarkT extends org.apache.beam.sdk.io.UnboundedSource.CheckpointMark> extends org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction<org.apache.beam.sdk.util.WindowedValue<org.apache.beam.sdk.values.ValueWithRecordId<OutputT>>> implements org.apache.flink.streaming.runtime.tasks.ProcessingTimeCallback, BeamStoppableFunction, org.apache.flink.runtime.state.CheckpointListener, org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
UnboundedSources as a Flink Source.| Constructor and Description |
|---|
UnboundedSourceWrapper(java.lang.String stepName,
org.apache.beam.sdk.options.PipelineOptions pipelineOptions,
org.apache.beam.sdk.io.UnboundedSource<OutputT,CheckpointMarkT> source,
int parallelism) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
close() |
java.util.List<? extends org.apache.beam.sdk.io.UnboundedSource<OutputT,CheckpointMarkT>> |
getSplitSources()
Visible so that we can check this in tests.
|
void |
initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context) |
void |
notifyCheckpointComplete(long checkpointId) |
void |
onProcessingTime(long timestamp) |
void |
open(org.apache.flink.configuration.Configuration parameters)
Initialize and restore state before starting execution of the source.
|
void |
run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.beam.sdk.util.WindowedValue<org.apache.beam.sdk.values.ValueWithRecordId<OutputT>>> ctx) |
void |
setSourceContext(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.beam.sdk.util.WindowedValue<org.apache.beam.sdk.values.ValueWithRecordId<OutputT>>> ctx)
Visible so that we can set this in tests.
|
void |
snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext functionSnapshotContext) |
void |
stop()
Unused method for backward compatibility.
|
getIterationRuntimeContext, getRuntimeContext, setRuntimeContextpublic UnboundedSourceWrapper(java.lang.String stepName,
org.apache.beam.sdk.options.PipelineOptions pipelineOptions,
org.apache.beam.sdk.io.UnboundedSource<OutputT,CheckpointMarkT> source,
int parallelism)
throws java.lang.Exception
java.lang.Exceptionpublic void open(org.apache.flink.configuration.Configuration parameters)
throws java.lang.Exception
open in interface org.apache.flink.api.common.functions.RichFunctionopen in class org.apache.flink.api.common.functions.AbstractRichFunctionjava.lang.Exceptionpublic void run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.beam.sdk.util.WindowedValue<org.apache.beam.sdk.values.ValueWithRecordId<OutputT>>> ctx) throws java.lang.Exception
run in interface org.apache.flink.streaming.api.functions.source.SourceFunction<org.apache.beam.sdk.util.WindowedValue<org.apache.beam.sdk.values.ValueWithRecordId<OutputT>>>java.lang.Exceptionpublic void close()
throws java.lang.Exception
close in interface org.apache.flink.api.common.functions.RichFunctionclose in class org.apache.flink.api.common.functions.AbstractRichFunctionjava.lang.Exceptionpublic void cancel()
cancel in interface org.apache.flink.streaming.api.functions.source.SourceFunction<org.apache.beam.sdk.util.WindowedValue<org.apache.beam.sdk.values.ValueWithRecordId<OutputT>>>public void stop()
BeamStoppableFunctionstop in interface BeamStoppableFunctionpublic void snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext functionSnapshotContext)
throws java.lang.Exception
snapshotState in interface org.apache.flink.streaming.api.checkpoint.CheckpointedFunctionjava.lang.Exceptionpublic void initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context)
throws java.lang.Exception
initializeState in interface org.apache.flink.streaming.api.checkpoint.CheckpointedFunctionjava.lang.Exceptionpublic void onProcessingTime(long timestamp)
onProcessingTime in interface org.apache.flink.streaming.runtime.tasks.ProcessingTimeCallbackpublic java.util.List<? extends org.apache.beam.sdk.io.UnboundedSource<OutputT,CheckpointMarkT>> getSplitSources()
public void setSourceContext(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.beam.sdk.util.WindowedValue<org.apache.beam.sdk.values.ValueWithRecordId<OutputT>>> ctx)
public void notifyCheckpointComplete(long checkpointId)
throws java.lang.Exception
notifyCheckpointComplete in interface org.apache.flink.runtime.state.CheckpointListenerjava.lang.Exception