selector

package
v0.0.0-...-b3bb260 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RandomSelector

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

RandomSelector selects source/target store randomly.

func (*RandomSelector) SelectSource

func (s *RandomSelector) SelectSource(opt opt.Options, stores []*core.StoreInfo) *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, 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