Documentation ¶
Index ¶
- Variables
- func AddDisk(client *Client, replicaServer string, diskStr string) error
- func AddDuplication(c *Client, tableName string, remoteCluster string, freezed bool) error
- func BackupTable(client *Client, tableID int, providerType string, backupPath string) error
- func CancelBulkLoad(client *Client, tableName string, forced bool) error
- func CancelPartitionSplit(client *Client, tableName string, oldPartitionCount int) 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, interval int, auto bool) error
- func DiskBeforeSplit(client *Client, tableName string) error
- func DiskMigrate(client *Client, replicaServer string, pidStr string, from string, to string) error
- func DropTable(c *Client, tableName string, reservePeriod int64) error
- func GetAppEnv(c *Client, useTable string, envName string) (string, 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 PauseBulkLoad(client *Client, tableName string) error
- func PausePartitionSplit(client *Client, tableName string, parentPidx int) error
- func PrintAllCleanupFlag(client *Client, resp *admin.QueryBulkLoadResponse, detailed bool)
- func PrintAllDownloading(client *Client, resp *admin.QueryBulkLoadResponse, detailed bool)
- func PrintAllOthers(client *Client, resp *admin.QueryBulkLoadResponse, detailed bool)
- func PrintAllSummary(client *Client, tableName string, tableStatus admin.BulkLoadStatus)
- func PrintSingleCleanupFlag(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, ...)
- func PrintSingleDownloading(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, ...)
- func PrintSingleIngesting(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, ...)
- func PrintSinglePausing(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, ...)
- func PrintSingleSummary(client *Client, tableName string, pidx int32, ...)
- func QueryAllNodesDiskInfo(client *Client, tableName string) (map[string]*radmin.QueryDiskInfoResponse, error)
- func QueryBackupStatus(client *Client, tableID int, backupID int64) error
- func QueryBulkLoad(client *Client, tableName string, partitionIndex int, detailed bool) error
- func QueryDiskInfo(client *Client, infoType DiskInfoType, replicaServer string, tableName string, ...) error
- func QueryDuplication(c *Client, tableName string) error
- func QueryManualCompaction(client *Client, tableName string) error
- func QuerySplitStatus(client *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 RestartBulkLoad(client *Client, tableName string) error
- func RestartPartitionSplit(client *Client, tableName string, parentPidx int) 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 SetCompaction(client *Client, tableName string, params *CompactionParams) error
- func SetMetaLevel(c *Client, lvlStr string) error
- func ShowNodesStat(client *Client) error
- func ShowPartitionCount(client *Client, tableName string) error
- func ShowPartitionsStats(client *Client, tableName string) error
- func ShowTablePartitions(client *Client, tableName string) error
- func StartBulkLoad(client *Client, tableName string, clusterName string, providerType string, ...) error
- func StartManualCompaction(client *Client, tableName string, targetLevel int, maxRunningCount int, ...) error
- func StartPartitionSplit(client *Client, tableName string, newPartitionCount int) error
- func TableStat(c *Client) error
- func UseTable(client *Client, table string) error
- type Client
- type CompactionParams
- type DiskCapacityStruct
- type DiskInfoType
- type DiskStats
- type MigrateAction
- type MigrateDisk
- type NodeDiskStats
- type PartitionStruct
- type ReplicaCapacityStruct
Constants ¶
This section is empty.
Variables ¶
var WaitCleaning = time.Second * 90 // time for wait garbage replica to clean complete
var WaitRunning = time.Second * 10 // time for wait migrate complete
Functions ¶
func AddDuplication ¶
AddDuplication command
func BackupTable ¶
func CancelPartitionSplit ¶
func ConfigCommand ¶
func ConfigCommand(client *Client, nodeType session.NodeType, nodeAddr string, name string, actionType string, value string) error
TODO(jiashuo1) not support update collector config
func CreateTable ¶
CreateTable command
func DiskBalance ¶
func DiskBalance(client *Client, replicaServer string, minSize int64, interval int, auto bool) error
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 DiskBeforeSplit ¶
func DiskMigrate ¶
func ModifyDuplication ¶
func ModifyDuplication(c *Client, tableName string, dupid int, status admin.DuplicationStatus) error
ModifyDuplication command
func PauseBulkLoad ¶
func PausePartitionSplit ¶
func PrintAllCleanupFlag ¶
func PrintAllCleanupFlag(client *Client, resp *admin.QueryBulkLoadResponse, detailed bool)
func PrintAllDownloading ¶
func PrintAllDownloading(client *Client, resp *admin.QueryBulkLoadResponse, detailed bool)
func PrintAllOthers ¶
func PrintAllOthers(client *Client, resp *admin.QueryBulkLoadResponse, detailed bool)
func PrintAllSummary ¶
func PrintAllSummary(client *Client, tableName string, tableStatus admin.BulkLoadStatus)
func PrintSingleCleanupFlag ¶
func PrintSingleCleanupFlag(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool)
func PrintSingleDownloading ¶
func PrintSingleDownloading(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool)
func PrintSingleIngesting ¶
func PrintSingleIngesting(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool)
func PrintSinglePausing ¶
func PrintSinglePausing(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool)
func PrintSingleSummary ¶
func PrintSingleSummary(client *Client, tableName string, pidx int32, partitionStatus admin.BulkLoadStatus)
func QueryAllNodesDiskInfo ¶
func QueryBulkLoad ¶
func QueryDiskInfo ¶
func QueryDiskInfo(client *Client, infoType DiskInfoType, replicaServer string, tableName string, diskTag string) error
QueryDiskInfo command
func QueryDuplication ¶
QueryDuplication command
func QueryManualCompaction ¶
func QuerySplitStatus ¶
func RemoteCommand ¶
func RemoteCommand(c *Client, nodeType session.NodeType, nodeAddr string, cmd string, args []string) error
RemoteCommand command.
func RestartBulkLoad ¶
func RestartPartitionSplit ¶
func RestoreTable ¶
func SetCompaction ¶
func SetCompaction(client *Client, tableName string, params *CompactionParams) error
func ShowNodesStat ¶
func ShowPartitionCount ¶
func ShowPartitionsStats ¶
ShowPartitionsStats is partition-stat command
func ShowTablePartitions ¶
ShowTablePartitions is table-partitions command
func StartBulkLoad ¶
func StartManualCompaction ¶
func StartPartitionSplit ¶
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 CompactionParams ¶
type DiskCapacityStruct ¶
type DiskInfoType ¶
type DiskInfoType string
const ( CapacitySize DiskInfoType = "CapacitySize" ReplicaCount DiskInfoType = "ReplicaCount" )
type MigrateAction ¶
type MigrateAction struct {
// contains filtered or unexported fields
}
type MigrateDisk ¶
type MigrateDisk struct {
// contains filtered or unexported fields
}
type NodeDiskStats ¶
type NodeDiskStats struct { NodeAddress string DiskTag string DiskCapacity int64 DiskAvailable int64 ReplicaCapacity []ReplicaCapacityStruct }
type PartitionStruct ¶
type PartitionStruct struct { Pidx int32 `json:"pidx"` PrimaryAddr string `json:"primary"` SecondariesAddr string `json:"secondaries"` }
func GetTablePartition ¶
func GetTablePartition(client *Client, tableName string, partitionIndex int32) (*PartitionStruct, error)
func GetTablePartitions ¶
func GetTablePartitions(client *Client, tableName string) (partitions []PartitionStruct, err error)
type ReplicaCapacityStruct ¶
Source Files ¶
- backup_restore.go
- bulk_load.go
- client.go
- cluster_info.go
- compaction.go
- create_table.go
- disk_balance.go
- disk_info.go
- drop_table.go
- duplication.go
- list_nodes.go
- list_tables.go
- manual_compaction.go
- meta_level.go
- nodes_stat.go
- partition_split.go
- partition_stat.go
- recall_table.go
- remote_command.go
- server_config.go
- server_info.go
- table_env.go
- table_partitions.go
- table_stat.go
- use_table.go