opt

package
v4.0.0-rc Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RejectLeader is the label property type that suggests a store should not
	// have any region leaders.
	RejectLeader = "reject-leader"
)

Variables

This section is empty.

Functions

func HealthAllowPending

func HealthAllowPending(cluster Cluster) func(*core.RegionInfo) bool

HealthAllowPending returns a function that checks if a region is healthy for scheduling. Differs from HealthRegion, it allows the region to have pending peers.

func HealthRegion

func HealthRegion(cluster Cluster) func(*core.RegionInfo) bool

HealthRegion returns a function that checks if a region is healthy for scheduling. It requires the region does not have any down or pending peers, and does not have any learner peers when placement rules is disabled.

func IsHealthyAllowPending

func IsHealthyAllowPending(cluster Cluster, region *core.RegionInfo) bool

IsHealthyAllowPending checks if a region is healthy for scheduling. Differs from IsRegionHealthy, it allows the region to have pending peers.

func IsRegionHealthy

func IsRegionHealthy(cluster Cluster, region *core.RegionInfo) bool

IsRegionHealthy checks if a region is healthy for scheduling. It requires the region does not have any down or pending peers. And when placement rules feature is disabled, it requires the region does not have any learner peer.

func IsRegionReplicated

func IsRegionReplicated(cluster Cluster, region *core.RegionInfo) bool

IsRegionReplicated checks if a region is fully replicated. When placement rules is enabled, its peers should fit corresponding rules. When placement rules is disabled, it should have enough replicas and no any learner peer.

func ReplicatedRegion

func ReplicatedRegion(cluster Cluster) func(*core.RegionInfo) bool

ReplicatedRegion returns a function that checks if a region is fully replicated.

Types

type Cluster

Cluster provides an overview of a cluster's regions distribution. TODO: This interface should be moved to a better place.

type HeartbeatStream

type HeartbeatStream interface {
	Send(*pdpb.RegionHeartbeatResponse) error
}

HeartbeatStream is an interface.

type HeartbeatStreams

type HeartbeatStreams interface {
	SendMsg(region *core.RegionInfo, msg *pdpb.RegionHeartbeatResponse)
	BindStream(storeID uint64, stream HeartbeatStream)
}

HeartbeatStreams is an interface of async region heartbeat.

type Options

type Options interface {
	GetLeaderScheduleLimit() uint64
	GetRegionScheduleLimit() uint64
	GetReplicaScheduleLimit() uint64
	GetMergeScheduleLimit() uint64
	GetHotRegionScheduleLimit() uint64

	// store limit
	GetStoreBalanceRate() float64

	GetMaxSnapshotCount() uint64
	GetMaxPendingPeerCount() uint64
	GetMaxStoreDownTime() time.Duration
	GetMaxMergeRegionSize() uint64
	GetMaxMergeRegionKeys() uint64
	GetSplitMergeInterval() time.Duration
	IsOneWayMergeEnabled() bool
	IsCrossTableMergeEnabled() bool

	GetMaxReplicas() int
	GetLocationLabels() []string
	GetStrictlyMatchLabel() bool
	IsPlacementRulesEnabled() bool

	GetHotRegionCacheHitsThreshold() int
	GetTolerantSizeRatio() float64
	GetLowSpaceRatio() float64
	GetHighSpaceRatio() float64
	GetSchedulerMaxWaitingOperator() uint64

	IsRemoveDownReplicaEnabled() bool
	IsReplaceOfflineReplicaEnabled() bool
	IsMakeUpReplicaEnabled() bool
	IsRemoveExtraReplicaEnabled() bool
	IsLocationReplacementEnabled() bool
	IsDebugMetricsEnabled() bool
	GetLeaderSchedulePolicy() core.SchedulePolicy
	GetKeyType() core.KeyType

	RemoveScheduler(name string) error

	CheckLabelProperty(typ string, labels []*metapb.StoreLabel) bool
}

Options for schedulers.

Jump to

Keyboard shortcuts

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