Documentation ¶
Index ¶
- func SelectSourceStores(stores []*core.StoreInfo, filters []Filter, opt opt.Options) []*core.StoreInfo
- func SelectTargetStores(stores []*core.StoreInfo, filters []Filter, opt opt.Options) []*core.StoreInfo
- func Source(opt opt.Options, store *core.StoreInfo, filters []Filter) bool
- func Target(opt opt.Options, store *core.StoreInfo, filters []Filter) bool
- type Filter
- type StoreStateFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SelectSourceStores ¶
func SelectSourceStores(stores []*core.StoreInfo, filters []Filter, opt opt.Options) []*core.StoreInfo
SelectSourceStores selects stores that be selected as source store from the list.
func SelectTargetStores ¶
func SelectTargetStores(stores []*core.StoreInfo, filters []Filter, opt opt.Options) []*core.StoreInfo
SelectTargetStores selects stores that be selected as target store from the list.
Types ¶
type Filter ¶
type Filter interface { // Scope is used to indicate where the filter will act on. Scope() string Type() string // Return true if the store should not be used as a source store. Source(opt opt.Options, store *core.StoreInfo) bool // Return true if the store should not be used as a target store. Target(opt opt.Options, store *core.StoreInfo) bool }
Filter is an interface to filter source and target store.
func NewExcludedFilter ¶
NewExcludedFilter creates a Filter that filters all specified stores.
func NewHealthFilter ¶
NewHealthFilter creates a Filter that filters all stores that are Busy or Down.
func NewStateFilter ¶
NewStateFilter creates a Filter that filters all stores that are not UP.
type StoreStateFilter ¶
type StoreStateFilter struct { ActionScope string // Set true if the schedule involves any transfer leader operation. TransferLeader bool // Set true if the schedule involves any move region operation. MoveRegion bool }
StoreStateFilter is used to determine whether a store can be selected as the source or target of the schedule based on the store's state.
func (StoreStateFilter) Scope ¶
func (f StoreStateFilter) Scope() string
Scope returns the scheduler or the checker which the filter acts on.
func (StoreStateFilter) Source ¶
Source returns true when the store cannot be selected as the schedule source.
func (StoreStateFilter) Target ¶
Target returns true when the store cannot be selected as the schedule target.
func (StoreStateFilter) Type ¶
func (f StoreStateFilter) Type() string
Type returns the type of the Filter.