Documentation ¶
Index ¶
- Constants
- func MustNewTopologyMap(replicas int, assignment map[string][]shard.Shard) topology.Map
- func NewStateSnapshot(numMajorityReplicas int, hostShardStates HostShardStates) *topology.StateSnapshot
- func Shards(ids []uint32, s shard.State) []shard.Shard
- func ShardsRange(from, to uint32, s shard.State) []shard.Shard
- func Uint32Range(from, to uint32) []uint32
- type HostShardStates
- type TopologyView
Constants ¶
View Source
const (
// SelfID is the string used to represent the ID of the origin node.
SelfID = "self"
)
Variables ¶
This section is empty.
Functions ¶
func MustNewTopologyMap ¶
MustNewTopologyMap returns a new topology.Map with provided parameters. It's a utility method to make tests easier to write.
func NewStateSnapshot ¶ added in v0.4.4
func NewStateSnapshot(numMajorityReplicas int, hostShardStates HostShardStates) *topology.StateSnapshot
NewStateSnapshot creates a new initial topology state snapshot using HostShardStates as input.
func ShardsRange ¶
ShardsRange returns a slice of shards for all ids between [from, to], with shard state `s`.
func Uint32Range ¶
Uint32Range returns a slice of all values between [from, to].
Types ¶
type HostShardStates ¶ added in v0.4.4
HostShardStates is a human-readable way of describing an initial state topology on a host-by-host basis.
type TopologyView ¶
type TopologyView struct { HashFn sharding.HashFn Replicas int Assignment map[string][]shard.Shard }
TopologyView represents a snaphshot view of a topology.Map.
func NewTopologyView ¶
func NewTopologyView( replicas int, assignment map[string][]shard.Shard, ) TopologyView
NewTopologyView returns a new TopologyView with provided parameters. It's a utility method to make tests easier to write.
Click to show internal directories.
Click to hide internal directories.