MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / bucket_to_vshard

Function bucket_to_vshard

nodedb-cluster/src/distributed_array/routing.rs:118–121  ·  view source on GitHub ↗

Map a bucket index to the primary vShard in that bucket's range.

(bucket: u32, prefix_bits: u8)

Source from the content-addressed store, hash-verified

116
117/// Map a bucket index to the primary vShard in that bucket's range.
118fn bucket_to_vshard(bucket: u32, prefix_bits: u8) -> u32 {
119 let stride = vshard_stride(prefix_bits);
120 bucket.saturating_mul(stride)
121}
122
123/// Number of vShards per Hilbert bucket.
124///

Callers 2

array_vshard_for_tileFunction · 0.85
array_vshards_for_sliceFunction · 0.85

Calls 1

vshard_strideFunction · 0.85

Tested by

no test coverage detected