sharding

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 4 Imported by: 3

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