oceanbase

package
v0.9.3-beta.11 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Role          = "ROLE"
	CurrentLeader = "CURRENT_LEADER"
	PRIMARY       = "PRIMARY"
	STANDBY       = "STANDBY"

	MYSQL  = "MYSQL"
	ORACLE = "ORACLE"
)

Variables

This section is empty.

Functions

func NewCommands

func NewCommands() engines.ClusterCommands

func NewManager

func NewManager(properties engines.Properties) (engines.DBManager, error)

Types

type Commands

type Commands struct {
	// contains filtered or unexported fields
}

func (*Commands) ConnectCommand

func (r *Commands) ConnectCommand(connectInfo *engines.AuthInfo) []string

func (*Commands) ConnectExample

func (r *Commands) ConnectExample(info *engines.ConnectionInfo, client string) string

func (*Commands) Container

func (r *Commands) Container() string

func (*Commands) ExecuteCommand

func (r *Commands) ExecuteCommand(scripts []string) ([]string, []corev1.EnvVar, error)

type Config

type Config struct {
	*mysqlengine.Config
}

func NewConfig

func NewConfig(properties map[string]string) (*Config, error)

func (*Config) GetMemberRootDBConn added in v0.8.4

func (config *Config) GetMemberRootDBConn(cluster *dcs.Cluster, member *dcs.Member) (*sql.DB, error)

type Manager

type Manager struct {
	mysql.Manager
	ReplicaTenant     string
	CompatibilityMode string
	Members           []dcs.Member
	MaxLag            int64
}

func (*Manager) CurrentMemberHealthyCheck added in v0.8.4

func (mgr *Manager) CurrentMemberHealthyCheck(ctx context.Context, cluster *dcs.Cluster) error

func (*Manager) Demote added in v0.8.4

func (mgr *Manager) Demote(ctx context.Context) error

func (*Manager) Follow added in v0.8.4

func (mgr *Manager) Follow(ctx context.Context, cluster *dcs.Cluster) error

func (*Manager) GetCompatibilityMode added in v0.8.4

func (mgr *Manager) GetCompatibilityMode(ctx context.Context) (string, error)

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) GetDBState added in v0.8.4

func (mgr *Manager) GetDBState(ctx context.Context, cluster *dcs.Cluster) *dcs.DBState

func (*Manager) GetMemberOpTimestamp added in v0.8.4

func (mgr *Manager) GetMemberOpTimestamp(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) (int64, error)

func (*Manager) GetMySQLDBConn added in v0.8.4

func (mgr *Manager) GetMySQLDBConn() (*sql.DB, error)

func (*Manager) GetMySQLDBConnWithAddr added in v0.8.4

func (mgr *Manager) GetMySQLDBConnWithAddr(addr string) (*sql.DB, error)

func (*Manager) GetReplicaRole

func (mgr *Manager) GetReplicaRole(ctx context.Context, cluster *dcs.Cluster) (string, error)

func (*Manager) GetReplicaRoleForMember added in v0.8.4

func (mgr *Manager) GetReplicaRoleForMember(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) (string, error)

func (*Manager) HasOtherHealthyLeader added in v0.8.4

func (mgr *Manager) HasOtherHealthyLeader(ctx context.Context, cluster *dcs.Cluster) *dcs.Member

func (*Manager) HealthyCheckForMySQLMode added in v0.8.4

func (mgr *Manager) HealthyCheckForMySQLMode(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) error

func (*Manager) HealthyCheckForOracleMode added in v0.8.4

func (mgr *Manager) HealthyCheckForOracleMode(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) error

func (*Manager) InitializeCluster

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

func (*Manager) IsClusterInitialized added in v0.8.4

func (mgr *Manager) IsClusterInitialized(ctx context.Context, cluster *dcs.Cluster) (bool, error)

func (*Manager) IsCurrentMemberHealthy added in v0.8.4

func (mgr *Manager) IsCurrentMemberHealthy(ctx context.Context, cluster *dcs.Cluster) bool

func (*Manager) IsLeader

func (mgr *Manager) IsLeader(ctx context.Context, cluster *dcs.Cluster) (bool, error)

func (*Manager) IsLeaderMember added in v0.8.4

func (mgr *Manager) IsLeaderMember(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) (bool, error)

func (*Manager) IsMemberHealthy added in v0.8.4

func (mgr *Manager) IsMemberHealthy(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) bool

func (*Manager) IsMemberLagging added in v0.8.4

func (mgr *Manager) IsMemberLagging(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) (bool, int64)

func (*Manager) LeaderHealthyCheck added in v0.8.4

func (mgr *Manager) LeaderHealthyCheck(ctx context.Context, cluster *dcs.Cluster) error

func (*Manager) MemberHealthyCheck added in v0.8.4

func (mgr *Manager) MemberHealthyCheck(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) error

func (*Manager) Promote added in v0.8.4

func (mgr *Manager) Promote(ctx context.Context, cluster *dcs.Cluster) error

func (*Manager) WriteCheck added in v0.8.4

func (mgr *Manager) WriteCheck(ctx context.Context, db *sql.DB) error

Jump to

Keyboard shortcuts

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