component

package
v0.6.0-beta.33 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSQLChannelProc

func GetSQLChannelProc() (*os.Process, error)

func MaxInt64

func MaxInt64(x, y int64) int64

func RegisterManager

func RegisterManager(characterType string, manager DBManager)

Types

type DBManager

type DBManager interface {
	IsRunning() bool

	IsDBStartupReady() bool

	// Functions related to cluster initialization.
	InitializeCluster(context.Context, *dcs.Cluster) error
	IsClusterInitialized(context.Context, *dcs.Cluster) (bool, error)
	IsCurrentMemberInCluster(context.Context, *dcs.Cluster) bool

	// Functions related to cluster healthy check.
	IsCurrentMemberHealthy(context.Context) bool
	IsClusterHealthy(context.Context, *dcs.Cluster) bool

	// Member healthy check
	IsMemberHealthy(context.Context, *dcs.Cluster, *dcs.Member) bool
	HasOtherHealthyLeader(context.Context, *dcs.Cluster) *dcs.Member
	HasOtherHealthyMembers(context.Context, *dcs.Cluster, string) []*dcs.Member

	// Functions related to member check.
	IsLeader(context.Context, *dcs.Cluster) (bool, error)
	IsLeaderMember(context.Context, *dcs.Cluster, *dcs.Member) (bool, error)
	IsFirstMember() bool

	AddCurrentMemberToCluster(*dcs.Cluster) error
	DeleteMemberFromCluster(*dcs.Cluster, string) error

	// Functions related to HA
	Promote() error
	Demote() error
	Follow(*dcs.Cluster) error
	Recover()

	GetHealthiestMember(*dcs.Cluster, string) *dcs.Member

	GetCurrentMemberName() string
	GetMemberAddrs(*dcs.Cluster) []string

	// Functions related to account manage
	IsRootCreated(context.Context) (bool, error)
	CreateRoot(context.Context) error

	// Readonly lock for disk full
	Lock(context.Context, string) error
	Unlock(context.Context) error

	GetLogger() logger.Logger
}

func GetDefaultManager

func GetDefaultManager() (DBManager, error)

func GetManager

func GetManager(characterType string) DBManager

type DBManagerBase

type DBManagerBase struct {
	CurrentMemberName string
	ClusterCompName   string
	Namespace         string
	DataDir           string
	Logger            logger.Logger
	DBStartupReady    bool
}

func (*DBManagerBase) GetCurrentMemberName

func (mgr *DBManagerBase) GetCurrentMemberName() string

func (*DBManagerBase) GetLogger

func (mgr *DBManagerBase) GetLogger() logger.Logger

func (*DBManagerBase) IsDBStartupReady

func (mgr *DBManagerBase) IsDBStartupReady() bool

func (*DBManagerBase) IsFirstMember

func (mgr *DBManagerBase) IsFirstMember() bool

type FakeManager

type FakeManager struct {
	DBManagerBase
}

func (*FakeManager) AddCurrentMemberToCluster

func (*FakeManager) AddCurrentMemberToCluster(*dcs.Cluster) error

func (*FakeManager) CreateRoot

func (*FakeManager) CreateRoot(context.Context) error

func (*FakeManager) DeleteMemberFromCluster

func (*FakeManager) DeleteMemberFromCluster(*dcs.Cluster, string) error

func (*FakeManager) Demote

func (*FakeManager) Demote() error

func (*FakeManager) Follow

func (*FakeManager) Follow(*dcs.Cluster) error

func (*FakeManager) GetHealthiestMember

func (*FakeManager) GetHealthiestMember(*dcs.Cluster, string) *dcs.Member

func (*FakeManager) GetMemberAddrs

func (*FakeManager) GetMemberAddrs(*dcs.Cluster) []string

func (*FakeManager) HasOtherHealthyLeader

func (*FakeManager) HasOtherHealthyLeader(context.Context, *dcs.Cluster) *dcs.Member

func (*FakeManager) HasOtherHealthyMembers

func (*FakeManager) HasOtherHealthyMembers(context.Context, *dcs.Cluster, string) []*dcs.Member

func (*FakeManager) InitializeCluster

func (*FakeManager) InitializeCluster(context.Context, *dcs.Cluster) error

func (*FakeManager) IsClusterHealthy

func (*FakeManager) IsClusterHealthy(context.Context, *dcs.Cluster) bool

func (*FakeManager) IsClusterInitialized

func (*FakeManager) IsClusterInitialized(context.Context, *dcs.Cluster) (bool, error)

func (*FakeManager) IsCurrentMemberHealthy

func (*FakeManager) IsCurrentMemberHealthy(context.Context) bool

func (*FakeManager) IsCurrentMemberInCluster

func (*FakeManager) IsCurrentMemberInCluster(context.Context, *dcs.Cluster) bool

func (*FakeManager) IsDBStartupReady

func (*FakeManager) IsDBStartupReady() bool

func (*FakeManager) IsFirstMember

func (*FakeManager) IsFirstMember() bool

func (*FakeManager) IsLeader

func (*FakeManager) IsLeader(context.Context, *dcs.Cluster) (bool, error)

func (*FakeManager) IsLeaderMember

func (*FakeManager) IsLeaderMember(context.Context, *dcs.Cluster, *dcs.Member) (bool, error)

func (*FakeManager) IsMemberHealthy

func (*FakeManager) IsMemberHealthy(context.Context, *dcs.Cluster, *dcs.Member) bool

func (*FakeManager) IsRootCreated

func (*FakeManager) IsRootCreated(context.Context) (bool, error)

func (*FakeManager) IsRunning

func (*FakeManager) IsRunning() bool

func (*FakeManager) Lock

func (*FakeManager) Promote

func (*FakeManager) Promote() error

func (*FakeManager) Recover

func (*FakeManager) Recover()

func (*FakeManager) Unlock

func (*FakeManager) Unlock(context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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