-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Improve][connector-doris] Improved doris source enumerator splits allocation algorithm for subtasks #9108
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
Conversation
…location algorithm for subtasks
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.
Pull Request Overview
This pull request improves the Doris source enumerator’s splits allocation algorithm for subtasks and adds corresponding unit tests. Key changes include:
- Refactoring the split allocation algorithm to sort splits and assign them using an AtomicInteger.
- Adding unit tests for both file-based and Doris-specific source enumerators.
- Minor formatting corrections in the PartitionDefinition’s toString method.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
File | Description |
---|---|
seatunnel-translation/seatunnel-translation-base/src/test/java/org/apache/seatunnel/translation/source/ParallelSourceTest.java | Introduces/refactors tests for file source split enumeration and adds tests for Doris source split enumeration. |
seatunnel-connectors-v2/connector-doris/src/test/java/org/apache/seatunnel/connectors/doris/split/DorisSourceSplitEnumeratorTest.java | Adds tests validating the Doris source split enumeration and allocation logic. |
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/source/split/DorisSourceSplitEnumerator.java | Refactors split assignment to use a sorted list and AtomicInteger for load balancing. |
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/rest/PartitionDefinition.java | Fixes minor formatting in the toString implementation. |
Files not reviewed (2)
- pom.xml: Language not supported
- seatunnel-translation/seatunnel-translation-base/pom.xml: Language not supported
Comments suppressed due to low confidence (1)
seatunnel-translation/seatunnel-translation-base/src/test/java/org/apache/seatunnel/translation/source/ParallelSourceTest.java:183
- Consider adding edge-case tests for the allocateFiles method (e.g. when fileSize is less than parallelism) to ensure the allocation logic behaves correctly in these scenarios.
public int allocateFiles(int id, int parallelism, int fileSize) {
|
||
@Slf4j | ||
public class ParallelSourceTest { | ||
|
||
@Test | ||
void testParallelSourceForPollingFileAllocation() throws Exception { |
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.
Hi @JeremyXin . Why change this?
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.
@Hisoka-X I wrote this test method for the file connector before. This time, I want to use the Mockito method to optimize this unit test method.
waiting test case passes. |
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 @JeremyXin
…location algorithm for subtasks
Purpose of this pull request
Similar to pr #8453, improving doris source enumerator splits allocation algorithm for subtasks and add UT.
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note
.