Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
e8edbcaf
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,发现更多精彩内容 >>
提交
e8edbcaf
编写于
12月 20, 2017
作者:
X
Xingcan Cui
提交者:
Aljoscha Krettek
1月 02, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-8257] [conf] Unify the value checks for setParallelism()
上级
9e3bac39
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
13 addition
and
13 deletion
+13
-13
flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java
...in/java/org/apache/flink/api/java/operators/Operator.java
+1
-1
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphAnalyticBase.java
...c/main/java/org/apache/flink/graph/GraphAnalyticBase.java
+1
-1
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/IterationConfiguration.java
...n/java/org/apache/flink/graph/IterationConfiguration.java
+4
-1
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/proxy/GraphAlgorithmWrappingBase.java
...e/flink/graph/utils/proxy/GraphAlgorithmWrappingBase.java
+1
-1
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamSource.java
...ache/flink/streaming/api/datastream/DataStreamSource.java
+1
-1
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/SingleOutputStreamOperator.java
.../streaming/api/datastream/SingleOutputStreamOperator.java
+1
-4
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
...streaming/api/environment/StreamExecutionEnvironment.java
+0
-3
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/transformations/StreamTransformation.java
...k/streaming/api/transformations/StreamTransformation.java
+4
-1
未找到文件。
flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java
浏览文件 @
e8edbcaf
...
...
@@ -120,7 +120,7 @@ public abstract class Operator<OUT, O extends Operator<OUT, O>> extends DataSet<
*/
public
O
setParallelism
(
int
parallelism
)
{
Preconditions
.
checkArgument
(
parallelism
>
0
||
parallelism
==
ExecutionConfig
.
PARALLELISM_DEFAULT
,
"The parallelism of an operator must be at least 1
."
);
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default)
."
);
this
.
parallelism
=
parallelism
;
...
...
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphAnalyticBase.java
浏览文件 @
e8edbcaf
...
...
@@ -59,7 +59,7 @@ implements GraphAnalytic<K, VV, EV, T> {
*/
public
GraphAnalyticBase
<
K
,
VV
,
EV
,
T
>
setParallelism
(
int
parallelism
)
{
Preconditions
.
checkArgument
(
parallelism
>
0
||
parallelism
==
PARALLELISM_DEFAULT
,
"The parallelism must be greater than zero
."
);
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default)
."
);
this
.
parallelism
=
parallelism
;
...
...
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/IterationConfiguration.java
浏览文件 @
e8edbcaf
...
...
@@ -18,6 +18,7 @@
package
org.apache.flink.graph
;
import
org.apache.flink.api.common.ExecutionConfig
;
import
org.apache.flink.api.common.aggregators.Aggregator
;
import
org.apache.flink.graph.spargel.GatherFunction
;
import
org.apache.flink.util.Preconditions
;
...
...
@@ -77,7 +78,9 @@ public abstract class IterationConfiguration {
* @param parallelism The parallelism.
*/
public
void
setParallelism
(
int
parallelism
)
{
Preconditions
.
checkArgument
(
parallelism
>
0
||
parallelism
==
-
1
,
"The parallelism must be positive, or -1 (use default)."
);
Preconditions
.
checkArgument
(
parallelism
>
0
||
parallelism
==
ExecutionConfig
.
PARALLELISM_DEFAULT
,
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default)."
);
this
.
parallelism
=
parallelism
;
}
...
...
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/proxy/GraphAlgorithmWrappingBase.java
浏览文件 @
e8edbcaf
...
...
@@ -58,7 +58,7 @@ implements GraphAlgorithm<K, VV, EV, R> {
*/
public
GraphAlgorithmWrappingBase
<
K
,
VV
,
EV
,
R
>
setParallelism
(
int
parallelism
)
{
Preconditions
.
checkArgument
(
parallelism
>
0
||
parallelism
==
PARALLELISM_DEFAULT
,
"The parallelism must be greater than zero
."
);
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default)
."
);
this
.
parallelism
=
parallelism
;
...
...
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamSource.java
浏览文件 @
e8edbcaf
...
...
@@ -51,7 +51,7 @@ public class DataStreamSource<T> extends SingleOutputStreamOperator<T> {
@Override
public
DataStreamSource
<
T
>
setParallelism
(
int
parallelism
)
{
if
(
parallelism
>
1
&&
!
isParallel
)
{
if
(
parallelism
!=
1
&&
!
isParallel
)
{
throw
new
IllegalArgumentException
(
"Source: "
+
transformation
.
getId
()
+
" is not a parallel source"
);
}
else
{
return
(
DataStreamSource
<
T
>)
super
.
setParallelism
(
parallelism
);
...
...
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/SingleOutputStreamOperator.java
浏览文件 @
e8edbcaf
...
...
@@ -130,16 +130,13 @@ public class SingleOutputStreamOperator<T> extends DataStream<T> {
}
/**
* Sets the parallelism for this operator.
The degree must be 1 or more.
* Sets the parallelism for this operator.
*
* @param parallelism
* The parallelism for this operator.
* @return The operator with set parallelism.
*/
public
SingleOutputStreamOperator
<
T
>
setParallelism
(
int
parallelism
)
{
Preconditions
.
checkArgument
(
parallelism
>
0
,
"The parallelism of an operator must be at least 1."
);
Preconditions
.
checkArgument
(
canBeParallel
()
||
parallelism
==
1
,
"The parallelism of non parallel operator must be 1."
);
...
...
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
浏览文件 @
e8edbcaf
...
...
@@ -174,9 +174,6 @@ public abstract class StreamExecutionEnvironment {
* @param parallelism The parallelism
*/
public
StreamExecutionEnvironment
setParallelism
(
int
parallelism
)
{
if
(
parallelism
<
1
)
{
throw
new
IllegalArgumentException
(
"parallelism must be at least one."
);
}
config
.
setParallelism
(
parallelism
);
return
this
;
}
...
...
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/transformations/StreamTransformation.java
浏览文件 @
e8edbcaf
...
...
@@ -19,6 +19,7 @@
package
org.apache.flink.streaming.api.transformations
;
import
org.apache.flink.annotation.Internal
;
import
org.apache.flink.api.common.ExecutionConfig
;
import
org.apache.flink.api.common.functions.InvalidTypesException
;
import
org.apache.flink.api.common.operators.ResourceSpec
;
import
org.apache.flink.api.common.typeinfo.TypeInformation
;
...
...
@@ -198,7 +199,9 @@ public abstract class StreamTransformation<T> {
* @param parallelism The new parallelism to set on this {@code StreamTransformation}.
*/
public
void
setParallelism
(
int
parallelism
)
{
Preconditions
.
checkArgument
(
parallelism
>
0
,
"Parallelism must be bigger than zero."
);
Preconditions
.
checkArgument
(
parallelism
>
0
||
parallelism
==
ExecutionConfig
.
PARALLELISM_DEFAULT
,
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default)."
);
this
.
parallelism
=
parallelism
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录