Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DowngradeNode ¶ added in v1.0.2
func DowngradeNode(meta Meta, node *util.PegasusNode) error
DowngradeNode sets all secondaries from the specified node to inactive state. NOTE: this step requires that the node has no primary, otherwise error is returned.
func MigratePrimariesOut ¶ added in v1.0.2
func MigratePrimariesOut(meta Meta, node *util.PegasusNode) error
MigratePrimariesOut migrates all primaries out from the specified node. Internally, for every partition it merely swaps the roles of primary and secondary, so it incurs no data migration. Eventually, the node will have no primaries because they are all turned to secondaries.
func SetMetaLevelLively ¶ added in v1.0.2
func SetMetaLevelSteady ¶ added in v1.0.2
func SetRPCTimeout ¶
SetRPCTimeout is the global timeout setting of RPC.
Types ¶
type BalanceType ¶ added in v1.0.2
type BalanceType int
const ( BalanceMovePri BalanceType = iota BalanceCopyPri BalanceCopySec )
func (BalanceType) String ¶ added in v1.0.2
func (t BalanceType) String() string
type Meta ¶
type Meta interface {
Close() error
// ListAvailableApps lists only available tables.
ListAvailableApps() ([]*admin.AppInfo, error)
ListApps(status admin.AppStatus) ([]*admin.AppInfo, error)
QueryConfig(tableName string) (*replication.QueryCfgResponse, error)
MetaControl(level admin.MetaFunctionLevel) (oldLevel admin.MetaFunctionLevel, err error)
QueryClusterInfo() (map[string]string, error)
UpdateAppEnvs(tableName string, envs map[string]string) error
ClearAppEnvs(tableName string, clearPrefix string) error
DelAppEnvs(tableName string, keys []string) error
CreateApp(tableName string, envs map[string]string, partitionCount int) (int32, error)
DropApp(tableName string, reserveSeconds int64) error
ModifyDuplication(tableName string, dupid int, status admin.DuplicationStatus) error
AddDuplication(tableName string, remoteCluster string, freezed bool) (*admin.DuplicationAddResponse, error)
QueryDuplication(tableName string) (*admin.DuplicationQueryResponse, error)
ListNodes() ([]*admin.NodeInfo, error)
RecallApp(originTableID int, newTableName string) (*admin.AppInfo, error)
Balance(gpid *base.Gpid, opType BalanceType, from *util.PegasusNode, to *util.PegasusNode) error
Propose(gpid *base.Gpid, action admin.ConfigType, target *util.PegasusNode, node *util.PegasusNode) error
}
Meta is a helper over pegasus-go-client's primitive session.MetaManager. It aims to provide an easy-to-use API that eliminates some boilerplate code, like context creation, request/response creation, etc.
func NewRPCBasedMeta ¶
NewRPCBasedMeta creates the connection to meta.
type TableHealthInfo ¶ added in v1.0.2
type TableHealthInfo struct {
PartitionCount int32
Unhealthy int32
WriteUnhealthy int32
ReadUnhealthy int32
FullHealthy int32
}
TableHealthInfo is a report of replica health within the table.
func GetTableHealthInfo ¶ added in v1.0.2
func GetTableHealthInfo(meta Meta, tableName string) (*TableHealthInfo, error)
GetTableHealthInfo return *TableHealthInfo from meta.