Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
c03237a8
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,发现更多精彩内容 >>
提交
c03237a8
编写于
11月 21, 2014
作者:
R
Robert Metzger
提交者:
Ufuk Celebi
11月 25, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-1221] Use only method name and location as default operator names
上级
bcdd167f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
6 deletion
+10
-6
flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java
.../java/org/apache/flink/api/java/ExecutionEnvironment.java
+3
-3
flink-java/src/main/java/org/apache/flink/api/java/Utils.java
...k-java/src/main/java/org/apache/flink/api/java/Utils.java
+5
-1
flink-java/src/test/java/org/apache/flink/api/java/operators/NamesTest.java
...t/java/org/apache/flink/api/java/operators/NamesTest.java
+2
-2
未找到文件。
flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java
浏览文件 @
c03237a8
...
...
@@ -426,7 +426,7 @@ public abstract class ExecutionEnvironment {
TypeInformation
<
X
>
type
=
TypeExtractor
.
getForObject
(
firstValue
);
CollectionInputFormat
.
checkCollection
(
data
,
type
.
getTypeClass
());
return
new
DataSource
<
X
>(
this
,
new
CollectionInputFormat
<
X
>(
data
,
type
.
createSerializer
()),
type
,
Utils
.
getCallLocationName
(
4
));
return
new
DataSource
<
X
>(
this
,
new
CollectionInputFormat
<
X
>(
data
,
type
.
createSerializer
()),
type
,
Utils
.
getCallLocationName
());
}
/**
...
...
@@ -572,7 +572,7 @@ public abstract class ExecutionEnvironment {
* @see #fromParallelCollection(SplittableIterator, Class)
*/
public
<
X
>
DataSource
<
X
>
fromParallelCollection
(
SplittableIterator
<
X
>
iterator
,
TypeInformation
<
X
>
type
)
{
return
fromParallelCollection
(
iterator
,
type
,
Utils
.
getCallLocationName
(
4
));
return
fromParallelCollection
(
iterator
,
type
,
Utils
.
getCallLocationName
());
}
// private helper for passing different call location names
...
...
@@ -589,7 +589,7 @@ public abstract class ExecutionEnvironment {
* @return A DataSet, containing all number in the {@code [from, to]} interval.
*/
public
DataSource
<
Long
>
generateSequence
(
long
from
,
long
to
)
{
return
fromParallelCollection
(
new
NumberSequenceIterator
(
from
,
to
),
BasicTypeInfo
.
LONG_TYPE_INFO
,
Utils
.
getCallLocationName
(
3
));
return
fromParallelCollection
(
new
NumberSequenceIterator
(
from
,
to
),
BasicTypeInfo
.
LONG_TYPE_INFO
,
Utils
.
getCallLocationName
());
}
// --------------------------------------------------------------------------------------------
...
...
flink-java/src/main/java/org/apache/flink/api/java/Utils.java
浏览文件 @
c03237a8
...
...
@@ -19,6 +19,8 @@
package
org.apache.flink.api.java
;
import
org.apache.commons.lang3.StringUtils
;
public
class
Utils
{
public
static
String
getCallLocationName
()
{
...
...
@@ -30,6 +32,8 @@ public class Utils {
if
(
st
.
length
<
depth
)
{
// we should not throw an out of bounds exception for this.
return
"<unknown>"
;
}
return
st
[
depth
].
toString
();
String
callLoc
=
st
[
depth
].
toString
();
int
idx
=
StringUtils
.
lastOrdinalIndexOf
(
callLoc
,
"."
,
2
);
// second last occurrence of .
return
callLoc
.
substring
(
idx
+
1
,
callLoc
.
length
());
}
}
flink-java/src/test/java/org/apache/flink/api/java/operators/NamesTest.java
浏览文件 @
c03237a8
...
...
@@ -60,7 +60,7 @@ public class NamesTest implements Serializable {
}
}).
output
(
new
DiscardingOuputFormat
<
String
>());
JavaPlan
plan
=
env
.
createProgramPlan
();
testForName
(
"Filter at
org.apache.flink.api.java.operators.NamesTest.
testDefaultName(NamesTest.java:54)"
,
plan
);
testForName
(
"Filter at testDefaultName(NamesTest.java:54)"
,
plan
);
}
@Test
...
...
@@ -102,7 +102,7 @@ public class NamesTest implements Serializable {
@Override
public
boolean
preVisit
(
Operator
<?>
visitable
)
{
if
(
visitable
instanceof
JoinOperatorBase
)
{
Assert
.
assertEquals
(
"Join at
org.apache.flink.api.java.operators.NamesTest.
testJoinWith(NamesTest.java:92)"
,
visitable
.
getName
());
Assert
.
assertEquals
(
"Join at testJoinWith(NamesTest.java:92)"
,
visitable
.
getName
());
}
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录