idxcron

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: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Action_Ivfflat_Reindex = "ivfflat_reindex"
	Action_Wildcard        = "*"

	Status_Error   = "error"
	Status_Ok      = "ok"
	Status_Skipped = "skipped"

	OneWeek = 24 * 7 * time.Hour

	Reason_Skipped = "skipped"
)

+----------------+---------------------+------+------+---------+-------+---------+ | Field | Type | Null | Key | Default | Extra | Comment | +----------------+---------------------+------+------+---------+-------+---------+ | account_id | INT UNSIGNED(32) | NO | PRI | NULL | | | | table_id | BIGINT UNSIGNED(64) | NO | PRI | NULL | | | | db_name | VARCHAR(65535) | NO | PRI | NULL | | | | table_name | VARCHAR(65535) | NO | PRI | NULL | | | | index_name | VARCHAR(65535) | NO | PRI | NULL | | | | action | VARCHAR(65535) | NO | PRI | NULL | | | | metadata | JSON(0) | NO | | NULL | | | | status | JSON(0) | NO | | NULL | | | | create_at | TIMESTAMP(0) | NO | | NULL | | | | last_update_at | TIMESTAMP(0) | YES | | NULL | | | +----------------+---------------------+------+------+---------+-------+---------+

View Source
const ParamSeparator = " "

Variables

View Source
var IndexUpdateTaskCronExpr = "0 0 * * * *" // run once an hour, beginning of hour

Functions

func IndexUpdateTaskExecutorFactory

func IndexUpdateTaskExecutorFactory(
	cnUUID string,
	txnEngine engine.Engine,
	cnTxnClient client.TxnClient,
	mp *mpool.MPool,
) func(ctx context.Context, task task.Task) (err error)

func IndexUpdateTaskMetadata

func IndexUpdateTaskMetadata(id task.TaskCode, args ...string) task.TaskMetadata

func RegisterUpdate

func RegisterUpdate(ctx context.Context,
	cnUUID string,
	txn client.TxnOperator,
	tableId uint64,
	dbname string,
	tablename string,
	indexname string,
	action string,
	metadata string,
) (err error)

always replace with the new data

func RenameSrcTable

func RenameSrcTable(ctx context.Context,
	cnUUID string,
	txn client.TxnOperator,
	dbId, tableId uint64,
	oldTableName, newTablename string) (err error)

func UnregisterUpdate

func UnregisterUpdate(ctx context.Context,
	cnUUID string,
	txn client.TxnOperator,
	tableId uint64,
	indexname string,
	action string,
) (err error)

if action == "*", remove all actions

func UnregisterUpdateByDbName

func UnregisterUpdateByDbName(ctx context.Context,
	cnUUID string,
	txn client.TxnOperator,
	dbName string) (err error)

func UnregisterUpdateByTableId

func UnregisterUpdateByTableId(ctx context.Context,
	cnUUID string,
	txn client.TxnOperator,
	tableId uint64) (err error)

Types

type IndexUpdateStatus

type IndexUpdateStatus struct {
	Status string    `json:"status"`
	Msg    string    `json:"msg,omitempty"`
	Time   time.Time `json:"time,omitempty"`
}

type IndexUpdateTaskExecutor

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

func NewIndexUpdateTaskExecutor

func NewIndexUpdateTaskExecutor(
	ctx context.Context,
	cnUUID string,
	txnEngine engine.Engine,
	cnTxnClient client.TxnClient,
	mp *mpool.MPool) (*IndexUpdateTaskExecutor, error)

type IndexUpdateTaskInfo

type IndexUpdateTaskInfo struct {
	DbName       string
	TableName    string
	IndexName    string
	Action       string
	AccountId    uint32
	TableId      uint64
	Metadata     *sqlexec.Metadata
	Status       []byte
	CreatedAt    types.Timestamp
	LastUpdateAt *types.Timestamp
}

Jump to

Keyboard shortcuts

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