Documentation ¶
Index ¶
- Constants
- func ResetHotSpotMetrics()
- type Coordinator
- func (c *Coordinator) AreSchedulersInitialized() bool
- func (c *Coordinator) CollectHotSpotMetrics()
- func (c *Coordinator) GetCheckerController() *checker.Controller
- func (c *Coordinator) GetCluster() sche.ClusterInformer
- func (c *Coordinator) GetDiagnosticResult(name string) (*schedulers.DiagnosticResult, error)
- func (c *Coordinator) GetHeartbeatStreams() *hbstream.HeartbeatStreams
- func (c *Coordinator) GetHotRegions(typ utils.RWType, storeIDs ...uint64) *statistics.StoreHotPeersInfos
- func (c *Coordinator) GetHotRegionsByType(typ utils.RWType) *statistics.StoreHotPeersInfos
- func (c *Coordinator) GetMergeChecker() *checker.MergeChecker
- func (c *Coordinator) GetOperatorController() *operator.Controller
- func (c *Coordinator) GetPatrolRegionsDuration() time.Duration
- func (c *Coordinator) GetPrepareChecker() *prepareChecker
- func (c *Coordinator) GetRegionScatterer() *scatter.RegionScatterer
- func (c *Coordinator) GetRegionSplitter() *splitter.RegionSplitter
- func (c *Coordinator) GetRuleChecker() *checker.RuleChecker
- func (c *Coordinator) GetSchedulersController() *schedulers.Controller
- func (c *Coordinator) GetWaitGroup() *sync.WaitGroup
- func (c *Coordinator) InitSchedulers(needRun bool)
- func (c *Coordinator) IsCheckerPaused(name string) (bool, error)
- func (c *Coordinator) IsPendingRegion(region uint64) bool
- func (c *Coordinator) LoadPlugin(pluginPath string, ch chan string)
- func (c *Coordinator) PatrolRegions()
- func (c *Coordinator) PauseOrResumeChecker(name string, t int64) error
- func (c *Coordinator) RecordOpStepWithTTL(regionID uint64)
- func (c *Coordinator) Run(collectWaitTime ...time.Duration)
- func (c *Coordinator) RunUntilStop(collectWaitTime ...time.Duration)
- func (c *Coordinator) ShouldRun(collectWaitTime ...time.Duration) bool
- func (c *Coordinator) Stop()
- type PluginInterface
Constants ¶
const ( // PluginLoad means action for load plugin PluginLoad = "PluginLoad" // PluginUnload means action for unload plugin PluginUnload = "PluginUnload" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coordinator ¶
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) 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 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.
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 ¶
GetFunction gets func by funcName from plugin(.so)