executor

package
v0.0.0-...-9e3a4f8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WaitCleaning = time.Second * 90 // time for wait garbage replica to clean complete
View Source
var WaitRunning = time.Second * 10 // time for wait migrate complete

Functions

func AddDisk

func AddDisk(client *Client, replicaServer string, diskStr string) error

func AddDuplication

func AddDuplication(c *Client, tableName string, remoteCluster string, freezed bool) error

AddDuplication command

func BackupTable

func BackupTable(client *Client, tableID int, providerType string, backupPath string) error

func CancelBulkLoad

func CancelBulkLoad(client *Client, tableName string, forced bool) error

func CancelPartitionSplit

func CancelPartitionSplit(client *Client, tableName string, oldPartitionCount int) error

func ClearAppEnv

func ClearAppEnv(c *Client, useTable string) error

ClearAppEnv command

func ClusterInfo

func ClusterInfo(client *Client) error

ClusterInfo command

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

func CreateTable(c *Client, tableName string, partitionCount int, replicaCount int) error

CreateTable command

func DelAppEnv

func DelAppEnv(c *Client, useTable string, key string, deletePrefix bool) error

DelAppEnv command TODO(wutao): deleting a non-existed key returns "OK" now.

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 DiskBeforeSplit(client *Client, tableName string) error

func DiskMigrate

func DiskMigrate(client *Client, replicaServer string, pidStr string, from string, to string) error

func DropTable

func DropTable(c *Client, tableName string, reservePeriod int64) error

DropTable command

func GetAppEnv

func GetAppEnv(c *Client, useTable string, envName string) (string, error)

func GetMetaLevel

func GetMetaLevel(c *Client) error

GetMetaLevel command

func ListAppEnvs

func ListAppEnvs(c *Client, useTable string) error

ListAppEnvs command

func ListNodes

func ListNodes(client *Client) error

ListNodes is nodes command.

func ListTables

func ListTables(client *Client, showDropped bool) error

ListTables command.

func ModifyDuplication

func ModifyDuplication(c *Client, tableName string, dupid int, status admin.DuplicationStatus) error

ModifyDuplication command

func PauseBulkLoad

func PauseBulkLoad(client *Client, tableName string) error

func PausePartitionSplit

func PausePartitionSplit(client *Client, tableName string, parentPidx int) error

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 QueryAllNodesDiskInfo(client *Client, tableName string) (map[string]*radmin.QueryDiskInfoResponse, error)

func QueryBackupStatus

func QueryBackupStatus(client *Client, tableID int, backupID int64) error

func QueryBulkLoad

func QueryBulkLoad(client *Client, tableName string, partitionIndex int, detailed bool) error

func QueryDiskInfo

func QueryDiskInfo(client *Client, infoType DiskInfoType, replicaServer string, tableName string, diskTag string) error

QueryDiskInfo command

func QueryDuplication

func QueryDuplication(c *Client, tableName string) error

QueryDuplication command

func QueryManualCompaction

func QueryManualCompaction(client *Client, tableName string) error

func QuerySplitStatus

func QuerySplitStatus(client *Client, tableName string) error

func RecallTable

func RecallTable(client *Client, originTableID int, newTableName string) error

func RemoteCommand

func RemoteCommand(c *Client, nodeType session.NodeType, nodeAddr string, cmd string, args []string) error

RemoteCommand command.

func RestartBulkLoad

func RestartBulkLoad(client *Client, tableName string) error

func RestartPartitionSplit

func RestartPartitionSplit(client *Client, tableName string, parentPidx int) error

func RestoreTable

func RestoreTable(client *Client, oldClusterName string, oldTableName string, oldTableID int,
	backupID int64, providerType string, newTableName string, restorePath string, skipBadPartition bool, policyName string) error

func ServerInfo

func ServerInfo(c *Client) error

ServerInfo command

func SetAppEnv

func SetAppEnv(c *Client, useTable string, key, value string) error

SetAppEnv command

func SetCompaction

func SetCompaction(client *Client, tableName string, params *CompactionParams) error

func SetMetaLevel

func SetMetaLevel(c *Client, lvlStr string) error

SetMetaLevel command

func ShowNodesStat

func ShowNodesStat(client *Client) error

func ShowPartitionCount

func ShowPartitionCount(client *Client, tableName string) error

func ShowPartitionsStats

func ShowPartitionsStats(client *Client, tableName string) error

ShowPartitionsStats is partition-stat command

func ShowTablePartitions

func ShowTablePartitions(client *Client, tableName string) error

ShowTablePartitions is table-partitions command

func StartBulkLoad

func StartBulkLoad(client *Client, tableName string, clusterName string, providerType string, rootPath string) error

func StartManualCompaction

func StartManualCompaction(client *Client, tableName string, targetLevel int, maxRunningCount int, bottommost bool) error

func StartPartitionSplit

func StartPartitionSplit(client *Client, tableName string, newPartitionCount int) error

func TableStat

func TableStat(c *Client) error

TableStat is table-stat command.

func UseTable

func UseTable(client *Client, table string) error

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.

func NewClient

func NewClient(writer io.Writer, metaAddrs []string) *Client

NewClient creates a client for accessing Pegasus cluster for use of admin-cli.

type CompactionParams

type CompactionParams struct {
	OperationType  string
	UpdateTTLType  string
	TimeValue      uint
	HashkeyPattern string
	HashkeyMatch   string
	SortkeyPattern string
	SortkeyMatch   string
	StartTTL       int64
	StopTTL        int64
}

type DiskCapacityStruct

type DiskCapacityStruct struct {
	Disk     string `json:"disk"`
	Capacity int64  `json:"capacity"`
	Usage    int64  `json:"usage"`
	Ratio    int64  `json:"ratio"`
}

type DiskInfoType

type DiskInfoType string
const (
	CapacitySize DiskInfoType = "CapacitySize"
	ReplicaCount DiskInfoType = "ReplicaCount"
)

type DiskStats

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

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

type ReplicaCapacityStruct struct {
	Gpid   string `json:"replica"`
	Status string `json:"status"`
	Size   int64  `json:"size"`
}

Directories

Path Synopsis
toolkits

Jump to

Keyboard shortcuts

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