schedulers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
const (
	// BalanceRegionName is balance region scheduler name.
	BalanceRegionName = "balance-region-scheduler"
	// BalanceRegionType is balance region scheduler type.
	BalanceRegionType = "balance-region"
)
View Source
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
)
View Source
const (
	MaxScheduleInterval     = time.Second * 5
	MinScheduleInterval     = time.Millisecond * 10
	MinSlowScheduleInterval = time.Second * 3

	ScheduleIntervalFactor = 1.3
)

options for interval of schedulers

View Source
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
)
View Source
const (
	// EvictSlowStoreName is evict leader scheduler name.
	EvictSlowStoreName = "evict-slow-store-scheduler"
	// EvictSlowStoreType is evict leader scheduler type.
	EvictSlowStoreType = "evict-slow-store"
)
View Source
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"
)
View Source
const (
	// GrantHotRegionName is grant hot region scheduler name.
	GrantHotRegionName = "grant-hot-region-scheduler"
	// GrantHotRegionType is grant hot region scheduler type.
	GrantHotRegionType = "grant-hot-region"
)
View Source
const (
	// GrantLeaderName is grant leader scheduler name.
	GrantLeaderName = "grant-leader-scheduler"
	// GrantLeaderType is grant leader scheduler type.
	GrantLeaderType = "grant-leader"
)
View Source
const (
	// HotRegionName is balance hot region scheduler name.
	HotRegionName = "balance-hot-region-scheduler"
	// HotRegionType is balance hot region scheduler type.
	HotRegionType = "hot-region"
)
View Source
const (
	// LabelName is label scheduler name.
	LabelName = "label-scheduler"
	// LabelType is label scheduler type.
	LabelType = "label"
)
View Source
const (
	// RandomMergeName is random merge scheduler name.
	RandomMergeName = "random-merge-scheduler"
	// RandomMergeType is random merge scheduler type.
	RandomMergeType = "random-merge"
)
View Source
const (
	// ScatterRangeType is scatter range scheduler type
	ScatterRangeType = "scatter-range"
	// ScatterRangeName is scatter range scheduler name
	ScatterRangeName = "scatter-range"
)
View Source
const (
	// ShuffleHotRegionName is shuffle hot region scheduler name.
	ShuffleHotRegionName = "shuffle-hot-region-scheduler"
	// ShuffleHotRegionType is shuffle hot region scheduler type.
	ShuffleHotRegionType = "shuffle-hot-region"
)
View Source
const (
	// ShuffleLeaderName is shuffle leader scheduler name.
	ShuffleLeaderName = "shuffle-leader-scheduler"
	// ShuffleLeaderType is shuffle leader scheduler type.
	ShuffleLeaderType = "shuffle-leader"
)
View Source
const (
	// ShuffleRegionName is shuffle region scheduler name.
	ShuffleRegionName = "shuffle-region-scheduler"
	// ShuffleRegionType is shuffle region scheduler type.
	ShuffleRegionType = "shuffle-region"
)
View Source
const (
	// SplitBucketName is the split bucket name.
	SplitBucketName = "split-bucket-scheduler"
	// SplitBucketType is the spilt bucket type.
	SplitBucketType = "split-bucket"
)
View Source
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

func BalancePlanSummary(plans []plan.Plan) (map[uint64]plan.Status, bool, error)

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

func Register

func Register()

Register registers schedulers.

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)

Jump to

Keyboard shortcuts

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