{"modulePath":"github.com/matrixorigin/matrixone","version":"v1.2.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ctl\n\n## Variables\n\n```go\nvar (\n\tPingMethod             = \"PING\"\n\tFlushMethod            = \"FLUSH\"\n\tTaskMethod             = \"TASK\"\n\tUseSnapshotMethod      = \"USESNAPSHOT\"\n\tGetSnapshotMethod      = \"GETSNAPSHOT\"\n\tCheckpointMethod       = \"CHECKPOINT\"\n\tGlobalCheckpointMethod = \"GLOBALCHECKPOINT\"\n\tForceGCMethod          = \"FORCEGC\"\n\tInspectMethod          = \"INSPECT\"\n\tLabelMethod            = \"LABEL\"\n\tWorkStateMethod        = \"WORKSTATE\"\n\tSyncCommitMethod       = \"SYNCCOMMIT\"\n\tAddFaultPointMethod    = \"ADDFAULTPOINT\"\n\tBackupMethod           = \"BACKUP\"\n\tTraceSpanMethod        = \"TRACESPAN\"\n\tCoreDumpMethod         = \"COREDUMP\"\n\tInterceptCommitMethod  = \"INTERCEPTCOMMIT\"\n\tMergeObjectsMethod     = \"MERGEOBJECTS\"\n\tDisableCKPMethod       = \"DISABLECKP\"\n\tDiskCleanerMethod      = \"DISKCLEANER\"\n\n\tGetProtocolVersionMethod = \"GETPROTOCOLVERSION\"\n\tSetProtocolVersionMethod = \"SETPROTOCOLVERSION\"\n\n\tRemoveRemoteLockTable = strings.ToUpper(\"RemoveRemoteLockTable\")\n\tGetLatestBind         = strings.ToUpper(\"GetLatestBind\")\n\tUnsubscribeTable      = \"UNSUBSCRIBE_TABLE\"\n\n\tHandleTxnTrace = strings.ToUpper(\"txn-trace\")\n\n\tReloadAutoIncrementCache = strings.ToUpper(\"reload-auto-increment-cache\")\n)\n```\n\n```go\nvar MoCtlTNCmdSender = func(ctx context.Context, proc *process.Process, requests []txn.CNOpRequest) ([]txn.CNOpResponse, error) {\n\ttxnOp := proc.TxnOperator\n\tif txnOp == nil {\n\t\treturn nil, moerr.NewInternalError(ctx, \"ctl: txn operator is nil\")\n\t}\n\n\tdebugRequests := make([]txn.TxnRequest, 0, len(requests))\n\tfor _, req := range requests {\n\t\ttq := txn.NewTxnRequest(\u0026req)\n\t\ttq.Method = txn.TxnMethod_DEBUG\n\t\tdebugRequests = append(debugRequests, tq)\n\t}\n\tresult, err := txnOp.Debug(ctx, debugRequests)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer result.Release()\n\n\tresponses := make([]txn.CNOpResponse, 0, len(requests))\n\tfor _, resp := range result.Responses {\n\t\tresponses = append(responses, *resp.CNOpResponse)\n\t}\n\treturn responses, nil\n}\n```\n\n## Functions\n\n```go\nfunc GetTNHandlerFunc(method api.OpCode,\n\twhichTN func(parameter string) ([]uint64, error),\n\tpayload func(tnShardID uint64, parameter string, proc *process.Process) ([]byte, error),\n\trepsonseUnmarshaler func([]byte) (any, error)) handleFunc\n```\nGetTNHandlerFunc 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\n\n```go\nfunc IsValidArg(parameter string, proc *process.Process) (*db.DiskCleaner, error)\n```\n\n```go\nfunc MoCtl(ivecs []*vector.Vector, result vector.FunctionResultWrapper, proc *process.Process, length int) error\n```\nmo\\_ctl functions are significantly different from oridinary functions and deserve its own package.\n\n```go\nfunc SelfProcess(cmd string, spans string, threshold int64) string\n```\n\n## Types\n\n```go\ntype Result struct {\n\tMethod string `json:\"method\"`\n\tData   any    `json:\"result\"`\n}\n```\nResult ctl result\n\n","path":"github.com/matrixorigin/matrixone/pkg/sql/plan/function/ctl","name":"ctl","synopsis":"","isRedistributable":true}
