-
Couldn't load subscription status.
- Fork 13.8k
[FLINK-38564][connector] FLIP-537: Enumerator Maintains Global Splits Distribution for Balanced assignment. #27149
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
base: master
Are you sure you want to change the base?
Conversation
c75098a to
6cde026
Compare
… Distribution for Balanced assignment.
6cde026 to
abe1bc7
Compare
|
@flinkbot run azure |
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.
Thanks @loserwang1024 for the contribution, I left some comments
.../src/main/java/org/apache/flink/api/connector/source/SupportSplitReassignmentOnRecovery.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/api/connector/source/SupportSplitReassignmentOnRecovery.java
Outdated
Show resolved
Hide resolved
flink-core/src/test/java/org/apache/flink/api/connector/source/mocks/MockSplitEnumerator.java
Outdated
Show resolved
Hide resolved
| this.successfulCheckpoints = new ArrayList<>(); | ||
| this.started = false; | ||
| this.closed = false; | ||
| calculateAndPutPendingAssignments(unassignedSplits); |
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.
reassignSplits(unassignedSplits) ?
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.
Maybe recalculateAssignments? Don't assign them until the split is added.
flink-core/src/test/java/org/apache/flink/api/connector/source/mocks/MockSplitEnumerator.java
Outdated
Show resolved
Hide resolved
flink-core/src/test/java/org/apache/flink/api/connector/source/mocks/MockSplitEnumerator.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/main/java/org/apache/flink/streaming/api/operators/SourceOperator.java
Outdated
Show resolved
Hide resolved
|
@leonardBang Thanks for your review. Just modify it. |
What is the purpose of the change
As shown in https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=373886480, add a new source contract that enables the enumerator to have a complete global view of splits.
Brief change log
Extending FLIP-27, this FLIP modified ReaderRegistrationEvent Contract:
If a Source implements SupportsSplitReassignmentOnRecovery, the SourceOperator does not assigned splits from state to the reader. Instead, it reports the splits via a ReaderRegistrationEvent sent to the SplitEnumerator.If a Source is not implements SupportsSplitReassignmentOnRecovery, the SourceOperator assigned splits from state to the reader.The splits won't be included in ReaderRegistrationEvent.
After the SourceCoordinator receives the ReaderRegistrationEvent, it calls addReader on the SplitEnumerator. At this point, the enumerator can access the reported splits through the ReaderInfo obtained from SplitEnumeratorContext#registeredReaders.
Verifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving): yesDocumentation