# Packages
No description provided by the author
# Functions
CountInJointState count the peers are in joint state.
DiffRegionKeyInfo return the difference of key info between two RegionInfo.
DiffRegionPeersInfo return the difference of peers info between two RegionInfo.
DistinctScore returns the score that the other is distinct from the stores.
EncodeToString overrides hex.EncodeToString implementation.
GenerateRegionGuideFunc is used to generate a RegionGuideFunc.
GetReadQueryNum returns read query num from this QueryStats.
GetWriteQueryNum returns write query num from this QueryStats.
HexRegionKey converts region key to hex format.
HexRegionKeyStr converts region key to hex format.
HotRegionStorePath generate hot region store key for HotRegionStorage.
IsInJointState judges whether the Peer is in joint state.
IsLearner judges whether the Peer's Role is Learner.
IsLearnerOrDemotingVoter judges whether peer role will become Learner.
IsStoreContainLabel return if the store contains the given label.
IsVoter judges whether the Peer's Role is Voter.
IsVoterOrIncomingVoter judges whether peer role will become Voter.
MergeRegions merge a set of RegionInfo by regionKey.
NewBasicCluster creates a BasicCluster.
NewHotRegionsStorage create storage to store hot regions info.
NewKeyRange create a KeyRange with the given start key and end key.
NewPeerInfo creates PeerInfo.
NewRegionInfo creates RegionInfo with region's meta and leader peer.
NewRegionsInfo creates RegionsInfo with tree, regions, leaders and followers.
NewRegionStorage returns a region storage that is used to save regions.
NewScheduleKind creates a schedule kind with resource kind and schedule policy.
NewStorage creates Storage instance with Base.
NewStoreInfo creates StoreInfo with meta data.
NewStoreInfoWithAvailable is create with available and capacity.
NewStoreInfoWithLabel is create a store with specified labels.
NewStoreInfoWithSizeCount is create a store with size and count.
NewStoresInfo create a StoresInfo with map of storeID to StoreInfo.
NewTestRegionInfo creates a RegionInfo for test.
OfflineStore offline a store.
PauseLeaderTransfer prevents the store from been selected as source or target store of TransferLeader.
RandomKindReadQuery returns query stat with random query kind, only used for unit test.
RandomKindWriteQuery returns query stat with random query kind, only used for unit test.
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.
ResetStoreLimit resets the store limit for a store.
ResumeLeaderTransfer cleans a store's pause state.
SetApproximateKeys sets the approximate keys for the region.
SetApproximateSize sets the approximate size for the region.
SetLastHeartbeatTS sets the time of last heartbeat for the store.
SetLastPersistTime updates the time of last persistent.
SetLeaderCount sets the leader count for the store.
SetLeaderSize sets the leader size for the store.
SetLeaderWeight sets the leader weight for the store.
SetNewStoreStats sets the raw statistics information for the store.
SetPeers sets the peers for the region.
SetPendingPeerCount sets the pending peer count for the store.
SetQueryStats sets the query stats for the region.
SetReadBytes sets the read bytes for the region.
SetReadKeys sets the read keys for the region.
SetReadQuery sets the read query for the region, only used for unit test.
SetRegionConfVer sets the config version for the region.
SetRegionCount sets the Region count for the store.
SetRegionSize sets the Region size for the store.
SetRegionVersion sets the version for the region.
SetRegionWeight sets the Region weight for the store.
SetReplicationStatus sets the region's replication status.
SetReportInterval sets the report interval for the region.
SetStoreAddress sets the address for the store.
SetStoreDeployPath sets the deploy path for the store.
SetStoreLabels sets the labels for the store.
SetStoreStartTime sets the start timestamp for the store.
SetStoreStats sets the statistics information for the store.
SetStoreVersion sets the version for the store.
SetWrittenBytes sets the written bytes for the region.
SetWrittenKeys sets the written keys for the region.
SetWrittenQuery sets the write query for the region, only used for unit test.
SlowStoreEvicted marks a store as a slow store and prevents transferring leader to the store.
SlowStoreRecovered cleans the evicted state of a store.
SortedPeersEqual judges whether two sorted `peerSlice` are equal.
SortedPeersStatsEqual judges whether two sorted `peerStatsSlice` are equal.
SplitRegions split a set of RegionInfo by the middle of regionKey.
String converts slice of bytes to string without copy.
StringToKeyType creates a key type with string.
StringToSchedulePolicy creates a schedule policy with string.
TombstoneStore set a store to tombstone.
ToUpperASCIIInplace bytes.ToUpper but zero-cost.
UpStore up a store.
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.
WithEncryptionKeyManager sets EncryptionManager to the Storage.
WithEndKey sets the end key for the region.
WithFlowRoundByDigit set the digit, which use to round to the nearest number.
WithIncConfVer increases the config version of the region.
WithIncVersion increases the version of the region.
WithInterval sets the interval.
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.
WithRegionStorage sets RegionStorage to the Storage.
WithRemoveStorePeer removes the specified peer for the region.
WithReplacePeerStore replaces a peer's storeID with another ID.
WithStartKey sets the start key for the region.
# Constants
ByCount indicates that balance by count.
BySize indicates that balance by size.
EmptyRegionApproximateSize is the region approximate size of an empty region (heartbeat size <= 1MB).
EngineKey is the label key used to indicate engine.
EngineTiFlash is the tiflash value of the engine label.
EngineTiKV indicates the tikv engine in metrics.
Built-in priority level.
ImpossibleFlowSize is an impossible flow size (such as written_bytes, read_keys, etc.) It may be caused by overflow, refer to https://github.com/tikv/pd/issues/3379.
LeaderKind indicates the leader kind resource.
Built-in priority level.
Built-in priority level.
Raw indicates that the key is raw key.
Flags for flow.
RegionKind indicates the region kind resource.
Table indicates that the key is table key.
Txn indicates that the key is txn key.
Flags for flow.
# Variables
HotRegionTypes stands for hot type.
# Structs
BasicCluster provides basic data member and interface for a tikv cluster.
HexRegionMeta is a region meta in the hex format.
HistoryHotRegion wraps hot region info it is storage format of hot_region_storage.
HistoryHotRegions wraps historyHotRegion it will return to tidb.
HotRegionStorage is used to storage hot region info, It will pull the hot region information according to the pullInterval interval.
HotRegionStorageIterator iterates over a historyHotRegion.
KeyRange is a key range.
PeerInfo provides peer information.
RegionInfo records detail region info.
RegionsInfo for export.
RegionStorage is used to save regions.
ScheduleKind distinguishes resources and schedule policy.
ServiceSafePoint is the safepoint for a specific service.
Storage wraps all kv operations, keep it stateless.
StorageOpt represents available options to create Storage.
StoreInfo contains information about a store.
StoresInfo contains information about all stores.
# Interfaces
HotRegionStorageHandler help hot region storage get hot region info.
RegionSetInformer provides access to a shared informer of regions.
StoreSetController is used to control stores' status.
StoreSetInformer provides access to a shared informer of stores.
# Type aliases
HexRegionsMeta is a slice of regions' meta in the hex format.
HotRegionType stands for hot type.
KeyType distinguishes different kinds of key types.
PriorityLevel lower level means higher priority.
RegionCreateOption used to create region.
RegionGuideFunc is a function that determines which follow-up operations need to be performed based on the origin and new region information.
RegionOption is used to select region.
ResourceKind distinguishes different kinds of resources.
SchedulePolicy distinguishes different kinds of schedule policies.
StorageOption configures StorageOpt.
StoreCreateOption is used to create store.