pnowojski commented on a change in pull request #11177: [FLINK-16219][runtime]
Made AsyncWaitOperator chainable to non-sources.
URL: https://github.com/apache/flink/pull/11177#discussion_r385604554
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java
##########
@@ -587,30 +588,54 @@ private void connect(Integer headOfChain, StreamEdge
edge) {
if (LOG.isDebugEnabled()) {
LOG.debug("CONNECTED: {} - {} -> {}",
partitioner.getClass().getSimpleName(),
- headOfChain, downStreamvertexID);
+ headOfChain, downStreamVertexID);
}
}
public static boolean isChainable(StreamEdge edge, StreamGraph
streamGraph) {
StreamNode upStreamVertex = streamGraph.getSourceVertex(edge);
StreamNode downStreamVertex = streamGraph.getTargetVertex(edge);
- StreamOperatorFactory<?> headOperator =
upStreamVertex.getOperatorFactory();
- StreamOperatorFactory<?> outOperator =
downStreamVertex.getOperatorFactory();
-
return downStreamVertex.getInEdges().size() == 1
- && outOperator != null
- && headOperator != null
&&
upStreamVertex.isSameSlotSharingGroup(downStreamVertex)
- && outOperator.getChainingStrategy() ==
ChainingStrategy.ALWAYS
- && (headOperator.getChainingStrategy() ==
ChainingStrategy.HEAD ||
- headOperator.getChainingStrategy() ==
ChainingStrategy.ALWAYS)
+ && areOperatorsChainable(upStreamVertex,
downStreamVertex, streamGraph)
&& (edge.getPartitioner() instanceof
ForwardPartitioner)
&& edge.getShuffleMode() != ShuffleMode.BATCH
&& upStreamVertex.getParallelism() ==
downStreamVertex.getParallelism()
&& streamGraph.isChainingEnabled();
}
+ private static boolean areOperatorsChainable(
Review comment:
Can we unit test this method assuming that `StreamNode` and `StreamGraph`
are easy to construct/mock?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services