Documentation ¶
Overview ¶
Package hakeeper implements MO's hakeeper component.
Index ¶
- Constants
- func GetCNStoreHeartbeatCmd(data []byte) []byte
- func GetDNStoreHeartbeatCmd(data []byte) []byte
- func GetGetIDCmd(count uint64) []byte
- func GetInitialClusterRequestCmd(numOfLogShards uint64, numOfDNShards uint64, numOfLogReplicas uint64) []byte
- func GetLogStoreHeartbeatCmd(data []byte) []byte
- func GetSetStateCmd(state pb.HAKeeperState) []byte
- func GetTickCmd() []byte
- func GetUpdateCommandsCmd(term uint64, cmds []pb.ScheduleCommand) []byte
- func NewStateMachine(shardID uint64, replicaID uint64) sm.IStateMachine
- type BootstrapManager
- type Checker
- type ClusterDetailsQuery
- type IDAllocator
- type ScheduleCommandQuery
- type StateQuery
Constants ¶
View Source
const ( // When bootstrapping, k8s will first bootstrap the HAKeeper by starting some // Log stores with command line options specifying that those stores will be hosting // a HAKeeper replicas. It will be k8s' responsibility to assign Replica IDs to those // HAKeeper replicas, and those IDs will have to be assigned from the range // [K8SIDRangeStart, K8SIDRangeEnd) K8SIDRangeStart uint64 = 131072 K8SIDRangeEnd uint64 = 262144 // TickDuration defines the frequency of ticks. TickDuration = time.Second // CheckDuration defines how often HAKeeper checks the health state of the cluster CheckDuration = time.Second // DefaultHAKeeperShardID is the shard ID assigned to the special HAKeeper // shard. DefaultHAKeeperShardID uint64 = 0 )
Variables ¶
This section is empty.
Functions ¶
func GetCNStoreHeartbeatCmd ¶
func GetDNStoreHeartbeatCmd ¶
func GetGetIDCmd ¶
func GetLogStoreHeartbeatCmd ¶
func GetSetStateCmd ¶
func GetSetStateCmd(state pb.HAKeeperState) []byte
func GetTickCmd ¶
func GetTickCmd() []byte
func GetUpdateCommandsCmd ¶
func GetUpdateCommandsCmd(term uint64, cmds []pb.ScheduleCommand) []byte
func NewStateMachine ¶
func NewStateMachine(shardID uint64, replicaID uint64) sm.IStateMachine
Types ¶
type BootstrapManager ¶
type BootstrapManager interface { Bootstrap(util.IDAllocator, pb.DNState, pb.LogState) ([]pb.ScheduleCommand, error) CheckBootstrap(pb.LogState) bool }
BootstrapManager is the interface suppose to be implemented by HAKeeper's bootstrap manager.
type Checker ¶
type Checker interface { // Check is periodically called by the HAKeeper for checking the cluster // health status, a list of Operator instances will be returned describing // actions required to ensure the high availability of the cluster. Check(alloc util.IDAllocator, cluster pb.ClusterInfo, dn pb.DNState, log pb.LogState, currentTick uint64) []pb.ScheduleCommand }
Checker is the interface suppose to be implemented by HAKeeper's coordinator. Checker is supposed to be stateless - Checker is free to maintain whatever internal states, but those states should never be assumed to be persistent across reboots.
type ClusterDetailsQuery ¶ added in v0.5.1
type ClusterDetailsQuery struct{}
type IDAllocator ¶
type ScheduleCommandQuery ¶
type ScheduleCommandQuery struct{ UUID string }
type StateQuery ¶
type StateQuery struct{}
Click to show internal directories.
Click to hide internal directories.