Documentation ¶
Index ¶
- Constants
- func NewManager(properties engines.Properties) (engines.DBManager, error)
- type Config
- type Manager
- func (mgr *Manager) Demote(context.Context) error
- func (mgr *Manager) Follow(_ context.Context, cluster *dcs.Cluster) error
- func (mgr *Manager) GetAddrWithMemberName(ctx context.Context, cluster *dcs.Cluster, memberName string) string
- func (mgr *Manager) GetClusterInfo(ctx context.Context, cluster *dcs.Cluster) string
- func (mgr *Manager) GetClusterLocalInfo() (mysql.RowMap, error)
- func (mgr *Manager) GetDBConnWithMember(cluster *dcs.Cluster, member *dcs.Member) (db *sql.DB, err error)
- func (mgr *Manager) GetHealthiestMember(*dcs.Cluster, string) *dcs.Member
- func (mgr *Manager) GetLeaderConn(cluster *dcs.Cluster) (*sql.DB, error)
- func (mgr *Manager) GetLeaderMember(cluster *dcs.Cluster) *dcs.Member
- func (mgr *Manager) GetMemberAddrs(ctx context.Context, cluster *dcs.Cluster) []string
- func (mgr *Manager) GetReplicaRole(ctx context.Context, _ *dcs.Cluster) (string, error)
- func (mgr *Manager) HasOtherHealthyLeader(_ context.Context, cluster *dcs.Cluster) *dcs.Member
- func (mgr *Manager) HasOtherHealthyMembers(ctx context.Context, cluster *dcs.Cluster, leader string) []*dcs.Member
- func (mgr *Manager) InitializeCluster(context.Context, *dcs.Cluster) error
- func (mgr *Manager) InitiateCluster(_ *dcs.Cluster) error
- func (mgr *Manager) IsClusterHealthy(_ context.Context, cluster *dcs.Cluster) bool
- func (mgr *Manager) IsClusterInitialized(ctx context.Context, _ *dcs.Cluster) (bool, error)
- func (mgr *Manager) IsCurrentMemberInCluster(ctx context.Context, cluster *dcs.Cluster) bool
- func (mgr *Manager) IsLeader(ctx context.Context, cluster *dcs.Cluster) (bool, error)
- func (mgr *Manager) IsLeaderMember(_ context.Context, cluster *dcs.Cluster, member *dcs.Member) (bool, error)
- func (mgr *Manager) IsMemberLagging(context.Context, *dcs.Cluster, *dcs.Member) (bool, int64)
- func (mgr *Manager) IsPromoted(ctx context.Context) bool
- func (mgr *Manager) JoinCurrentMemberToCluster(context.Context, *dcs.Cluster) error
- func (mgr *Manager) LeaveMemberFromCluster(ctx context.Context, cluster *dcs.Cluster, memberName string) error
- func (mgr *Manager) Promote(ctx context.Context, cluster *dcs.Cluster) error
- func (mgr *Manager) Recover(context.Context, *dcs.Cluster) error
Constants ¶
View Source
const ( Role = "ROLE" CurrentLeader = "CURRENT_LEADER" Leader = "Leader" )
Variables ¶
This section is empty.
Functions ¶
func NewManager ¶
func NewManager(properties engines.Properties) (engines.DBManager, error)
Types ¶
type Manager ¶
func (*Manager) GetAddrWithMemberName ¶
func (*Manager) GetClusterInfo ¶
func (*Manager) GetClusterLocalInfo ¶
func (*Manager) GetDBConnWithMember ¶
func (mgr *Manager) GetDBConnWithMember(cluster *dcs.Cluster, member *dcs.Member) (db *sql.DB, err error)
GetDBConnWithMember retrieves a database connection for a specific member of a cluster.
func (*Manager) GetHealthiestMember ¶
func (*Manager) GetLeaderConn ¶
GetLeaderConn retrieves a database connection to the leader member of a cluster.
func (*Manager) GetLeaderMember ¶
GetLeaderMember retrieves the leader member of a cluster
func (*Manager) GetMemberAddrs ¶
func (*Manager) GetReplicaRole ¶
func (*Manager) HasOtherHealthyLeader ¶
func (*Manager) HasOtherHealthyMembers ¶
func (mgr *Manager) HasOtherHealthyMembers(ctx context.Context, cluster *dcs.Cluster, leader string) []*dcs.Member
HasOtherHealthyMembers checks if there are any healthy members, excluding the leader
func (*Manager) InitializeCluster ¶
func (*Manager) IsClusterHealthy ¶
func (*Manager) IsClusterInitialized ¶
IsClusterInitialized is a method to check if cluster is initialized or not
func (*Manager) IsCurrentMemberInCluster ¶
func (*Manager) IsLeaderMember ¶
func (*Manager) IsMemberLagging ¶
func (*Manager) JoinCurrentMemberToCluster ¶
func (*Manager) LeaveMemberFromCluster ¶
Click to show internal directories.
Click to hide internal directories.