-
Notifications
You must be signed in to change notification settings - Fork 594
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
refactor(meta): unify code for different kinds of source change #19991
Merged
xxchan
merged 2 commits into
main
from
01-02-refactor_unify_code_for_different_kinds_of_source_change
Jan 3, 2025
Merged
refactor(meta): unify code for different kinds of source change #19991
xxchan
merged 2 commits into
main
from
01-02-refactor_unify_code_for_different_kinds_of_source_change
Jan 3, 2025
+229
−169
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 tasks
This stack of pull requests is managed by Graphite. Learn more about stacking. |
xxchan
force-pushed
the
xxchan/collective-gazelle
branch
from
January 2, 2025 07:57
dc46eac
to
340d80c
Compare
xxchan
force-pushed
the
01-02-refactor_unify_code_for_different_kinds_of_source_change
branch
3 times, most recently
from
January 2, 2025 09:13
478f935
to
ff48e40
Compare
xxchan
changed the title
refactor: unify code for different kinds of source change
refactor(meta): unify code for different kinds of source change
Jan 2, 2025
BugenZhao
approved these changes
Jan 3, 2025
@@ -166,7 +167,7 @@ impl CommandContext { | |||
.await?; | |||
barrier_manager_context | |||
.source_manager | |||
.apply_source_change(None, None, Some(split_assignment.clone()), None, None) |
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.
Wow, five Option
seems really unreadable.
.append(&mut fragment_ids); | ||
/// Updates states after all kinds of source change. | ||
pub fn apply_source_change(&mut self, source_change: SourceChange) { | ||
let mut added_source_fragments = Default::default(); |
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.
Such boilerplate 😄
xxchan
force-pushed
the
01-02-refactor_unify_code_for_different_kinds_of_source_change
branch
from
January 3, 2025 03:02
ff48e40
to
a2a3cb3
Compare
xxchan
deleted the
01-02-refactor_unify_code_for_different_kinds_of_source_change
branch
January 3, 2025 03:42
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Previously, we have multiple code paths for different kinds of source changes: e.g.,
unregister_source
,drop_source_fragments
, andapply_source_change
. Actually they have some overlap, and some missing cleanup tasks forgotten to do.Since what they did is really similar: update states after some operations, in this PR, I try to merge them in to one func call, and dispatch by
enum
variant. This makes it easier for caller to choose what to call, and can help maintain consistency in the cleanup impl.Prepare for #18416
Checklist
Documentation
Release note