Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
044fe5fd
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,发现更多精彩内容 >>
提交
044fe5fd
编写于
11月 09, 2015
作者:
U
Ufuk Celebi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-2986] Fix typo in KvState interface snapshot method
上级
061e9297
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
11 deletion
+11
-11
docs/internals/stream_checkpointing.md
docs/internals/stream_checkpointing.md
+1
-1
flink-runtime/src/main/java/org/apache/flink/runtime/state/KvState.java
...src/main/java/org/apache/flink/runtime/state/KvState.java
+1
-1
flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsHeapKvState.java
.../apache/flink/runtime/state/filesystem/FsHeapKvState.java
+1
-1
flink-runtime/src/main/java/org/apache/flink/runtime/state/memory/MemHeapKvState.java
...org/apache/flink/runtime/state/memory/MemHeapKvState.java
+1
-1
flink-runtime/src/test/java/org/apache/flink/runtime/state/FileStateBackendTest.java
.../org/apache/flink/runtime/state/FileStateBackendTest.java
+3
-3
flink-runtime/src/test/java/org/apache/flink/runtime/state/MemoryStateBackendTest.java
...rg/apache/flink/runtime/state/MemoryStateBackendTest.java
+3
-3
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java
...flink/streaming/api/operators/AbstractStreamOperator.java
+1
-1
未找到文件。
docs/internals/stream_checkpointing.md
浏览文件 @
044fe5fd
...
@@ -52,7 +52,7 @@ Kafka exploits this ability.
...
@@ -52,7 +52,7 @@ Kafka exploits this ability.
## Checkpointing
## Checkpointing
The central part of Flink's fault tolerance mechanism is drawing consistent snapshots of the distributed data stream and operator state.
The central part of Flink's fault tolerance mechanism is drawing consistent snapshots of the distributed data stream and operator state.
These s
h
apshots act as consistent checkpoints to which the system can fall back in case of a failure. Flink's mechanism for drawing these
These s
n
apshots act as consistent checkpoints to which the system can fall back in case of a failure. Flink's mechanism for drawing these
snapshots is described in "
[
Lightweight Asynchronous Snapshots for Distributed Dataflows
](
http://arxiv.org/abs/1506.08603
)
". It is inspired by
snapshots is described in "
[
Lightweight Asynchronous Snapshots for Distributed Dataflows
](
http://arxiv.org/abs/1506.08603
)
". It is inspired by
the standard
[
Chandy-Lamport algorithm
](
http://research.microsoft.com/en-us/um/people/lamport/pubs/chandy.pdf
)
for distributed snapshots and is
the standard
[
Chandy-Lamport algorithm
](
http://research.microsoft.com/en-us/um/people/lamport/pubs/chandy.pdf
)
for distributed snapshots and is
specifically tailored to Flink's execution model.
specifically tailored to Flink's execution model.
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/state/KvState.java
浏览文件 @
044fe5fd
...
@@ -51,7 +51,7 @@ public interface KvState<K, V, Backend extends StateBackend<Backend>> extends Op
...
@@ -51,7 +51,7 @@ public interface KvState<K, V, Backend extends StateBackend<Backend>> extends Op
* @throws Exception Exceptions during snapshotting the state should be forwarded, so the system
* @throws Exception Exceptions during snapshotting the state should be forwarded, so the system
* can react to failed snapshots.
* can react to failed snapshots.
*/
*/
KvStateSnapshot
<
K
,
V
,
Backend
>
s
h
apshot
(
long
checkpointId
,
long
timestamp
)
throws
Exception
;
KvStateSnapshot
<
K
,
V
,
Backend
>
s
n
apshot
(
long
checkpointId
,
long
timestamp
)
throws
Exception
;
/**
/**
* Gets the number of key/value pairs currently stored in the state. Note that is a key
* Gets the number of key/value pairs currently stored in the state. Note that is a key
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsHeapKvState.java
浏览文件 @
044fe5fd
...
@@ -69,7 +69,7 @@ public class FsHeapKvState<K, V> extends AbstractHeapKvState<K, V, FsStateBacken
...
@@ -69,7 +69,7 @@ public class FsHeapKvState<K, V> extends AbstractHeapKvState<K, V, FsStateBacken
@Override
@Override
public
FsHeapKvStateSnapshot
<
K
,
V
>
s
h
apshot
(
long
checkpointId
,
long
timestamp
)
throws
Exception
{
public
FsHeapKvStateSnapshot
<
K
,
V
>
s
n
apshot
(
long
checkpointId
,
long
timestamp
)
throws
Exception
{
// first, create an output stream to write to
// first, create an output stream to write to
try
(
FsStateBackend
.
FsCheckpointStateOutputStream
out
=
try
(
FsStateBackend
.
FsCheckpointStateOutputStream
out
=
backend
.
createCheckpointStateOutputStream
(
checkpointId
,
timestamp
))
{
backend
.
createCheckpointStateOutputStream
(
checkpointId
,
timestamp
))
{
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/state/memory/MemHeapKvState.java
浏览文件 @
044fe5fd
...
@@ -42,7 +42,7 @@ public class MemHeapKvState<K, V> extends AbstractHeapKvState<K, V, MemoryStateB
...
@@ -42,7 +42,7 @@ public class MemHeapKvState<K, V> extends AbstractHeapKvState<K, V, MemoryStateB
}
}
@Override
@Override
public
MemoryHeapKvStateSnapshot
<
K
,
V
>
s
h
apshot
(
long
checkpointId
,
long
timestamp
)
throws
Exception
{
public
MemoryHeapKvStateSnapshot
<
K
,
V
>
s
n
apshot
(
long
checkpointId
,
long
timestamp
)
throws
Exception
{
DataOutputSerializer
ser
=
new
DataOutputSerializer
(
Math
.
max
(
size
()
*
16
,
16
));
DataOutputSerializer
ser
=
new
DataOutputSerializer
(
Math
.
max
(
size
()
*
16
,
16
));
writeStateToOutputView
(
ser
);
writeStateToOutputView
(
ser
);
byte
[]
bytes
=
ser
.
getCopyOfBuffer
();
byte
[]
bytes
=
ser
.
getCopyOfBuffer
();
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/state/FileStateBackendTest.java
浏览文件 @
044fe5fd
...
@@ -247,7 +247,7 @@ public class FileStateBackendTest {
...
@@ -247,7 +247,7 @@ public class FileStateBackendTest {
// draw a snapshot
// draw a snapshot
KvStateSnapshot
<
Integer
,
String
,
FsStateBackend
>
snapshot1
=
KvStateSnapshot
<
Integer
,
String
,
FsStateBackend
>
snapshot1
=
kv
.
s
h
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
kv
.
s
n
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
// make some more modifications
// make some more modifications
kv
.
setCurrentKey
(
1
);
kv
.
setCurrentKey
(
1
);
...
@@ -259,7 +259,7 @@ public class FileStateBackendTest {
...
@@ -259,7 +259,7 @@ public class FileStateBackendTest {
// draw another snapshot
// draw another snapshot
KvStateSnapshot
<
Integer
,
String
,
FsStateBackend
>
snapshot2
=
KvStateSnapshot
<
Integer
,
String
,
FsStateBackend
>
snapshot2
=
kv
.
s
h
apshot
(
682375462379L
,
System
.
currentTimeMillis
());
kv
.
s
n
apshot
(
682375462379L
,
System
.
currentTimeMillis
());
// validate the original state
// validate the original state
assertEquals
(
3
,
kv
.
size
());
assertEquals
(
3
,
kv
.
size
());
...
@@ -325,7 +325,7 @@ public class FileStateBackendTest {
...
@@ -325,7 +325,7 @@ public class FileStateBackendTest {
kv
.
update
(
"2"
);
kv
.
update
(
"2"
);
KvStateSnapshot
<
Integer
,
String
,
FsStateBackend
>
snapshot
=
KvStateSnapshot
<
Integer
,
String
,
FsStateBackend
>
snapshot
=
kv
.
s
h
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
kv
.
s
n
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/state/MemoryStateBackendTest.java
浏览文件 @
044fe5fd
...
@@ -166,7 +166,7 @@ public class MemoryStateBackendTest {
...
@@ -166,7 +166,7 @@ public class MemoryStateBackendTest {
// draw a snapshot
// draw a snapshot
KvStateSnapshot
<
Integer
,
String
,
MemoryStateBackend
>
snapshot1
=
KvStateSnapshot
<
Integer
,
String
,
MemoryStateBackend
>
snapshot1
=
kv
.
s
h
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
kv
.
s
n
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
// make some more modifications
// make some more modifications
kv
.
setCurrentKey
(
1
);
kv
.
setCurrentKey
(
1
);
...
@@ -178,7 +178,7 @@ public class MemoryStateBackendTest {
...
@@ -178,7 +178,7 @@ public class MemoryStateBackendTest {
// draw another snapshot
// draw another snapshot
KvStateSnapshot
<
Integer
,
String
,
MemoryStateBackend
>
snapshot2
=
KvStateSnapshot
<
Integer
,
String
,
MemoryStateBackend
>
snapshot2
=
kv
.
s
h
apshot
(
682375462379L
,
System
.
currentTimeMillis
());
kv
.
s
n
apshot
(
682375462379L
,
System
.
currentTimeMillis
());
// validate the original state
// validate the original state
assertEquals
(
3
,
kv
.
size
());
assertEquals
(
3
,
kv
.
size
());
...
@@ -230,7 +230,7 @@ public class MemoryStateBackendTest {
...
@@ -230,7 +230,7 @@ public class MemoryStateBackendTest {
kv
.
update
(
"2"
);
kv
.
update
(
"2"
);
KvStateSnapshot
<
Integer
,
String
,
MemoryStateBackend
>
snapshot
=
KvStateSnapshot
<
Integer
,
String
,
MemoryStateBackend
>
snapshot
=
kv
.
s
h
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
kv
.
s
n
apshot
(
682375462378L
,
System
.
currentTimeMillis
());
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
...
...
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java
浏览文件 @
044fe5fd
...
@@ -161,7 +161,7 @@ public abstract class AbstractStreamOperator<OUT>
...
@@ -161,7 +161,7 @@ public abstract class AbstractStreamOperator<OUT>
HashMap
<
String
,
KvStateSnapshot
<?,
?,
?>>
snapshots
=
new
HashMap
<>(
keyValueStatesByName
.
size
());
HashMap
<
String
,
KvStateSnapshot
<?,
?,
?>>
snapshots
=
new
HashMap
<>(
keyValueStatesByName
.
size
());
for
(
Map
.
Entry
<
String
,
KvState
<?,
?,
?>>
entry
:
keyValueStatesByName
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
KvState
<?,
?,
?>>
entry
:
keyValueStatesByName
.
entrySet
())
{
KvStateSnapshot
<?,
?,
?>
snapshot
=
entry
.
getValue
().
s
h
apshot
(
checkpointId
,
timestamp
);
KvStateSnapshot
<?,
?,
?>
snapshot
=
entry
.
getValue
().
s
n
apshot
(
checkpointId
,
timestamp
);
snapshots
.
put
(
entry
.
getKey
(),
snapshot
);
snapshots
.
put
(
entry
.
getKey
(),
snapshot
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录