risingwave_common::hash::consistent_hash::bitmap

Trait VnodeBitmapExt

source
pub trait VnodeBitmapExt {
    // Required methods
    fn iter_vnodes(&self) -> impl Iterator<Item = VirtualNode> + '_;
    fn iter_vnodes_scalar(&self) -> impl Iterator<Item = i16> + '_;
    fn vnode_ranges(
        &self,
    ) -> impl Iterator<Item = RangeInclusive<VirtualNode>> + '_;
    fn is_singleton(&self) -> bool;
    fn singleton() -> &'static Self;
    fn singleton_arc() -> &'static Arc<Self>;
}
Expand description

An extension trait for Bitmap to support virtual node operations.

Required Methods§

source

fn iter_vnodes(&self) -> impl Iterator<Item = VirtualNode> + '_

Enumerates the virtual nodes set to 1 in the bitmap.

source

fn iter_vnodes_scalar(&self) -> impl Iterator<Item = i16> + '_

Enumerates the virtual nodes set to 1 in the bitmap.

source

fn vnode_ranges(&self) -> impl Iterator<Item = RangeInclusive<VirtualNode>> + '_

Returns an iterator which yields the position ranges of continuous virtual nodes set to 1 in the bitmap.

source

fn is_singleton(&self) -> bool

Returns whether only the SINGLETON_VNODE is set in the bitmap.

source

fn singleton() -> &'static Self

Get the reference to a vnode bitmap for singleton actor or table, i.e., with length 1 and the only SINGLETON_VNODE set to true.

source

fn singleton_arc() -> &'static Arc<Self>

Get the reference to a vnode bitmap for singleton actor or table, i.e., with length 1 and the only SINGLETON_VNODE set to true.

Object Safety§

This trait is not object safe.

Implementors§