Skip to content

Commit

Permalink
add minor docs
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Oct 14, 2024
1 parent cd9ca9f commit e520bc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common/src/hash/consistent_hash/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ impl<T: VnodeMappingItem> VnodeMapping<T> {
}
}

/// Create a vnode mapping with the single item and length of 1. Only for singletons.
/// Create a vnode mapping with the single item and length of 1.
///
/// Should only be used for singletons. If you want a different vnode count, call
/// [`VnodeMapping::new_uniform`] with `std::iter::once(item)` and desired length.
pub fn new_single(item: T::Item) -> Self {
Self::new_uniform(std::iter::once(item), 1)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ impl MigrationTrait for Migration {
)
.await?;

// Fill vnode count with 1 for singleton tables.
manager
.exec_stmt(
UpdateStatement::new()
Expand All @@ -42,6 +43,7 @@ impl MigrationTrait for Migration {
)
.await?;

// Fill vnode count with 1 for singleton fragments.
manager
.exec_stmt(
UpdateStatement::new()
Expand Down

0 comments on commit e520bc6

Please sign in to comment.