Documentation
¶
Index ¶
- type Assigner
- type PartitionState
- type ReplicaState
- type ServerState
- type State
- func (s *State) AddJoining(sid uint64, pid uint32)
- func (s State) AddLeaving(sid uint64, pid uint32)
- func (s State) AddPartition(pid uint32)
- func (s State) AddReplica(sid uint64, pid uint32, state ReplicaState)
- func (s State) AddServer(sid uint64)
- func (s State) AddServing(sid uint64, pid uint32)
- func (s State) Clone() *State
- func (s State) GetReplica(sid uint64, pid uint32) *ReplicaState
- func (s State) HasReplica(sid uint64, pid uint32) bool
- func (s State) MaxImbalance() int
- func (s State) PartitionCount() int
- func (s State) RemoveLeaving(sid uint64, pid uint32)
- func (s State) ServerCount() int
- func (s *State) TransitionJoiningToServing(sid uint64, pid uint32)
- func (s State) TransitionServingToLeaving(sid uint64, pid uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assigner ¶
type Assigner struct {
// contains filtered or unexported fields
}
Assigner is the one that assigns partitions to servers.
func NewAssigner ¶
type PartitionState ¶
type PartitionState struct {
Id uint32
Serving map[uint64]bool
Joining map[uint64]bool
Leaving map[uint64]bool
}
func (PartitionState) Clone ¶
func (s PartitionState) Clone() PartitionState
func (PartitionState) JoiningCount ¶
func (s PartitionState) JoiningCount() int
func (PartitionState) ServingCount ¶
func (s PartitionState) ServingCount() int
func (PartitionState) TotalCount ¶
func (s PartitionState) TotalCount() int
type ReplicaState ¶
type ServerState ¶
type ServerState struct {
Id uint64
Serving map[uint32]bool
Joining map[uint32]bool
Leaving map[uint32]bool
}
func (ServerState) Clone ¶
func (s ServerState) Clone() ServerState
func (ServerState) JoiningCount ¶
func (s ServerState) JoiningCount() int
func (ServerState) ServingCount ¶
func (s ServerState) ServingCount() int
func (ServerState) TotalCount ¶
func (s ServerState) TotalCount() int
type State ¶
type State struct {
Serv map[uint64]ServerState
Part map[uint32]PartitionState
Replica map[replicaKey]ReplicaState
Joining int
}
func (*State) AddJoining ¶
func (State) AddLeaving ¶
func (State) AddPartition ¶
func (State) AddReplica ¶
func (s State) AddReplica(sid uint64, pid uint32, state ReplicaState)
func (State) AddServing ¶
func (State) GetReplica ¶
func (s State) GetReplica(sid uint64, pid uint32) *ReplicaState
func (State) MaxImbalance ¶
func (State) PartitionCount ¶
func (State) RemoveLeaving ¶
func (State) ServerCount ¶
func (*State) TransitionJoiningToServing ¶
func (State) TransitionServingToLeaving ¶
Click to show internal directories.
Click to hide internal directories.