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

ADBDEV-6065: Improve logic of fragment distribution #117

Open
wants to merge 11 commits into
base: pxf-6.x
Choose a base branch
from

Conversation

RomaZe
Copy link
Member

@RomaZe RomaZe commented Aug 8, 2024

  • Refactor fragmenter service;
  • Add strategies for fragment distribution;
  • Add improved-round-robin strategy;
  • Add unit tests

RomaZe added 2 commits August 8, 2024 21:40
- Refactor fragmenter service;
- Add strategies for fragment distribution
- Add `improved-round-robin` strategy
Base automatically changed from feature/ADBDEV-6082 to pxf-6.x August 13, 2024 09:21
iamlapa
iamlapa previously approved these changes Aug 14, 2024
int shiftedIndex = context.getGpSessionId() % context.getTotalSegments() + context.getGpCommandCount();
List<Fragment> filteredFragments = new ArrayList<>((int) Math.ceil((double) fragments.size() / context.getTotalSegments()));
for (Fragment fragment : fragments) {
if (context.getSegmentId() == (shiftedIndex % context.getTotalSegments())) {

Choose a reason for hiding this comment

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

Why do we get mod twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see that we take the same mod twice. If you mean that the first is int shiftedIndex = context.getGpSessionId() % context.getTotalSegments() + context.getGpCommandCount and the second is shiftedIndex % context.getTotalSegments():
The first one is responsible for the shifting taking into account command count and the second one is responsible for getting segment for the fragment.

xardazzzzzz
xardazzzzzz previously approved these changes Sep 12, 2024
# Conflicts:
#	automation/src/test/java/org/greenplum/pxf/automation/arenadata/FragmentDistributionTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants