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

IGNITE-23885 Start partition in a common manner in case of a single element in chain #5012

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Cyrill
Copy link
Contributor

@Cyrill Cyrill commented Jan 9, 2025

* @param revision Revision.
* @return Returns partition assignments from meta storage locally or {@code null} if assignments is absent.
*/
public static @Nullable Assignments stableAssignments(
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's name it with "Locally" suffix, or rename tableAssignmentsChainGetLocally. Let's have common naming pattern for "get locally" methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to *GetLocally

&& (pendingAssignments == null || !pendingAssignments.force());
AssignmentsChain assignmentsChain = assignmentsChains.get(i);

if (assignmentsChain == null || assignmentsChain.chain().size() == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add comment describing why assignmentsChain.chain().size() == 1 is a special case and why we have different behaviour instead

Copy link
Contributor

Choose a reason for hiding this comment

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

I would refactor this check to a separate method so we could reuse this method in the second place

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

* @param revision Revision.
* @return Future with table assignments as a value.
*/
public static List<AssignmentsChain> tableAssignmentsChainGetLocally(
Copy link
Contributor

Choose a reason for hiding this comment

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

Or let's remove locally suffix from here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to *GetLocally

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.

2 participants