selector

package
v4.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceSelector

type BalanceSelector struct {
	// contains filtered or unexported fields
}

BalanceSelector selects source/target from store candidates based on their resource scores.

func NewBalanceSelector

func NewBalanceSelector(kind core.ScheduleKind, filters []filter.Filter) *BalanceSelector

NewBalanceSelector creates a BalanceSelector instance.

func (*BalanceSelector) SelectSource

func (s *BalanceSelector) SelectSource(opt opt.Options, stores []*core.StoreInfo, filters ...filter.Filter) *core.StoreInfo

SelectSource selects the store that can pass all filters and has the maximal resource score.

func (*BalanceSelector) SelectTarget

func (s *BalanceSelector) SelectTarget(opt opt.Options, stores []*core.StoreInfo, filters ...filter.Filter) *core.StoreInfo

SelectTarget selects the store that can pass all filters and has the minimal resource score.

type RandomSelector

type RandomSelector struct {
	// contains filtered or unexported fields
}

RandomSelector selects source/target store randomly.

func NewRandomSelector

func NewRandomSelector(filters []filter.Filter) *RandomSelector

NewRandomSelector creates a RandomSelector instance.

func (*RandomSelector) SelectSource

func (s *RandomSelector) SelectSource(opt opt.Options, stores []*core.StoreInfo, filters ...filter.Filter) *core.StoreInfo

SelectSource randomly selects a source store from those can pass all filters.

func (*RandomSelector) SelectTarget

func (s *RandomSelector) SelectTarget(opt opt.Options, stores []*core.StoreInfo, filters ...filter.Filter) *core.StoreInfo

SelectTarget randomly selects a target store from those can pass all filters.

type ReplicaSelector

type ReplicaSelector struct {
	// contains filtered or unexported fields
}

ReplicaSelector selects source/target store candidates based on their distinct scores based on a region's peer stores.

func NewReplicaSelector

func NewReplicaSelector(regionStores []*core.StoreInfo, labels []string, filters ...filter.Filter) *ReplicaSelector

NewReplicaSelector creates a ReplicaSelector instance.

func (*ReplicaSelector) SelectSource

func (s *ReplicaSelector) SelectSource(opt opt.Options, stores []*core.StoreInfo) *core.StoreInfo

SelectSource selects the store that can pass all filters and has the minimal distinct score.

func (*ReplicaSelector) SelectTarget

func (s *ReplicaSelector) SelectTarget(opt opt.Options, stores []*core.StoreInfo, filters ...filter.Filter) *core.StoreInfo

SelectTarget selects the store that can pass all filters and has the maximal distinct score.

Jump to

Keyboard shortcuts

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