wanglijie95 commented on code in PR #23085:
URL: https://github.com/apache/flink/pull/23085#discussion_r1280165421
##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java:
##########
@@ -896,12 +896,13 @@ private String createChainedName(
Integer vertexID,
List<StreamEdge> chainedOutputs,
Optional<OperatorChainInfo> operatorChainInfo) {
+ List<ChainedSourceInfo> list =
Review Comment:
`list` -> `chainedSourceInfos`
##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java:
##########
@@ -1693,6 +1723,10 @@ public JobGraph createGraphWithMultipleInputs(boolean
chain, String... inputName
transform.setChainingStrategy(
chain ? ChainingStrategy.HEAD_WITH_SOURCES :
ChainingStrategy.NEVER);
+ DataStream<Long> dataStream = new DataStream<>(env, transform);
+ // do not chain with sink operator.
+ dataStream.rebalance().addSink(new DiscardingSink<>()).name(sinkName);
Review Comment:
We can use the `MultipleConnectedStreams` here.
```
new MultipleConnectedStreams(env)
.transform(transform)
.rebalance()
.addSink(new DiscardingSink<>())
.name(sinkName);
```
##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java:
##########
@@ -1655,28 +1655,58 @@ void
testSlotSharingResourceConfigurationWithDefaultSlotSharingGroup() {
@Test
void testNamingOfChainedMultipleInputs() {
String[] sources = new String[] {"source-1", "source-2", "source-3"};
- JobGraph graph = createGraphWithMultipleInputs(true, sources);
- JobVertex head =
graph.getVerticesSortedTopologicallyFromSources().iterator().next();
- assertThat(sources).allMatch(source ->
head.getOperatorPrettyName().contains(source));
+ String sink = "sink";
+ JobGraph graph = createGraphWithMultipleInputs(true, sink, sources);
+ Iterator<JobVertex> iterator =
graph.getVerticesSortedTopologicallyFromSources().iterator();
+
+ JobVertex multipleVertex = iterator.next();
+ verifyJobVertexName(multipleVertex, sources, new String[] {sink});
Review Comment:
I think we can directly check the job vertex name by:
`assertThat(multipleVertex.getName()).isEqualTo("mit [Source: source-1,
Source: source-2, Source: source-3]")`.
The same for others.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]