ttlworker

package
v7.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttachStatsCollector = func(s sqlexec.SQLExecutor) sqlexec.SQLExecutor {
	return s
}

AttachStatsCollector attaches the stats collector for the session. this function is registered in BootstrapSession in /session/session.go

View Source
var DetachStatsCollector = func(s sqlexec.SQLExecutor) sqlexec.SQLExecutor {
	return s
}

DetachStatsCollector removes the stats collector for the session this function is registered in BootstrapSession in /session/session.go

Functions

func DoGC

func DoGC(ctx context.Context, se session.Session)

DoGC deletes some old TTL job histories and redundant scan tasks

Types

type JobManager

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

JobManager schedules and manages the ttl jobs on this instance

func NewJobManager

func NewJobManager(id string, sessPool sessionPool, store kv.Storage, etcdCli *clientv3.Client) (manager *JobManager)

NewJobManager creates a new ttl job manager

func (*JobManager) Error

func (w *JobManager) Error() error

func (*JobManager) GetCommandCli

func (m *JobManager) GetCommandCli() client.CommandClient

GetCommandCli returns the command client

func (*JobManager) GetNotificationCli

func (m *JobManager) GetNotificationCli() client.NotificationClient

GetNotificationCli returns the notification client

func (*JobManager) Send

func (w *JobManager) Send() chan<- interface{}

func (*JobManager) Start

func (w *JobManager) Start()

func (*JobManager) Status

func (w *JobManager) Status() workerStatus

func (*JobManager) Stop

func (w *JobManager) Stop()

func (*JobManager) WaitStopped

func (w *JobManager) WaitStopped(ctx context.Context, timeout time.Duration) error

type TTLSummary

type TTLSummary struct {
	TotalRows   uint64 `json:"total_rows"`
	SuccessRows uint64 `json:"success_rows"`
	ErrorRows   uint64 `json:"error_rows"`

	TotalScanTask     int `json:"total_scan_task"`
	ScheduledScanTask int `json:"scheduled_scan_task"`
	FinishedScanTask  int `json:"finished_scan_task"`

	ScanTaskErr string `json:"scan_task_err,omitempty"`
	SummaryText string `json:"-"`
}

TTLSummary is the summary for TTL job

Jump to

Keyboard shortcuts

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