Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
57615aaa
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,发现更多精彩内容 >>
提交
57615aaa
编写于
2月 11, 2015
作者:
F
Fabian Hueske
提交者:
Stephan Ewen
5月 12, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-785] Fixed ObjectReuseITCase
This closes #370
上级
a3a7350d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
35 deletion
+23
-35
flink-tests/src/test/java/org/apache/flink/test/operators/ObjectReuseITCase.java
...va/org/apache/flink/test/operators/ObjectReuseITCase.java
+23
-35
未找到文件。
flink-tests/src/test/java/org/apache/flink/test/operators/ObjectReuseITCase.java
浏览文件 @
57615aaa
...
...
@@ -43,18 +43,26 @@ import java.util.List;
@RunWith
(
Parameterized
.
class
)
public
class
ObjectReuseITCase
extends
JavaProgramTestBase
{
private
static
int
NUM_PROGRAMS
=
3
;
private
static
int
NUM_PROGRAMS
=
4
;
private
int
curProgId
=
config
.
getInteger
(
"ProgramId"
,
-
1
);
private
String
resultPath
;
private
String
expectedResult
;
private
static
String
inReducePath
;
private
static
String
inGroupReducePath
;
private
String
IN_REDUCE
=
"a,1\na,2\na,3\na,4\na,50\n"
;
private
String
IN_GROUP_REDUCE
=
"a,1\na,2\na,3\na,4\na,5\n"
;
public
ObjectReuseITCase
(
Configuration
config
)
{
super
(
config
);
}
@Override
protected
void
preSubmit
()
throws
Exception
{
inReducePath
=
createTempFile
(
"in_reduce.txt"
,
IN_REDUCE
);
inGroupReducePath
=
createTempFile
(
"in_group_reduce.txt"
,
IN_GROUP_REDUCE
);
resultPath
=
getTempDirPath
(
"result"
);
}
...
...
@@ -100,13 +108,7 @@ public class ObjectReuseITCase extends JavaProgramTestBase {
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
getExecutionEnvironment
();
env
.
getConfig
().
enableObjectReuse
();
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
fromElements
(
new
Tuple2
<
String
,
Integer
>(
"a"
,
1
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
2
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
3
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
4
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
50
));
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
readCsvFile
(
inReducePath
).
types
(
String
.
class
,
Integer
.
class
).
setParallelism
(
1
);
DataSet
<
Tuple2
<
String
,
Integer
>>
result
=
input
.
groupBy
(
0
).
reduce
(
new
ReduceFunction
<
Tuple2
<
String
,
Integer
>>()
{
@Override
...
...
@@ -131,14 +133,10 @@ public class ObjectReuseITCase extends JavaProgramTestBase {
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
getExecutionEnvironment
();
env
.
getConfig
().
enableObjectReuse
();
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
fromElements
(
new
Tuple2
<
String
,
Integer
>(
"a"
,
1
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
2
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
3
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
4
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
50
));
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
readCsvFile
(
inReducePath
).
types
(
String
.
class
,
Integer
.
class
).
setParallelism
(
1
);
DataSet
<
Tuple2
<
String
,
Integer
>>
result
=
input
.
reduce
(
new
ReduceFunction
<
Tuple2
<
String
,
Integer
>>()
{
DataSet
<
Tuple2
<
String
,
Integer
>>
result
=
input
.
reduce
(
new
ReduceFunction
<
Tuple2
<
String
,
Integer
>>()
{
@Override
public
Tuple2
<
String
,
Integer
>
reduce
(
...
...
@@ -163,12 +161,7 @@ public class ObjectReuseITCase extends JavaProgramTestBase {
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
getExecutionEnvironment
();
env
.
getConfig
().
enableObjectReuse
();
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
fromElements
(
new
Tuple2
<
String
,
Integer
>(
"a"
,
1
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
2
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
3
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
4
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
5
));
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
readCsvFile
(
inGroupReducePath
).
types
(
String
.
class
,
Integer
.
class
).
setParallelism
(
1
);
DataSet
<
Tuple2
<
String
,
Integer
>>
result
=
input
.
reduceGroup
(
new
GroupReduceFunction
<
Tuple2
<
String
,
Integer
>,
Tuple2
<
String
,
Integer
>>()
{
...
...
@@ -203,12 +196,7 @@ public class ObjectReuseITCase extends JavaProgramTestBase {
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
getExecutionEnvironment
();
env
.
getConfig
().
enableObjectReuse
();
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
fromElements
(
new
Tuple2
<
String
,
Integer
>(
"a"
,
1
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
2
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
3
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
4
),
new
Tuple2
<
String
,
Integer
>(
"a"
,
5
));
DataSet
<
Tuple2
<
String
,
Integer
>>
input
=
env
.
readCsvFile
(
inGroupReducePath
).
types
(
String
.
class
,
Integer
.
class
).
setParallelism
(
1
);
DataSet
<
Tuple2
<
String
,
Integer
>>
result
=
input
.
reduceGroup
(
new
GroupReduceFunction
<
Tuple2
<
String
,
Integer
>,
Tuple2
<
String
,
Integer
>>()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录