提交 ac3b721b 编写于 作者: A Ankit Parashar 提交者: Tzu-Li (Gordon) Tai

[FLINK-8116] [DataStream] Fix stale comments referring to Checkpointed interface

上级 9ae4c544
......@@ -26,7 +26,7 @@ Programs written in the [Data Stream API]({{ site.baseurl }}/dev/datastream_api.
- Windows gather elements or aggregates until they are triggered
- Transformation functions may use the key/value state interface to store values
- Transformation functions may implement the `Checkpointed` interface to make their local variables fault tolerant
- Transformation functions may implement the `CheckpointedFunction` interface to make their local variables fault tolerant
See also [state section]({{ site.baseurl }}/dev/stream/state/index.html) in the streaming API guide.
......
......@@ -34,9 +34,9 @@ import java.io.Serializable;
* The run method can run for as long as necessary. The source must, however, react to an
* invocation of {@link #cancel()} by breaking out of its main loop.
*
* <h3>Checkpointed Sources</h3>
* <h3>CheckpointedFunction Sources</h3>
*
* <p>Sources that also implement the {@link org.apache.flink.streaming.api.checkpoint.Checkpointed}
* <p>Sources that also implement the {@link org.apache.flink.streaming.api.checkpoint.CheckpointedFunction}
* interface must ensure that state checkpointing, updating of internal state and emission of
* elements are not done concurrently. This is achieved by using the provided checkpointing lock
* object to protect update of state and emission of elements in a synchronized block.
......@@ -44,7 +44,7 @@ import java.io.Serializable;
* <p>This is the basic pattern one should follow when implementing a (checkpointed) source:
*
* <pre>{@code
* public class ExampleSource<T> implements SourceFunction<T>, Checkpointed<Long> {
* public class ExampleSource<T> implements SourceFunction<T>, CheckpointedFunction {
* private long count = 0L;
* private volatile boolean isRunning = true;
*
......@@ -61,9 +61,9 @@ import java.io.Serializable;
* isRunning = false;
* }
*
* public Long snapshotState(long checkpointId, long checkpointTimestamp) { return count; }
* public void snapshotState(FunctionSnapshotContext context) { }
*
* public void restoreState(Long state) { this.count = state; }
* public void initializeState(FunctionInitializationContext context) { }
* }
* }</pre>
*
......@@ -96,12 +96,12 @@ public interface SourceFunction<T> extends Function, Serializable {
* Starts the source. Implementations can use the {@link SourceContext} emit
* elements.
*
* <p>Sources that implement {@link org.apache.flink.streaming.api.checkpoint.Checkpointed}
* <p>Sources that implement {@link org.apache.flink.streaming.api.checkpoint.CheckpointedFunction}
* must lock on the checkpoint lock (using a synchronized block) before updating internal
* state and emitting elements, to make both an atomic operation:
*
* <pre>{@code
* public class ExampleSource<T> implements SourceFunction<T>, Checkpointed<Long> {
* public class ExampleSource<T> implements SourceFunction<T>, CheckpointedFunction<Long> {
* private long count = 0L;
* private volatile boolean isRunning = true;
*
......
......@@ -229,7 +229,7 @@ class StreamExecutionEnvironment(javaEnv: JavaEnv) {
* [[KeyedStream]] is maintained (heap, managed memory, externally), and where state
* snapshots/checkpoints are stored, both for the key/value state, and for checkpointed
* functions (implementing the interface
* [[org.apache.flink.streaming.api.checkpoint.Checkpointed]].
* [[org.apache.flink.streaming.api.checkpoint.CheckpointedFunction]].
*
* <p>The [[org.apache.flink.runtime.state.memory.MemoryStateBackend]] for example
* maintains the state in heap memory, as objects. It is lightweight without extra
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册