schedulers

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// AdjacentRegionName is balance adjacent region scheduler name.
	AdjacentRegionName = "balance-adjacent-region-scheduler"
	// AdjacentRegionType is balance adjacent region scheduler type.
	AdjacentRegionType = "adjacent-region"
)
View Source
const (
	// BalanceLeaderName is balance leader scheduler name.
	BalanceLeaderName = "balance-leader-scheduler"
	// BalanceLeaderType is balance leader scheduler type.
	BalanceLeaderType = "balance-leader"
)
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 (
	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 (
	// 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"
	// HotReadRegionType is hot read region scheduler type.
	HotReadRegionType = "hot-read-region"
	// HotWriteRegionType is hot write region scheduler type.
	HotWriteRegionType = "hot-write-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"
)

Variables

View Source
var (
	// ErrSchedulerExisted is error info for scheduler has already existed.
	ErrSchedulerExisted = errors.New("scheduler existed")
	// ErrSchedulerNotFound is error info for scheduler is not found.
	ErrSchedulerNotFound = errors.New("scheduler not found")
	// ErrScheduleConfigNotExist the config is not correct.
	ErrScheduleConfigNotExist = errors.New("the config does not exist")
)

Functions

This section is empty.

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 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 opt.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 opt.Cluster) error

Prepare does some prepare work

func (*BaseScheduler) ServeHTTP

func (s *BaseScheduler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Influence

type Influence struct {
	ByteRate float64
	KeyRate  float64
	Count    float64
}

Influence records operator influence.

Jump to

Keyboard shortcuts

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