refresher

package
v1.1.0-beta.0...-a5832b4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorker

func NewWorker(statsHandle statstypes.StatsHandle, sysProcTracker sysproctrack.Tracker, maxConcurrency int) *worker

NewWorker creates a new worker.

Types

type Refresher

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

Refresher provides methods to refresh stats info. NOTE: Refresher is not thread-safe.

func NewRefresher

func NewRefresher(
	statsHandle statstypes.StatsHandle,
	sysProcTracker sysproctrack.Tracker,
	ddlNotifier *notifier.DDLNotifier,
) *Refresher

NewRefresher creates a new Refresher and starts the goroutine.

func (*Refresher) AnalyzeHighestPriorityTables

func (r *Refresher) AnalyzeHighestPriorityTables(sctx sessionctx.Context) bool

AnalyzeHighestPriorityTables picks tables with the highest priority and analyzes them. Note: Make sure the session has the latest variable values. Usually, this is done by the caller through `util.CallWithSCtx`.

func (*Refresher) Close

func (r *Refresher) Close()

Close stops all running jobs and releases resources.

func (*Refresher) GetRunningJobs

func (r *Refresher) GetRunningJobs() map[int64]struct{}

GetRunningJobs returns the currently running jobs. Only used in the test.

func (*Refresher) Len

func (r *Refresher) Len() int

Len returns the length of the analysis job queue.

func (*Refresher) OnBecomeOwner

func (*Refresher) OnBecomeOwner()

OnBecomeOwner is used to handle the event when the current TiDB instance becomes the stats owner.

func (*Refresher) OnRetireOwner

func (r *Refresher) OnRetireOwner()

OnRetireOwner is used to handle the event when the current TiDB instance retires from being the stats owner.

func (*Refresher) ProcessDMLChangesForTest

func (r *Refresher) ProcessDMLChangesForTest()

ProcessDMLChangesForTest processes DML changes for the test. Only used in the test.

func (*Refresher) RequeueMustRetryJobsForTest

func (r *Refresher) RequeueMustRetryJobsForTest()

RequeueMustRetryJobsForTest requeues must retry jobs for the test. Only used in the test.

func (*Refresher) UpdateConcurrency

func (r *Refresher) UpdateConcurrency()

UpdateConcurrency updates the maximum concurrency for auto-analyze jobs

func (*Refresher) WaitAutoAnalyzeFinishedForTest

func (r *Refresher) WaitAutoAnalyzeFinishedForTest()

WaitAutoAnalyzeFinishedForTest waits for the auto analyze job to be finished. Only used in the test.

Jump to

Keyboard shortcuts

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