Documentation ¶
Index ¶
- func NewWorker(statsHandle statstypes.StatsHandle, sysProcTracker sysproctrack.Tracker, ...) *worker
- type Refresher
- func (r *Refresher) AnalyzeHighestPriorityTables(sctx sessionctx.Context) bool
- func (r *Refresher) Close()
- func (r *Refresher) GetRunningJobs() map[int64]struct{}
- func (r *Refresher) Len() int
- func (*Refresher) OnBecomeOwner()
- func (r *Refresher) OnRetireOwner()
- func (r *Refresher) ProcessDMLChangesForTest()
- func (r *Refresher) RequeueMustRetryJobsForTest()
- func (r *Refresher) UpdateConcurrency()
- func (r *Refresher) WaitAutoAnalyzeFinishedForTest()
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 ¶
GetRunningJobs returns the currently running jobs. Only used in the test.
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.