Documentation ¶
Index ¶
- func GetSQLChannelProc() (*os.Process, error)
- func MaxInt64(x, y int64) int64
- func RegisterManager(characterType string, manager DBManager)
- type DBManager
- type DBManagerBase
- type FakeManager
- func (*FakeManager) AddCurrentMemberToCluster(*dcs.Cluster) error
- func (*FakeManager) CreateRoot(context.Context) error
- func (*FakeManager) DeleteMemberFromCluster(*dcs.Cluster, string) error
- func (*FakeManager) Demote() error
- func (*FakeManager) Follow(*dcs.Cluster) error
- func (*FakeManager) GetHealthiestMember(*dcs.Cluster, string) *dcs.Member
- func (*FakeManager) GetMemberAddrs(*dcs.Cluster) []string
- func (*FakeManager) HasOtherHealthyLeader(context.Context, *dcs.Cluster) *dcs.Member
- func (*FakeManager) HasOtherHealthyMembers(context.Context, *dcs.Cluster, string) []*dcs.Member
- func (*FakeManager) InitializeCluster(context.Context, *dcs.Cluster) error
- func (*FakeManager) IsClusterHealthy(context.Context, *dcs.Cluster) bool
- func (*FakeManager) IsClusterInitialized(context.Context, *dcs.Cluster) (bool, error)
- func (*FakeManager) IsCurrentMemberHealthy(context.Context) bool
- func (*FakeManager) IsCurrentMemberInCluster(context.Context, *dcs.Cluster) bool
- func (*FakeManager) IsDBStartupReady() bool
- func (*FakeManager) IsFirstMember() bool
- func (*FakeManager) IsLeader(context.Context, *dcs.Cluster) (bool, error)
- func (*FakeManager) IsLeaderMember(context.Context, *dcs.Cluster, *dcs.Member) (bool, error)
- func (*FakeManager) IsMemberHealthy(context.Context, *dcs.Cluster, *dcs.Member) bool
- func (*FakeManager) IsRootCreated(context.Context) (bool, error)
- func (*FakeManager) IsRunning() bool
- func (*FakeManager) Lock(context.Context, string) error
- func (*FakeManager) Promote() error
- func (*FakeManager) Recover()
- func (*FakeManager) Unlock(context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSQLChannelProc ¶
func RegisterManager ¶
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 GetManager ¶
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) GetHealthiestMember ¶
func (*FakeManager) GetMemberAddrs ¶
func (*FakeManager) GetMemberAddrs(*dcs.Cluster) []string
func (*FakeManager) HasOtherHealthyLeader ¶
func (*FakeManager) HasOtherHealthyMembers ¶
func (*FakeManager) InitializeCluster ¶
func (*FakeManager) IsClusterHealthy ¶
func (*FakeManager) IsClusterInitialized ¶
func (*FakeManager) IsCurrentMemberHealthy ¶
func (*FakeManager) IsCurrentMemberHealthy(context.Context) bool
func (*FakeManager) IsCurrentMemberInCluster ¶
func (*FakeManager) IsDBStartupReady ¶
func (*FakeManager) IsDBStartupReady() bool
func (*FakeManager) IsFirstMember ¶
func (*FakeManager) IsFirstMember() bool
func (*FakeManager) IsLeaderMember ¶
func (*FakeManager) IsMemberHealthy ¶
func (*FakeManager) IsRootCreated ¶
func (*FakeManager) IsRootCreated(context.Context) (bool, error)
func (*FakeManager) IsRunning ¶
func (*FakeManager) IsRunning() bool
func (*FakeManager) Promote ¶
func (*FakeManager) Promote() error
func (*FakeManager) Recover ¶
func (*FakeManager) Recover()
Click to show internal directories.
Click to hide internal directories.