ctl

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PingMethod               = "PING"
	FlushMethod              = "FLUSH"
	TaskMethod               = "TASK"
	UseSnapshotMethod        = "USESNAPSHOT"
	GetSnapshotMethod        = "GETSNAPSHOT"
	CheckpointMethod         = "CHECKPOINT"
	GlobalCheckpointMethod   = "GLOBALCHECKPOINT"
	ForceGCMethod            = "FORCEGC"
	InspectMethod            = "INSPECT"
	LabelMethod              = "LABEL"
	WorkStateMethod          = "WORKSTATE"
	SyncCommitMethod         = "SYNCCOMMIT"
	AddFaultPointMethod      = "ADDFAULTPOINT"
	BackupMethod             = "BACKUP"
	TraceSpanMethod          = "TRACESPAN"
	CoreDumpMethod           = "COREDUMP"
	InterceptCommitMethod    = "INTERCEPTCOMMIT"
	MergeObjectsMethod       = "MERGEOBJECTS"
	DiskCleanerMethod        = "DISKCLEANER"
	GetProtocolVersionMethod = "GETPROTOCOLVERSION"
	SetProtocolVersionMethod = "SETPROTOCOLVERSION"
	RemoveRemoteLockTable    = strings.ToUpper("RemoveRemoteLockTable")
	GetLatestBind            = strings.ToUpper("GetLatestBind")
	UnsubscribeTable         = "UNSUBSCRIBE_TABLE"
	HandleTxnTrace           = strings.ToUpper("txn-trace")
	ReloadAutoIncrementCache = strings.ToUpper("reload-auto-increment-cache")
	CtlReaderMethod          = strings.ToUpper("reader")
	GetTableShards           = strings.ToUpper("get-table-shards")
	MoTableStats             = strings.ToUpper("MoTableStats")
	WorkspaceThreshold       = strings.ToUpper("WorkspaceThreshold")
	TableExtra               = strings.ToUpper("table-extra")
	PrefetchOnSubscribed     = strings.ToUpper("prefetch-on-subscribed")
	GCCatalogCacheMethod     = strings.ToUpper("GCCatalogCache")
)
View Source
var MoCtlTNCmdSender = func(ctx context.Context, proc *process.Process, requests []txn.CNOpRequest) ([]txn.CNOpResponse, error) {
	txnOp := proc.GetTxnOperator()
	if txnOp == nil {
		return nil, moerr.NewInternalError(ctx, "ctl: txn operator is nil")
	}

	debugRequests := make([]txn.TxnRequest, 0, len(requests))
	for _, req := range requests {
		tq := txn.NewTxnRequest(&req)
		tq.Method = txn.TxnMethod_DEBUG
		debugRequests = append(debugRequests, tq)
	}
	result, err := txnOp.Debug(ctx, debugRequests)
	if err != nil {
		return nil, err
	}
	defer result.Release()

	responses := make([]txn.CNOpResponse, 0, len(requests))
	for _, resp := range result.Responses {
		responses = append(responses, *resp.CNOpResponse)
	}
	return responses, nil
}

Functions

func GetTNHandlerFunc added in v1.0.1

func GetTNHandlerFunc(method api.OpCode,
	whichTN func(parameter string) ([]uint64, error),
	payload func(tnShardID uint64, parameter string, proc *process.Process) ([]byte, error),
	repsonseUnmarshaler func([]byte) (any, error)) handleFunc

GetTNHandlerFunc used to handle dn's debug command handle func. method: debug command type. whichDN: used to decide which DNs to send the debug request to, nil returned means send all dns. payload: used to get debug command request payload repsonseUnmarshaler: used to unmarshal response

func IsValidArg added in v1.2.1

func IsValidArg(parameter string, proc *process.Process) (*cmd_util.DiskCleaner, error)

func MoCtl

func MoCtl(ivecs []*vector.Vector, result vector.FunctionResultWrapper, proc *process.Process, length int) error

mo_ctl functions are significantly different from oridinary functions and deserve its own package.

func TransferRequest2OtherCNs

func TransferRequest2OtherCNs(
	proc *process.Process,
	uuid string,
	request *query.Request,
) (resp *query.Response, err error)

func UpdateCurrentCNPrefetchOnSubscribed

func UpdateCurrentCNPrefetchOnSubscribed(patterns []string) string

func UpdateCurrentCNReader

func UpdateCurrentCNReader(cmd string, cfgs ...string) string

func UpdateCurrentCNTraceSpan

func UpdateCurrentCNTraceSpan(cmd string, spans string, threshold int64) string

Types

type Filter

type Filter interface {
	Filter([]objectio.ObjectStats) ([]objectio.ObjectStats, []objectio.ObjectStats)
}

func NewOverlap

func NewOverlap(maxObjects int) Filter

func NewSmall

func NewSmall(threshold uint32) Filter

type Res

type Res struct {
	PodID           string `json:"pod_id,omitempty"`
	CommitThreshold uint64 `json:"commit_threshold,omitempty"`
	WriteThreshold  uint64 `json:"write_threshold,omitempty"`
	ErrorStr        string `json:"error,omitempty"`
}

type Result added in v1.1.0

type Result struct {
	Method string `json:"method"`
	Data   any    `json:"result"`
}

Result ctl result

Jump to

Keyboard shortcuts

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