Documentation ¶
Index ¶
- Constants
- func HealthAllowPending(cluster Cluster) func(*core.RegionInfo) bool
- func HealthRegion(cluster Cluster) func(*core.RegionInfo) bool
- func IsHealthyAllowPending(cluster Cluster, region *core.RegionInfo) bool
- func IsRegionHealthy(cluster Cluster, region *core.RegionInfo) bool
- func IsRegionReplicated(cluster Cluster, region *core.RegionInfo) bool
- func ReplicatedRegion(cluster Cluster) func(*core.RegionInfo) bool
- type Cluster
- type HeartbeatStream
- type HeartbeatStreams
- type Options
Constants ¶
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 ¶
type Cluster interface { core.RegionSetInformer core.StoreSetInformer core.StoreSetController statistics.RegionStatInformer statistics.StoreStatInformer Options AllocID() (uint64, error) FitRegion(*core.RegionInfo) *placement.RegionFit RemoveScheduler(name string) error }
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 GetStoreLimitByType(storeID uint64, typ storelimit.Type) float64 SetAllStoresLimit(typ storelimit.Type, ratePerMin 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 CheckLabelProperty(typ string, labels []*metapb.StoreLabel) bool }
Options for schedulers.