Documentation
¶
Index ¶
- Constants
- func AddDuplication(c *Client, tableName string, remoteCluster string, freezed bool) error
- func BackupTable(client *Client, tableID int, providerType string, backupPath string) error
- func ClearAppEnv(c *Client, useTable string) error
- func ClusterInfo(client *Client) error
- func ConfigCommand(client *Client, nodeType session.NodeType, nodeAddr string, name string, ...) error
- func CreateTable(c *Client, tableName string, partitionCount int, replicaCount int) error
- func DelAppEnv(c *Client, useTable string, key string, deletePrefix bool) error
- func DiskBalance(client *Client, replicaServer string, minSize int64, auto bool) error
- func DiskMigrate(client *Client, replicaServer string, pidStr string, from string, to string) error
- func DropTable(c *Client, tableName string, reservePeriod int64) error
- func GetMetaLevel(c *Client) error
- func ListAppEnvs(c *Client, useTable string) error
- func ListNodes(client *Client) error
- func ListTables(client *Client, showDropped bool) error
- func ModifyDuplication(c *Client, tableName string, dupid int, status admin.DuplicationStatus) error
- func QueryBackupStatus(client *Client, tableID int, backupID int64) error
- func QueryDiskInfo(client *Client, infoType DiskInfoType, replicaServer string, tableName string, ...) error
- func QueryDuplication(c *Client, tableName string) error
- func RecallTable(client *Client, originTableID int, newTableName string) error
- func RemoteCommand(c *Client, nodeType session.NodeType, nodeAddr string, cmd string, ...) error
- func RestoreTable(client *Client, oldClusterName string, oldTableName string, oldTableID int, ...) error
- func ServerInfo(c *Client) error
- func SetAppEnv(c *Client, useTable string, key, value string) error
- func SetMetaLevel(c *Client, lvlStr string) error
- func ShowNodesStat(client *Client) error
- func ShowPartitionsStats(client *Client, tableName string) error
- func ShowTablePartitions(client *Client, tableName string) error
- func TableStat(c *Client) error
- func UseTable(client *Client, table string) error
- type Client
- type DiskCapacityStruct
- type DiskInfoType
- type DiskStats
- type MigrateAction
- type MigrateDisk
- type ReplicaCapacityStruct
Constants ¶
const ( WaitRunning = time.Second * 10 // time for wait migrate complete WaitCleaning = time.Second * 90 // time for wait garbage replica to clean complete )
Variables ¶
This section is empty.
Functions ¶
func AddDuplication ¶
AddDuplication command
func BackupTable ¶ added in v1.1.0
func ConfigCommand ¶ added in v1.0.1
func ConfigCommand(client *Client, nodeType session.NodeType, nodeAddr string, name string, actionType string, value int64) error
TODO(jiashuo1) not support update collector config
func CreateTable ¶
CreateTable command
func DiskBalance ¶
auto balance target node disk usage: -1. change the pegasus server disk cleaner internal for clean temp replica to free disk space in time -2. get the optimal migrate action to be ready to balance the disk until can't migrate base latest disk space stats -3. if current replica is `primary` status, force assign the replica to `secondary` status -4. migrate the replica base `getNextMigrateAction` result -5. loop query migrate progress using `DiskMigrate`, it will response `ERR_BUSY` if running -6. start next loop until can't allow to balance the node -7. recover disk cleaner internal if balance complete -8. set meta status to `lively` to balance primary and secondary // TODO(jiashuo1)
func DiskMigrate ¶
func ModifyDuplication ¶
func ModifyDuplication(c *Client, tableName string, dupid int, status admin.DuplicationStatus) error
ModifyDuplication command
func QueryBackupStatus ¶ added in v1.1.0
func QueryDiskInfo ¶
func QueryDiskInfo(client *Client, infoType DiskInfoType, replicaServer string, tableName string, diskTag string) error
QueryDiskInfo command
func QueryDuplication ¶
QueryDuplication command
func RemoteCommand ¶
func RemoteCommand(c *Client, nodeType session.NodeType, nodeAddr string, cmd string, args []string) error
RemoteCommand command.
func RestoreTable ¶ added in v1.1.0
func ShowNodesStat ¶
func ShowPartitionsStats ¶
ShowPartitionsStats is partition-stat command
func ShowTablePartitions ¶
ShowTablePartitions is table-partitions command
Types ¶
type Client ¶
type Client struct {
// Every command should use Client as the fmt.Fprint's writer.
io.Writer
// to access administration APIs
Meta client.Meta
// to obtain perf-counters of ReplicaServers
Perf *aggregate.PerfClient
Nodes *util.PegasusNodeManager
}
Client represents as a manager of various SDKs that can access both Pegasus ReplicaServer and MetaServer.
type DiskCapacityStruct ¶ added in v1.1.0
type DiskInfoType ¶
type DiskInfoType string
const ( CapacitySize DiskInfoType = "CapacitySize" ReplicaCount DiskInfoType = "ReplicaCount" )
type DiskStats ¶ added in v1.1.0
type DiskStats struct {
// contains filtered or unexported fields
}
type MigrateAction ¶ added in v1.1.0
type MigrateAction struct {
// contains filtered or unexported fields
}
type MigrateDisk ¶ added in v1.1.0
type MigrateDisk struct {
// contains filtered or unexported fields
}