Documentation ¶
Index ¶
- Constants
- type BalanceLeaderCreateOption
- type BalanceResourceCreateOption
- type BaseScheduler
- func (s *BaseScheduler) Cleanup(cluster opt.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 opt.Cluster) error
- func (s *BaseScheduler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Influence
Constants ¶
const ( // BalanceLeaderName is balance leader scheduler name. BalanceLeaderName = "balance-leader-scheduler" // BalanceLeaderType is balance leader scheduler type. BalanceLeaderType = "balance-leader" )
const ( // BalanceResourceName is balance resource scheduler name. BalanceResourceName = "balance-resource-scheduler" // BalanceResourceType is balance resource scheduler type. BalanceResourceType = "balance-resource" )
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 ( // GrantLeaderName is grant leader scheduler name. GrantLeaderName = "grant-leader-scheduler" // GrantLeaderType is grant leader scheduler type. GrantLeaderType = "grant-leader" )
const ( // HotResourceName is balance hot resource scheduler name. HotResourceName = "balance-hot-resource-scheduler" // HotResourceType is balance hot resource scheduler type. HotResourceType = "hot-resource" // HotReadResourceType is hot read resource scheduler type. HotReadResourceType = "hot-read-resource" // HotWriteResourceType is hot write resource scheduler type. HotWriteResourceType = "hot-write-resource" )
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 ( // ShuffleHotResourceName is shuffle hot resource scheduler name. ShuffleHotResourceName = "shuffle-hot-resource-scheduler" // ShuffleHotResourceType is shuffle hot resource scheduler type. ShuffleHotResourceType = "shuffle-hot-resource" )
const ( // ShuffleLeaderName is shuffle leader scheduler name. ShuffleLeaderName = "shuffle-leader-scheduler" // ShuffleLeaderType is shuffle leader scheduler type. ShuffleLeaderType = "shuffle-leader" )
const ( // ShuffleResourceName is shuffle resource scheduler name. ShuffleResourceName = "shuffle-resource-scheduler" // ShuffleResourceType is shuffle resource scheduler type. ShuffleResourceType = "shuffle-resource" )
const ( // KB kb KB = 1024 // MB mb MB = 1024 * KB )
Variables ¶
This section is empty.
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 BalanceResourceCreateOption ¶
type BalanceResourceCreateOption func(s *balanceResourceScheduler)
BalanceResourceCreateOption is used to create a scheduler with an option.
func WithBalanceResourceCounter ¶
func WithBalanceResourceCounter(counter *prometheus.CounterVec) BalanceResourceCreateOption
WithBalanceResourceCounter sets the counter for the scheduler.
func WithBalanceResourceName ¶
func WithBalanceResourceName(name string) BalanceResourceCreateOption
WithBalanceResourceName 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)