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: introduce a newtype for vnode #6513

Merged
merged 13 commits into from
Nov 23, 2022
Merged

refactor: introduce a newtype for vnode #6513

merged 13 commits into from
Nov 23, 2022

Conversation

BugenZhao
Copy link
Member

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

To avoid leaking the logic to the upper layer, and makes specifying a new vnode count easier.

/// `VirtualNode` (a.k.a. VNode) is a minimal partition that a set of keys belong to. It is used for
/// consistent hashing.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Display)]
pub struct VirtualNode(VirtualNodeInner);

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #6513 (a81be6a) into main (bfa8334) will increase coverage by 0.07%.
The diff coverage is 86.95%.

@@            Coverage Diff             @@
##             main    #6513      +/-   ##
==========================================
+ Coverage   73.97%   74.05%   +0.07%     
==========================================
  Files         986      987       +1     
  Lines      161607   161641      +34     
==========================================
+ Hits       119556   119698     +142     
+ Misses      42051    41943     -108     
Flag Coverage Δ
rust 74.05% <86.95%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
src/batch/src/executor/join/local_lookup_join.rs 56.28% <0.00%> (ø)
.../batch/src/task/consistent_hash_shuffle_channel.rs 0.00% <0.00%> (ø)
src/common/src/types/mod.rs 70.70% <ø> (ø)
src/common/src/util/scan_range.rs 76.81% <ø> (ø)
src/common/src/util/worker_util.rs 0.00% <ø> (ø)
...rc/frontend/src/optimizer/property/distribution.rs 67.60% <ø> (ø)
src/frontend/src/scheduler/distributed/stage.rs 19.92% <ø> (ø)
src/frontend/src/scheduler/plan_fragmenter.rs 69.83% <0.00%> (ø)
src/frontend/src/scheduler/worker_node_manager.rs 59.55% <ø> (ø)
src/meta/src/manager/catalog/fragment.rs 32.51% <ø> (ø)
... and 22 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Copy link
Contributor

@xx01cyx xx01cyx left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jon-chuang jon-chuang left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit 75f4caf into main Nov 23, 2022
@mergify mergify bot deleted the bz/vnode-new-type branch November 23, 2022 02:49
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.

5 participants