# Functions
DiffRegionKeyInfo return the difference of key info between two RegionInfo.
DiffRegionPeersInfo return the difference of peers info between two RegionInfo.
HealthRegion checks if the region is healthy.
HexRegionKey converts region key to hex format.
MergeRegions merge a set of metapb.Region by regionKey.
NewKV creates KV instance with KVBase.
NewMemoryKV returns an in-memory kvBase for testing.
NewMockIDAllocator create a new MockIDAllocator.
NewRegion create a metapb.Region.
NewRegionInfo creates RegionInfo with region's meta and leader peer.
NewRegionsInfo creates RegionsInfo with tree, regions, leaders and followers.
NewRegionStat returns a RegionStat.
NewRollingStats returns a RollingStats.
NewStoreInfo creates StoreInfo with meta data.
NewStoreNotFoundErr is for log of store not found.
NewStoresInfo create a StoresInfo with map of storeID to StoreInfo.
RegionFromHeartbeat constructs a Region from region heartbeat.
RegionsToHexMeta converts regions' meta keys to hex format.
RegionToHexMeta converts a region meta's keys to hex format.
SetApproximateKeys sets the approximate keys for the region.
SetApproximateSize sets the approximate size for the region.
SetPeers sets the peers for the region.
SetReadBytes sets the read bytes for the region.
SetRegionConfVer sets the config version for the reigon.
SetRegionVersion sets the version for the reigon.
SetWrittenBytes sets the written bytes for the region.
SplitRegions split a set of metapb.Region by the middle of regionKey.
WithAddPeer adds a peer for the region.
WithDecConfVer decreases the config version of the region.
WithDecVersion decreases the version of the region.
WithDownPeers sets the down peers for the region.
WithEndKey sets the end key for the region.
WithIncConfVer increases the config version of the region.
WithIncVersion increases the version of the region.
WithLeader sets the leader for the region.
WithLearners sets the learners for the region.
WithNewPeerIds sets new ids for peers.
WithNewRegionID sets new id for the region.
WithPendingPeers sets the pending peers for the region.
WithPromoteLearner promotes the learner.
WithRemoveStorePeer removes the specified peer for the region.
WithStartKey sets the start key for the region.
# Constants
EmptyRegionApproximateSize is the region approximate size of an empty region (heartbeat size <= 1MB).
Built-in priority level.
LeaderKind indicates the leader kind resource.
Built-in priority level.
Built-in priority level.
RegionKind indicates the region kind resource.
# Variables
StoreBlockedCode is an error due to requesting an operation that is invalid due to a store being in a blocked state.
StoreTombstonedCode is an invalid operation was attempted on a store which is in a removed state.
# Structs
HexRegionMeta is a region meta in the hex format.
HotRegionsStat records all hot regions statistics.
KV wraps all kv operations, keep it stateless.
MockIDAllocator mocks IDAllocator and it is only used for test.
RegionInfo records detail region info.
RegionsInfo for export.
RegionStat records each hot region's statistics.
RegionStats records a list of regions' statistics and distribution status.
RollingStats provides rolling statistics with specified window size.
RollingStoreStats are multiple sets of recent historical records with specified windows size.
StoreErr can be newtyped or embedded in your own error.
StoreHotRegionInfos : used to get human readable description for hot regions.
StoreInfo contains information about a store.
StoresInfo contains information about all stores.
# Interfaces
IDAllocator is the allocator to generate unique ID.
KVBase is an abstract interface for load/save pd cluster data.
# Type aliases
HexRegionsMeta is a slice of regions' meta in the hex format.
PriorityLevel lower level means higher priority.
RegionCreateOption used to create region.
RegionOption is used to select region.
RegionsStat is a list of a group region state type.
ResourceKind distinguishes different kinds of resources.
StoreBlockedErr has a Code() of StoreBlockedCode.
StoreHotRegionsStat used to record the hot region statistics group by store.
StoreTombstonedErr is an invalid operation was attempted on a store which is in a removed state.