hakeeper

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package hakeeper implements MO's hakeeper component.

Index

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 GetCNStoreHeartbeatCmd(data []byte) []byte

func GetDNStoreHeartbeatCmd

func GetDNStoreHeartbeatCmd(data []byte) []byte

func GetGetIDCmd

func GetGetIDCmd(count uint64) []byte

func GetInitialClusterRequestCmd

func GetInitialClusterRequestCmd(numOfLogShards uint64,
	numOfDNShards uint64, numOfLogReplicas uint64) []byte

func GetLogStoreHeartbeatCmd

func GetLogStoreHeartbeatCmd(data []byte) []byte

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 IDAllocator interface {
	// Next returns a new ID that can be used as the replica ID of a DN shard or
	// Log shard. When the return boolean value is false, it means no more ID
	// can be allocated at this time.
	Next() (uint64, bool)
	Set(first uint64, last uint64)
	Capacity() uint64
}

type ScheduleCommandQuery

type ScheduleCommandQuery struct{ UUID string }

type StateQuery

type StateQuery struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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