schedule

package
v1.1.0-beta.0...-7cc3b4e Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PluginLoad means action for load plugin
	PluginLoad = "PluginLoad"
	// PluginUnload means action for unload plugin
	PluginUnload = "PluginUnload"
)

Variables

This section is empty.

Functions

func ResetHotSpotMetrics

func ResetHotSpotMetrics()

ResetHotSpotMetrics resets hot spot metrics.

Types

type Coordinator

type Coordinator struct {
	syncutil.RWMutex
	// contains filtered or unexported fields
}

Coordinator is used to manage all schedulers and checkers to decide if the region needs to be scheduled.

func NewCoordinator

func NewCoordinator(parentCtx context.Context, cluster sche.ClusterInformer, hbStreams *hbstream.HeartbeatStreams) *Coordinator

NewCoordinator creates a new Coordinator.

func (*Coordinator) AreSchedulersInitialized

func (c *Coordinator) AreSchedulersInitialized() bool

AreSchedulersInitialized returns whether the schedulers have been initialized.

func (*Coordinator) CollectHotSpotMetrics

func (c *Coordinator) CollectHotSpotMetrics()

CollectHotSpotMetrics collects hot spot metrics.

func (*Coordinator) GetCheckerController

func (c *Coordinator) GetCheckerController() *checker.Controller

GetCheckerController returns the checker controller.

func (*Coordinator) GetCluster

func (c *Coordinator) GetCluster() sche.ClusterInformer

GetCluster returns the cluster. Only for test purpose.

func (*Coordinator) GetDiagnosticResult

func (c *Coordinator) GetDiagnosticResult(name string) (*schedulers.DiagnosticResult, error)

GetDiagnosticResult returns the diagnostic result.

func (*Coordinator) GetHeartbeatStreams

func (c *Coordinator) GetHeartbeatStreams() *hbstream.HeartbeatStreams

GetHeartbeatStreams returns the heartbeat streams. Only for test purpose.

func (*Coordinator) GetHotRegions

func (c *Coordinator) GetHotRegions(typ utils.RWType, storeIDs ...uint64) *statistics.StoreHotPeersInfos

GetHotRegions gets hot regions' statistics by RWType and storeIDs. If storeIDs is empty, it returns all hot regions' statistics by RWType.

func (*Coordinator) GetHotRegionsByType

func (c *Coordinator) GetHotRegionsByType(typ utils.RWType) *statistics.StoreHotPeersInfos

GetHotRegionsByType gets hot regions' statistics by RWType.

func (*Coordinator) GetMergeChecker

func (c *Coordinator) GetMergeChecker() *checker.MergeChecker

GetMergeChecker returns the merge checker.

func (*Coordinator) GetOperatorController

func (c *Coordinator) GetOperatorController() *operator.Controller

GetOperatorController returns the operator controller.

func (*Coordinator) GetPatrolRegionsDuration

func (c *Coordinator) GetPatrolRegionsDuration() time.Duration

GetPatrolRegionsDuration returns the duration of the last patrol region round.

func (*Coordinator) GetPrepareChecker

func (c *Coordinator) GetPrepareChecker() *prepareChecker

GetPrepareChecker returns the prepare checker.

func (*Coordinator) GetRegionScatterer

func (c *Coordinator) GetRegionScatterer() *scatter.RegionScatterer

GetRegionScatterer returns the region scatterer.

func (*Coordinator) GetRegionSplitter

func (c *Coordinator) GetRegionSplitter() *splitter.RegionSplitter

GetRegionSplitter returns the region splitter.

func (*Coordinator) GetRuleChecker

func (c *Coordinator) GetRuleChecker() *checker.RuleChecker

GetRuleChecker returns the rule checker.

func (*Coordinator) GetSchedulersController

func (c *Coordinator) GetSchedulersController() *schedulers.Controller

GetSchedulersController returns the schedulers controller.

func (*Coordinator) GetWaitGroup

func (c *Coordinator) GetWaitGroup() *sync.WaitGroup

GetWaitGroup returns the wait group. Only for test purpose.

func (*Coordinator) GetWaitingRegions

func (c *Coordinator) GetWaitingRegions() []*cache.Item

GetWaitingRegions returns the regions in the waiting list.

func (*Coordinator) InitSchedulers

func (c *Coordinator) InitSchedulers(needRun bool)

InitSchedulers initializes schedulers.

func (*Coordinator) IsCheckerPaused

func (c *Coordinator) IsCheckerPaused(name string) (bool, error)

IsCheckerPaused returns whether a checker is paused.

func (*Coordinator) IsPendingRegion

func (c *Coordinator) IsPendingRegion(region uint64) bool

IsPendingRegion returns if the region is in the pending list.

func (*Coordinator) LoadPlugin

func (c *Coordinator) LoadPlugin(pluginPath string, ch chan string)

LoadPlugin load user plugin

func (*Coordinator) PatrolRegions

func (c *Coordinator) PatrolRegions()

PatrolRegions is used to scan regions. The checkers will check these regions to decide if they need to do some operations. The function is exposed for test purpose.

func (*Coordinator) PauseOrResumeChecker

func (c *Coordinator) PauseOrResumeChecker(name string, t int64) error

PauseOrResumeChecker pauses or resumes a checker by name.

func (*Coordinator) RecordOpStepWithTTL

func (c *Coordinator) RecordOpStepWithTTL(regionID uint64)

RecordOpStepWithTTL records OpStep with TTL

func (*Coordinator) Run

func (c *Coordinator) Run(collectWaitTime ...time.Duration)

Run starts coordinator.

func (*Coordinator) RunUntilStop

func (c *Coordinator) RunUntilStop(collectWaitTime ...time.Duration)

RunUntilStop runs the coordinator until receiving the stop signal.

func (*Coordinator) ShouldRun

func (c *Coordinator) ShouldRun(collectWaitTime ...time.Duration) bool

ShouldRun returns true if the coordinator should run.

func (*Coordinator) Stop

func (c *Coordinator) Stop()

Stop stops the coordinator.

type PluginInterface

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

PluginInterface is used to manage all plugin.

func NewPluginInterface

func NewPluginInterface() *PluginInterface

NewPluginInterface create a plugin interface

func (*PluginInterface) GetFunction

func (p *PluginInterface) GetFunction(path string, funcName string) (plugin.Symbol, error)

GetFunction gets func by funcName from plugin(.so)

Jump to

Keyboard shortcuts

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