sharding

package
v1.1.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2023 License: GPL-3.0 Imports: 4 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidNumberOfShards = errors.New("the number of shards must be greater than zero")

ErrInvalidNumberOfShards signals that an invalid number of shards was passed to the sharding registry

View Source
var ErrInvalidShardId = errors.New("shard id must be smaller than the total number of shards")

ErrInvalidShardId signals that an invalid shard is was passed

Functions

func ComputeShardID

func ComputeShardID(address []byte, numberOfShards uint32) uint32

ComputeShardID will compute shard id of the given address based on the number of shards parameter

func NewMultiShardCoordinator

func NewMultiShardCoordinator(numberOfShards, selfId uint32) (*multiShardCoordinator, error)

NewMultiShardCoordinator returns a new multiShardCoordinator and initializes the masks

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL