You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2018/01/06 05:51:55 UTC
[02/11] flink git commit: [FLINK-8116] [DataStream] Fix stale
comments referring to Checkpointed interface
[FLINK-8116] [DataStream] Fix stale comments referring to Checkpointed interface
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/ac3b721b
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/ac3b721b
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/ac3b721b
Branch: refs/heads/master
Commit: ac3b721bf65450ab4ecd90c05d9bb3946d2e447f
Parents: 9ae4c54
Author: Ankit Parashar <an...@gmail.com>
Authored: Mon Dec 4 23:46:16 2017 +0530
Committer: Tzu-Li (Gordon) Tai <tz...@apache.org>
Committed: Fri Jan 5 20:13:48 2018 -0800
----------------------------------------------------------------------
docs/ops/state/state_backends.md | 2 +-
.../api/functions/source/SourceFunction.java | 14 +++++++-------
.../api/scala/StreamExecutionEnvironment.scala | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/ac3b721b/docs/ops/state/state_backends.md
----------------------------------------------------------------------
diff --git a/docs/ops/state/state_backends.md b/docs/ops/state/state_backends.md
index 4cda94f..00e3c4f 100644
--- a/docs/ops/state/state_backends.md
+++ b/docs/ops/state/state_backends.md
@@ -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.
http://git-wip-us.apache.org/repos/asf/flink/blob/ac3b721b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java
----------------------------------------------------------------------
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java
index 4665cc6..cb2e15f 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java
@@ -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;
*
http://git-wip-us.apache.org/repos/asf/flink/blob/ac3b721b/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala
----------------------------------------------------------------------
diff --git a/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala b/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala
index 9fd03c3..3bba505 100644
--- a/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala
+++ b/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala
@@ -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