提交 e9c83ea2 编写于 作者: S Stephan Ewen

[hotfix] Update comments in 'ChainingStrategy' and remove outdated 'FORCE_ALWAYS' constant

上级 28feede7
......@@ -398,15 +398,12 @@ public class StreamingJobGraphGenerator {
&& headOperator != null
&& upStreamVertex.getSlotSharingID() == downStreamVertex.getSlotSharingID()
&& upStreamVertex.getSlotSharingID() != -1
&& (outOperator.getChainingStrategy() == ChainingStrategy.ALWAYS ||
outOperator.getChainingStrategy() == ChainingStrategy.FORCE_ALWAYS)
&& outOperator.getChainingStrategy() == ChainingStrategy.ALWAYS
&& (headOperator.getChainingStrategy() == ChainingStrategy.HEAD ||
headOperator.getChainingStrategy() == ChainingStrategy.ALWAYS ||
headOperator.getChainingStrategy() == ChainingStrategy.FORCE_ALWAYS)
headOperator.getChainingStrategy() == ChainingStrategy.ALWAYS)
&& (edge.getPartitioner() instanceof ForwardPartitioner)
&& upStreamVertex.getParallelism() == downStreamVertex.getParallelism()
&& (streamGraph.isChainingEnabled() ||
outOperator.getChainingStrategy() == ChainingStrategy.FORCE_ALWAYS);
&& streamGraph.isChainingEnabled();
}
private void setSlotSharing() {
......
......@@ -18,23 +18,22 @@
package org.apache.flink.streaming.api.operators;
/**
* Defines the chaining scheme for the operator.
* By default {@link #ALWAYS} is used, which means operators will be eagerly chained whenever possible.
* Defines the chaining scheme for the operator. When an operator is chained to the
* predecessor, it means that they run in the same thread. They become one operator
* consisting of multiple steps.
*
* <p>The default value used by the {@link StreamOperator} is {@link #HEAD}, which means that
* the operator is not chained to its predecessor. Most operators override this with
* {@link #ALWAYS}, meaning they will be chained to predecessors whenever possible.
*/
public enum ChainingStrategy {
/**
* Chaining will happen even if chaining is disabled on the execution environment.
* This should only be used by system-level operators, not operators implemented by users.
*/
FORCE_ALWAYS,
/**
* Operators will be eagerly chained whenever possible, for
* maximal performance. It is generally a good practice to allow maximal
* chaining and increase operator parallelism
* Operators will be eagerly chained whenever possible.
*
* <p>To optimize performance, it is generally a good practice to allow maximal
* chaining and increase operator parallelism.
*/
ALWAYS,
......@@ -42,7 +41,10 @@ public enum ChainingStrategy {
* The operator will not be chained to the preceding or succeeding operators.
*/
NEVER,
/**
* The operator will not be chained to the predecessor, but successors may chain to this
* operator.
*/
HEAD
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册