Skip to content
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

Re-implement DistinctCombineOperator to utilize more threads to merge #14714

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jackie-Jiang
Copy link
Contributor

On top of #14701

The combine algorithm is as following:

Use an atomic reference as the swap space to merge the results blocks.

  • If the swap space is null, put the new results block in it.
  • If the swap space is not null, take the results block from the swap space, and merge it with the new results block.

Repeat this process until successfully put the new results block in the swap space.
After all threads are done, the results block in the swap space is the final merged results block.

@codecov-commenter
Copy link

codecov-commenter commented Dec 25, 2024

Codecov Report

Attention: Patch coverage is 69.81132% with 16 lines in your changes missing coverage. Please review.

Project coverage is 63.89%. Comparing base (59551e4) to head (10410e4).
Report is 1512 commits behind head on master.

Files with missing lines Patch % Lines
...core/operator/combine/DistinctCombineOperator.java 69.81% 11 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14714      +/-   ##
============================================
+ Coverage     61.75%   63.89%   +2.14%     
- Complexity      207     1609    +1402     
============================================
  Files          2436     2703     +267     
  Lines        133233   150729   +17496     
  Branches      20636    23282    +2646     
============================================
+ Hits          82274    96308   +14034     
- Misses        44911    47228    +2317     
- Partials       6048     7193    +1145     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.77% <69.81%> (+2.06%) ⬆️
java-21 63.74% <69.81%> (+2.11%) ⬆️
skip-bytebuffers-false 63.84% <69.81%> (+2.09%) ⬆️
skip-bytebuffers-true 63.70% <69.81%> (+35.98%) ⬆️
temurin 63.89% <69.81%> (+2.14%) ⬆️
unittests 63.89% <69.81%> (+2.14%) ⬆️
unittests1 56.24% <69.81%> (+9.35%) ⬆️
unittests2 34.23% <0.00%> (+6.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// Use the atomic reference as the swap space to merge the results blocks. If the swap space is null, put the new
// results block in it. If the swap space is not null, take the results block from the swap space, and merge it
// with the new results block. Repeat this process until successfully put the new results block in the swap space.
// After all threads are done, the results block in the swap space is the final merged results block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how does this help utilize more threads. Can you elaborate ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows all threads to perform the merge. In the old algorithm, the merge is done by a single thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants