Documentation ¶
Index ¶
- Constants
- func BalancePlanSummary(plans []plan.Plan) (map[uint64]plan.Status, bool, error)
- func NewBalanceSchedulerPlan() *balanceSchedulerPlan
- func RecvRegionInfo(s schedule.Scheduler) chan<- *core.RegionInfo
- func Register()
- type BalanceLeaderCreateOption
- type BalanceRegionCreateOption
- type BalanceWitnessCreateOption
- type BaseScheduler
- func (s *BaseScheduler) Cleanup(cluster schedule.Cluster)
- func (s *BaseScheduler) EncodeConfig() ([]byte, error)
- func (s *BaseScheduler) GetMinInterval() time.Duration
- func (s *BaseScheduler) GetNextInterval(interval time.Duration) time.Duration
- func (s *BaseScheduler) Prepare(cluster schedule.Cluster) error
- func (s *BaseScheduler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
const ( // BalanceLeaderName is balance leader scheduler name. BalanceLeaderName = "balance-leader-scheduler" // BalanceLeaderType is balance leader scheduler type. BalanceLeaderType = "balance-leader" // BalanceLeaderBatchSize is the default number of operators to transfer leaders by one scheduling. // Default value is 4 which is subjected by scheduler-max-waiting-operator and leader-schedule-limit // If you want to increase balance speed more, please increase above-mentioned param. BalanceLeaderBatchSize = 4 // MaxBalanceLeaderBatchSize is maximum of balance leader batch size MaxBalanceLeaderBatchSize = 10 )
const ( // BalanceRegionName is balance region scheduler name. BalanceRegionName = "balance-region-scheduler" // BalanceRegionType is balance region scheduler type. BalanceRegionType = "balance-region" )
const ( // BalanceWitnessName is balance witness scheduler name. BalanceWitnessName = "balance-witness-scheduler" // BalanceWitnessType is balance witness scheduler type. BalanceWitnessType = "balance-witness" // MaxBalanceWitnessBatchSize is maximum of balance witness batch size MaxBalanceWitnessBatchSize = 10 )
const ( MaxScheduleInterval = time.Second * 5 MinScheduleInterval = time.Millisecond * 10 MinSlowScheduleInterval = time.Second * 3 ScheduleIntervalFactor = 1.3 )
options for interval of schedulers
const ( // EvictLeaderName is evict leader scheduler name. EvictLeaderName = "evict-leader-scheduler" // EvictLeaderType is evict leader scheduler type. EvictLeaderType = "evict-leader" // EvictLeaderBatchSize is the number of operators to to transfer // leaders by one scheduling EvictLeaderBatchSize = 3 )
const ( // EvictSlowStoreName is evict leader scheduler name. EvictSlowStoreName = "evict-slow-store-scheduler" // EvictSlowStoreType is evict leader scheduler type. EvictSlowStoreType = "evict-slow-store" )
const ( // EvictSlowTrendName is evict leader by slow trend scheduler name. EvictSlowTrendName = "evict-slow-trend-scheduler" // EvictSlowTrendType is evict leader by slow trend scheduler type. EvictSlowTrendType = "evict-slow-trend" )
const ( // GrantHotRegionName is grant hot region scheduler name. GrantHotRegionName = "grant-hot-region-scheduler" // GrantHotRegionType is grant hot region scheduler type. GrantHotRegionType = "grant-hot-region" )
const ( // GrantLeaderName is grant leader scheduler name. GrantLeaderName = "grant-leader-scheduler" // GrantLeaderType is grant leader scheduler type. GrantLeaderType = "grant-leader" )
const ( // HotRegionName is balance hot region scheduler name. HotRegionName = "balance-hot-region-scheduler" // HotRegionType is balance hot region scheduler type. HotRegionType = "hot-region" )
const ( // LabelName is label scheduler name. LabelName = "label-scheduler" // LabelType is label scheduler type. LabelType = "label" )
const ( // RandomMergeName is random merge scheduler name. RandomMergeName = "random-merge-scheduler" // RandomMergeType is random merge scheduler type. RandomMergeType = "random-merge" )
const ( // ScatterRangeType is scatter range scheduler type ScatterRangeType = "scatter-range" // ScatterRangeName is scatter range scheduler name ScatterRangeName = "scatter-range" )
const ( // ShuffleHotRegionName is shuffle hot region scheduler name. ShuffleHotRegionName = "shuffle-hot-region-scheduler" // ShuffleHotRegionType is shuffle hot region scheduler type. ShuffleHotRegionType = "shuffle-hot-region" )
const ( // ShuffleLeaderName is shuffle leader scheduler name. ShuffleLeaderName = "shuffle-leader-scheduler" // ShuffleLeaderType is shuffle leader scheduler type. ShuffleLeaderType = "shuffle-leader" )
const ( // ShuffleRegionName is shuffle region scheduler name. ShuffleRegionName = "shuffle-region-scheduler" // ShuffleRegionType is shuffle region scheduler type. ShuffleRegionType = "shuffle-region" )
const ( // SplitBucketName is the split bucket name. SplitBucketName = "split-bucket-scheduler" // SplitBucketType is the spilt bucket type. SplitBucketType = "split-bucket" )
const ( // TransferWitnessLeaderName is transfer witness leader scheduler name. TransferWitnessLeaderName = "transfer-witness-leader-scheduler" // TransferWitnessLeaderType is transfer witness leader scheduler type. TransferWitnessLeaderType = "transfer-witness-leader" )
Variables ¶
This section is empty.
Functions ¶
func BalancePlanSummary ¶
BalancePlanSummary is used to summarize for BalancePlan
func NewBalanceSchedulerPlan ¶
func NewBalanceSchedulerPlan() *balanceSchedulerPlan
NewBalanceSchedulerPlan returns a new balanceSchedulerBasePlan
func RecvRegionInfo ¶
func RecvRegionInfo(s schedule.Scheduler) chan<- *core.RegionInfo
RecvRegionInfo receives a checked region from coordinator
Types ¶
type BalanceLeaderCreateOption ¶
type BalanceLeaderCreateOption func(s *balanceLeaderScheduler)
BalanceLeaderCreateOption is used to create a scheduler with an option.
func WithBalanceLeaderCounter ¶
func WithBalanceLeaderCounter(counter *prometheus.CounterVec) BalanceLeaderCreateOption
WithBalanceLeaderCounter sets the counter for the scheduler.
func WithBalanceLeaderName ¶
func WithBalanceLeaderName(name string) BalanceLeaderCreateOption
WithBalanceLeaderName sets the name for the scheduler.
type BalanceRegionCreateOption ¶
type BalanceRegionCreateOption func(s *balanceRegionScheduler)
BalanceRegionCreateOption is used to create a scheduler with an option.
func WithBalanceRegionCounter ¶
func WithBalanceRegionCounter(counter *prometheus.CounterVec) BalanceRegionCreateOption
WithBalanceRegionCounter sets the counter for the scheduler.
func WithBalanceRegionName ¶
func WithBalanceRegionName(name string) BalanceRegionCreateOption
WithBalanceRegionName sets the name for the scheduler.
type BalanceWitnessCreateOption ¶
type BalanceWitnessCreateOption func(s *balanceWitnessScheduler)
BalanceWitnessCreateOption is used to create a scheduler with an option.
func WithBalanceWitnessCounter ¶
func WithBalanceWitnessCounter(counter *prometheus.CounterVec) BalanceWitnessCreateOption
WithBalanceWitnessCounter sets the counter for the scheduler.
func WithBalanceWitnessName ¶
func WithBalanceWitnessName(name string) BalanceWitnessCreateOption
WithBalanceWitnessName sets the name for the scheduler.
type BaseScheduler ¶
type BaseScheduler struct {
OpController *schedule.OperatorController
}
BaseScheduler is a basic scheduler for all other complex scheduler
func NewBaseScheduler ¶
func NewBaseScheduler(opController *schedule.OperatorController) *BaseScheduler
NewBaseScheduler returns a basic scheduler
func (*BaseScheduler) Cleanup ¶
func (s *BaseScheduler) Cleanup(cluster schedule.Cluster)
Cleanup does some cleanup work
func (*BaseScheduler) EncodeConfig ¶
func (s *BaseScheduler) EncodeConfig() ([]byte, error)
EncodeConfig encode config for the scheduler
func (*BaseScheduler) GetMinInterval ¶
func (s *BaseScheduler) GetMinInterval() time.Duration
GetMinInterval returns the minimal interval for the scheduler
func (*BaseScheduler) GetNextInterval ¶
func (s *BaseScheduler) GetNextInterval(interval time.Duration) time.Duration
GetNextInterval return the next interval for the scheduler
func (*BaseScheduler) Prepare ¶
func (s *BaseScheduler) Prepare(cluster schedule.Cluster) error
Prepare does some prepare work
func (*BaseScheduler) ServeHTTP ¶
func (s *BaseScheduler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Source Files ¶
- balance_leader.go
- balance_plan.go
- balance_region.go
- balance_witness.go
- base_scheduler.go
- evict_leader.go
- evict_slow_store.go
- evict_slow_trend.go
- grant_hot_region.go
- grant_leader.go
- hot_region.go
- hot_region_config.go
- hot_region_v2.go
- init.go
- label.go
- metrics.go
- random_merge.go
- scatter_range.go
- shuffle_hot_region.go
- shuffle_leader.go
- shuffle_region.go
- shuffle_region_config.go
- split_bucket.go
- transfer_witness_leader.go
- utils.go