New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-12823][datastream] PartitionTransformation supports DataExchan… #8721
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
I think we should not reuse the existing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems very good now. I had a comment about a test and about adding null checks for the new shuffle mode.
@@ -428,7 +436,11 @@ private void addEdgeInternal(Integer upStreamVertexID, | |||
} | |||
} | |||
|
|||
StreamEdge edge = new StreamEdge(upstreamNode, downstreamNode, typeNumber, outputNames, partitioner, outputTag); | |||
if (shuffleMode == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it happen that shuffleMode
is null
? We should add a null check in PartitionTransform
and mark the field @Nonnull
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it can be null here. Because there might be no PartitionTransformation
if user does not specify explicitly. And then partitioner
and shuffleMode
would be null here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense
@@ -69,6 +88,15 @@ public PartitionTransformation(StreamTransformation<T> input, StreamPartitioner< | |||
return partitioner; | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like these redundant descriptions to much, this can be simplified to:
/**
* Returns the {@link ShuffleMode} of this {@link PartitionTransformation}.
*/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -79,6 +107,6 @@ public PartitionTransformation(StreamTransformation<T> input, StreamPartitioner< | |||
|
|||
@Override | |||
public final void setChainingStrategy(ChainingStrategy strategy) { | |||
throw new UnsupportedOperationException("Cannot set chaining strategy on Union Transformation."); | |||
throw new UnsupportedOperationException("Cannot set chaining strategy on Partition Transformation."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! 😅
@@ -133,8 +136,8 @@ public void testChainStartEndSetting() throws Exception { | |||
public Integer map(Integer value) throws Exception { | |||
return value; | |||
} | |||
}) | |||
.print(); | |||
}).setParallelism(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change needed? It seems to be an unrelated test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an unrelated change in a sense.
I found it when adding unit test. It's a potential unstable case since it depends on the StreamExecutionEnvironment.defaultLocalParallelism
which must be not 1 in this case.
However I just found someone has fixed it yesterday. What a coincident! I can remove it from this PR.
e76bd0e
to
52e9230
Compare
Hi @aljoscha |
Thanks! I think I can merge once Travis is green. 👌 |
Travis failed, there is an importing error in python module. I don't think it is caused by this PR. I will try to rebase master and trigger travis checking again. |
52e9230
to
3cfd7b7
Compare
Python module is fine but connectors module failed this time on Travis checking. It seems a travis relevant issue. I have filed a JIRA issue for this, https://issues.apache.org/jira/browse/FLINK-12866 |
I merged this. Thanks for working on this with me! 👍 |
…geMode property
What is the purpose of the change
StreamTransformation
would also support batch runner in 1.9, the result partition type ofStreamTransformation
should not be hard-coded withPIPELINED_BOUNDED
StreamTransformation
to configure the result partition type of edgeBrief change log
DataExchangeMode
ofPartitionTransformation
as an internal API ofStreamTransformation
DataExchangeMode
toStreamEdge
StreamingJobGraphGenerator
chooses the appropriate result partition type based onDataExchangeMode
ofStreamEdge
Verifying this change
StreamingJobGraphGeneratorTest
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation