# Functions
GetKeyspaceID attempts to retrieve keyspace ID corresponding to the given keyspace name from PD.
GetStoreLivenessTimeout returns storeLivenessTimeout.
IsFakeRegionError returns true if err is fake region error.
LoadShuttingDown atomically loads ShuttingDown.
NewCodecPDClient creates a CodecPDClient in API v1.
NewCodecPDClientWithKeyspace creates a CodecPDClient in API v2 with keyspace name.
NewRegionCache creates a RegionCache.
NewRegionRequestRuntimeStats returns a new RegionRequestRuntimeStats.
NewRegionRequestSender creates a new sender.
NewRegionVerID creates a region ver id, which used for invalidating regions.
NewRPCanceller creates RPCCanceller with init state.
NewSortedRegions returns a new SortedRegions.
RecordRegionRequestRuntimeStats records request runtime stats.
SetRegionCacheTTLSec sets regionCacheTTLSec to t.
SetStoreLivenessTimeout sets storeLivenessTimeout to t.
StoreShuttingDown atomically stores ShuttingDown into v.
WithLeaderOnly indicates selecting stores with leader only.
WithMatchLabels indicates selecting stores with matched labels.
WithMatchStores indicates selecting stores with matched store ids.
WithPerferLeader indicates selecting stores with leader as priority until leader unaccessible.
# Constants
EpochNotMatch indicates it's invalidated due to epoch not match.
NoLeader indicates it's invalidated due to no leader.
Ok indicates the cached region is valid.
Other indicates it's invalidated due to other reasons, e.g., the store is removed from the cluster, fail to send requests to the store.
RegionNotFound indicates it's invalidated due to region not found in the store.
StoreNotFound indicates it's invalidated due to store not found in PD.
# Variables
LabelFilterAllNode will select all stores.
LabelFilterAllTiFlashNode will select all tiflash stores.
LabelFilterNoTiFlashWriteNode will only select stores whose label contains: <engine, tiflash>, but not contains <engine_role, write>.
LabelFilterOnlyTiFlashWriteNode will only select stores whose label contains: <engine, tiflash> and <engine_role, write>.
# Structs
Bucket is a single bucket of a region.
CodecPDClient wraps a PD Client to decode the encoded keys in region meta.
CountSlidingWindow represents the statistics on a bunch of sliding windows.
KeyLocation is the region and range that a key is located.
Region presents kv region.
RegionCache caches Regions loaded from PD.
RegionRequestRuntimeStats records the runtime stats of send region requests.
RegionRequestSender sends KV/Cop requests to tikv server.
RegionVerID is a unique ID that can identify a Region at a specific version.
RPCCanceller is rpc send cancelFunc collector.
RPCCancellerCtxKey is context key attach rpc send cancelFunc collector to ctx.
RPCContext contains data that is needed to send RPC to a region.
RPCRuntimeStats indicates the RPC request count and consume time.
SlowScoreStat represents the statistics on business of Store.
SortedRegions is a sorted btree.
Store contains a kv process's address.
# Type aliases
AccessIndex represent the index for accessIndex array.
InvalidReason is the reason why a cached region is invalidated.
LabelFilter returns false means label doesn't match, and will ignore this store.
StoreSelectorOption configures storeSelectorOp.