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

refactor(meta): destruct create mv ctx in parameter site #2080

Merged
merged 3 commits into from
Apr 24, 2022
Merged

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Apr 24, 2022

What's changed and what's your intention?

because ctx is consumed (thus splitted) here. (And in my opinion the large struct should not be passed later)

In this way we can see clearer what is used/mutated

Checklist

  • [ ] I have written necessary docs and comments
  • [ ] I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

@xxchan xxchan enabled auto-merge (squash) April 24, 2022 06:29
@xxchan xxchan disabled auto-merge April 24, 2022 06:42
@xxchan xxchan requested a review from skyzh April 24, 2022 06:42
Copy link
Contributor

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

What about defining the CreateMaterializedViewContext with &mut X inside? I think in this way, we can also know mutable / immutable, while not having to much parameters?

@xxchan
Copy link
Member Author

xxchan commented Apr 24, 2022

&mut field doesn't work because then we will have to move ctx into resolve_chain_node.

Actually only resolve_chain_node needs to pass ctx (used 4/9 of its fields, 2 mutable). Maybe we can refactor the logic of chain later

@xxchan xxchan enabled auto-merge (squash) April 24, 2022 07:29
@xxchan xxchan disabled auto-merge April 24, 2022 07:32
@codecov
Copy link

codecov bot commented Apr 24, 2022

Codecov Report

Merging #2080 (9ee2582) into main (3b06cfd) will increase coverage by 0.02%.
The diff coverage is 67.39%.

@@            Coverage Diff             @@
##             main    #2080      +/-   ##
==========================================
+ Coverage   71.04%   71.06%   +0.02%     
==========================================
  Files         635      635              
  Lines       81620    81644      +24     
==========================================
+ Hits        57984    58020      +36     
+ Misses      23636    23624      -12     
Flag Coverage Δ
rust 71.06% <67.39%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
src/meta/src/stream/stream_manager.rs 61.04% <67.39%> (+0.53%) ⬆️
src/storage/src/hummock/local_version_manager.rs 86.48% <0.00%> (+4.72%) ⬆️
src/meta/src/hummock/mock_hummock_meta_client.rs 52.00% <0.00%> (+5.33%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@xxchan xxchan enabled auto-merge (squash) April 24, 2022 07:40
@xxchan xxchan merged commit fa6d224 into main Apr 24, 2022
@xxchan xxchan deleted the xxchan/meta branch April 24, 2022 07:43
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.

None yet

2 participants