-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: pxf-6.x
Are you sure you want to change the base?
Conversation
- Refactor fragmenter service; - Add strategies for fragment distribution - Add `improved-round-robin` strategy
# Conflicts: # automation/pom.xml
# Conflicts: # automation/pom.xml
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())) { |
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.
Why do we get mod twice?
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 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.
# Conflicts: # automation/src/test/java/org/greenplum/pxf/automation/arenadata/FragmentDistributionTest.java
improved-round-robin
strategy;