Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
ac3b721b
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ac3b721b
编写于
12月 04, 2017
作者:
A
Ankit Parashar
提交者:
Tzu-Li (Gordon) Tai
1月 05, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-8116] [DataStream] Fix stale comments referring to Checkpointed interface
上级
9ae4c544
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
9 deletion
+9
-9
docs/ops/state/state_backends.md
docs/ops/state/state_backends.md
+1
-1
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java
.../flink/streaming/api/functions/source/SourceFunction.java
+7
-7
flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala
...link/streaming/api/scala/StreamExecutionEnvironment.scala
+1
-1
未找到文件。
docs/ops/state/state_backends.md
浏览文件 @
ac3b721b
...
...
@@ -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
`Checkpointed
Function
`
interface to make their local variables fault tolerant
See also
[
state section
](
{{
site.baseurl }}/dev/stream/state/index.html) in the streaming API guide.
...
...
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java
浏览文件 @
ac3b721b
...
...
@@ -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>Checkpointed
Function
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.Checkpointed
Function
}
* 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>, Checkpointed
Function
{
* 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.Checkpointed
Function
}
* 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>, Checkpointed
Function
<Long> {
* private long count = 0L;
* private volatile boolean isRunning = true;
*
...
...
flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala
浏览文件 @
ac3b721b
...
...
@@ -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.Checkpointed
Function
]].
*
* <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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录