Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
69f7f6d9
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,发现更多精彩内容 >>
提交
69f7f6d9
编写于
2月 02, 2016
作者:
A
Aljoscha Krettek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-2845] Fix TimestampITCase.testWatermarkPropagation()
上级
f8f747f2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
39 deletion
+17
-39
flink-streaming-java/src/test/java/org/apache/flink/streaming/timestamp/TimestampITCase.java
...org/apache/flink/streaming/timestamp/TimestampITCase.java
+17
-39
未找到文件。
flink-streaming-java/src/test/java/org/apache/flink/streaming/timestamp/TimestampITCase.java
浏览文件 @
69f7f6d9
...
...
@@ -47,6 +47,7 @@ import org.junit.Test;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
Assert
.
fail
;
/**
...
...
@@ -141,42 +142,11 @@ public class TimestampITCase {
// verify that all the watermarks arrived at the final custom operator
for
(
int
i
=
0
;
i
<
PARALLELISM
;
i
++)
{
// There can be two cases, either we get NUM_WATERMARKS + 1 watermarks or
// (NUM_WATERMARKS / 2) + 1 watermarks. This depends on which source get's to run first.
// If source1 runs first we jump directly to +Inf and skip all the intermediate
// watermarks. If source2 runs first we see the intermediate watermarks from
// NUM_WATERMARKS/2 to +Inf.
if
(
CustomOperator
.
finalWatermarks
[
i
].
size
()
==
NUM_WATERMARKS
+
1
)
{
for
(
int
j
=
0
;
j
<
NUM_WATERMARKS
;
j
++)
{
if
(!
CustomOperator
.
finalWatermarks
[
i
].
get
(
j
).
equals
(
new
Watermark
(
initialTime
+
j
)))
{
System
.
err
.
println
(
"All Watermarks: "
);
for
(
int
k
=
0
;
k
<=
NUM_WATERMARKS
;
k
++)
{
System
.
err
.
println
(
CustomOperator
.
finalWatermarks
[
i
].
get
(
k
));
}
Assert
.
fail
(
"Wrong watermark."
);
}
}
if
(!
CustomOperator
.
finalWatermarks
[
i
].
get
(
NUM_WATERMARKS
).
equals
(
new
Watermark
(
Long
.
MAX_VALUE
)))
{
System
.
err
.
println
(
"All Watermarks: "
);
for
(
int
k
=
0
;
k
<=
NUM_WATERMARKS
;
k
++)
{
System
.
err
.
println
(
CustomOperator
.
finalWatermarks
[
i
].
get
(
k
));
}
Assert
.
fail
(
"Wrong watermark."
);
}
}
else
{
for
(
int
j
=
0
;
j
<
NUM_WATERMARKS
/
2
;
j
++)
{
if
(!
CustomOperator
.
finalWatermarks
[
i
].
get
(
j
).
equals
(
new
Watermark
(
initialTime
+
j
)))
{
System
.
err
.
println
(
"All Watermarks: "
);
for
(
int
k
=
0
;
k
<=
NUM_WATERMARKS
/
2
;
k
++)
{
System
.
err
.
println
(
CustomOperator
.
finalWatermarks
[
i
].
get
(
k
));
}
Assert
.
fail
(
"Wrong watermark."
);
}
}
if
(!
CustomOperator
.
finalWatermarks
[
i
].
get
(
NUM_WATERMARKS
/
2
).
equals
(
new
Watermark
(
Long
.
MAX_VALUE
)))
{
// we are only guaranteed to see NUM_WATERMARKS / 2 watermarks in order, because
// after that source2 emits Long.MAX_VALUE which could match with an arbitrary
// mark from source 1, for example, we could see 0,1,2,4,5,7,MAX
for
(
int
j
=
0
;
j
<
NUM_WATERMARKS
/
2
;
j
++)
{
if
(!
CustomOperator
.
finalWatermarks
[
i
].
get
(
j
).
equals
(
new
Watermark
(
initialTime
+
j
)))
{
System
.
err
.
println
(
"All Watermarks: "
);
for
(
int
k
=
0
;
k
<=
NUM_WATERMARKS
/
2
;
k
++)
{
System
.
err
.
println
(
CustomOperator
.
finalWatermarks
[
i
].
get
(
k
));
...
...
@@ -184,9 +154,14 @@ public class TimestampITCase {
Assert
.
fail
(
"Wrong watermark."
);
}
}
if
(!
CustomOperator
.
finalWatermarks
[
i
].
get
(
CustomOperator
.
finalWatermarks
[
i
].
size
()
-
1
).
equals
(
new
Watermark
(
Long
.
MAX_VALUE
)))
{
System
.
err
.
println
(
"All Watermarks: "
);
for
(
int
k
=
0
;
k
<=
NUM_WATERMARKS
;
k
++)
{
System
.
err
.
println
(
CustomOperator
.
finalWatermarks
[
i
].
get
(
k
));
}
Assert
.
fail
(
"Wrong watermark."
);
}
}
}
...
...
@@ -615,6 +590,9 @@ public class TimestampITCase {
@Override
public
void
processWatermark
(
Watermark
mark
)
throws
Exception
{
for
(
Watermark
previousMark:
watermarks
)
{
assertTrue
(
previousMark
.
getTimestamp
()
<
mark
.
getTimestamp
());
}
watermarks
.
add
(
mark
);
latch
.
trigger
();
output
.
emitWatermark
(
mark
);
...
...
@@ -623,7 +601,7 @@ public class TimestampITCase {
@Override
public
void
open
()
throws
Exception
{
super
.
open
();
watermarks
=
new
ArrayList
<
Watermark
>();
watermarks
=
new
ArrayList
<>();
}
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录