Versions in this module Expand all Collapse all v1 v1.0.0 May 30, 2020 Changes in this version + const BoRegionMiss + const BoTxnLock + const BoUpdateLeader + const DecorrJitter + const EqualJitter + const FullJitter + const GCTimeout + const GcOneRegionMaxBackoff + const GcResolveLockMaxBackoff + const GcSafePointCacheInterval + const GcSavedSafePoint + const NoJitter + const ReadTimeoutLong + const ReadTimeoutMedium + const ResolvedCacheSize + const UnsafeDestroyRangeTimeout + var CommitMaxBackoff = 41000 + var ErrBodyMissing = errors.New("response body is missing") + var ErrGCTooEarly = terror.ClassTiKV.New(mysql.ErrGCTooEarly, mysql.MySQLErrName[mysql.ErrGCTooEarly]) + var ErrMaxScanLimitExceeded = errors.New("limit should be less than MaxRawKVScanLimit") + var ErrPDServerTimeout = terror.ClassTiKV.New(mysql.ErrPDServerTimeout, mysql.MySQLErrName[mysql.ErrPDServerTimeout] + "%v") + var ErrRegionUnavailable = terror.ClassTiKV.New(mysql.ErrRegionUnavailable, ...) + var ErrResolveLockTimeout = terror.ClassTiKV.New(mysql.ErrResolveLockTimeout, ...) + var ErrTiKVServerBusy = terror.ClassTiKV.New(mysql.ErrTiKVServerBusy, ...) + var ErrTiKVServerTimeout = terror.ClassTiKV.New(mysql.ErrTiKVServerTimeout, ...) + var GrpcKeepAliveTime = time.Duration(10) * time.Second + var GrpcKeepAliveTimeout = time.Duration(3) * time.Second + var MaxCallMsgSize = 1<<31 - 1 + var MaxConnectionCount uint = 16 + var MaxRawKVScanLimit = 10240 + var MaxSendMsgSize = 1<<31 - 1 + var NewGCHandlerFunc func(storage Storage, pdClient pd.Client) (GCHandler, error) + func NewBackoffFn(base, cap, jitter int) func(ctx context.Context) int + func NewTestTiKVStore(client Client, pdClient pd.Client, clientHijack func(Client) Client, ...) (kv.Storage, error) + func SplitRegionRanges(bo *Backoffer, cache *RegionCache, keyRanges []kv.KeyRange) ([]kv.KeyRange, error) + type Backoffer struct + func NewBackoffer(ctx context.Context, maxSleep int) *Backoffer + func (b *Backoffer) Backoff(typ backoffType, err error) error + func (b *Backoffer) Clone() *Backoffer + func (b *Backoffer) Fork() (*Backoffer, context.CancelFunc) + func (b *Backoffer) String() string + func (b *Backoffer) WithVars(vars *kv.Variables) *Backoffer + type CachedRegion struct + type Client interface + Close func() error + SendRequest func(ctx context.Context, addr string, req *tikvrpc.Request, timeout time.Duration) (*tikvrpc.Response, error) + type CopClient struct + func (c *CopClient) IsRequestTypeSupported(reqType, subType int64) bool + func (c *CopClient) Send(ctx context.Context, req *kv.Request, vars *kv.Variables) kv.Response + type DeleteRangeTask struct + func NewDeleteRangeTask(ctx context.Context, store Storage, startKey []byte, endKey []byte) *DeleteRangeTask + func (t *DeleteRangeTask) CompletedRegions() int + func (t *DeleteRangeTask) Execute() error + func (t *DeleteRangeTask) IsCanceled() bool + type Driver struct + func (d Driver) Open(path string) (kv.Storage, error) + type EtcdSafePointKV struct + func NewEtcdSafePointKV(addrs []string, tlsConfig *tls.Config) (*EtcdSafePointKV, error) + func (w *EtcdSafePointKV) Get(k string) (string, error) + func (w *EtcdSafePointKV) Put(k string, v string) error + type GCHandler interface + Close func() + Start func() + type KeyLocation struct + EndKey []byte + Region RegionVerID + StartKey []byte + func (l *KeyLocation) Contains(key []byte) bool + type Lock struct + Key []byte + Primary []byte + TTL uint64 + TxnID uint64 + func NewLock(l *kvrpcpb.LockInfo) *Lock + type LockResolver struct + func NewLockResolver(etcdAddrs []string, security config.Security) (*LockResolver, error) + func (lr *LockResolver) GetTxnStatus(txnID uint64, primary []byte) (TxnStatus, error) + func (lr *LockResolver) ResolveLocks(bo *Backoffer, locks []*Lock) (ok bool, err error) + type MockSafePointKV struct + func NewMockSafePointKV() *MockSafePointKV + func (w *MockSafePointKV) Get(k string) (string, error) + func (w *MockSafePointKV) Put(k string, v string) error + type RPCContext struct + Addr string + Meta *metapb.Region + Peer *metapb.Peer + Region RegionVerID + func (c *RPCContext) GetStoreID() uint64 + type RawKVClient struct + func NewRawKVClient(pdAddrs []string, security config.Security) (*RawKVClient, error) + func (c *RawKVClient) BatchDelete(keys [][]byte) error + func (c *RawKVClient) BatchGet(keys [][]byte) ([][]byte, error) + func (c *RawKVClient) BatchPut(keys, values [][]byte) error + func (c *RawKVClient) Close() error + func (c *RawKVClient) ClusterID() uint64 + func (c *RawKVClient) Delete(key []byte) error + func (c *RawKVClient) DeleteRange(startKey []byte, endKey []byte) error + func (c *RawKVClient) Get(key []byte) ([]byte, error) + func (c *RawKVClient) Put(key, value []byte) error + func (c *RawKVClient) Scan(startKey []byte, limit int) (keys [][]byte, values [][]byte, err error) + type Region struct + func (r *Region) Contains(key []byte) bool + func (r *Region) EndKey() []byte + func (r *Region) GetContext() *kvrpcpb.Context + func (r *Region) GetID() uint64 + func (r *Region) StartKey() []byte + func (r *Region) SwitchPeer(storeID uint64) bool + func (r *Region) VerID() RegionVerID + type RegionCache struct + func NewRegionCache(pdClient pd.Client) *RegionCache + func (c *RegionCache) ClearStoreByID(id uint64) + func (c *RegionCache) DropRegion(id RegionVerID) + func (c *RegionCache) DropStoreOnSendRequestFail(ctx *RPCContext, err error) + func (c *RegionCache) GetRPCContext(bo *Backoffer, id RegionVerID) (*RPCContext, error) + func (c *RegionCache) GetStoreAddr(bo *Backoffer, id uint64) (string, error) + func (c *RegionCache) GroupKeysByRegion(bo *Backoffer, keys [][]byte) (map[RegionVerID][][]byte, RegionVerID, error) + func (c *RegionCache) ListRegionIDsInKeyRange(bo *Backoffer, startKey, endKey []byte) (regionIDs []uint64, err error) + func (c *RegionCache) LocateKey(bo *Backoffer, key []byte) (*KeyLocation, error) + func (c *RegionCache) LocateRegionByID(bo *Backoffer, regionID uint64) (*KeyLocation, error) + func (c *RegionCache) OnRegionStale(ctx *RPCContext, newRegions []*metapb.Region) error + func (c *RegionCache) PDClient() pd.Client + func (c *RegionCache) ReloadStoreAddr(bo *Backoffer, id uint64) (string, error) + func (c *RegionCache) UpdateLeader(regionID RegionVerID, leaderStoreID uint64) + type RegionRequestSender struct + func NewRegionRequestSender(regionCache *RegionCache, client Client) *RegionRequestSender + func (s *RegionRequestSender) SendReq(bo *Backoffer, req *tikvrpc.Request, regionID RegionVerID, ...) (*tikvrpc.Response, error) + type RegionVerID struct + func (r *RegionVerID) GetID() uint64 + type SafePointKV interface + Get func(k string) (string, error) + Put func(k string, v string) error + type Scanner struct + func (s *Scanner) Close() + func (s *Scanner) Key() kv.Key + func (s *Scanner) Next() error + func (s *Scanner) Valid() bool + func (s *Scanner) Value() []byte + type Storage interface + Closed func() <-chan struct{} + GetGCHandler func() GCHandler + GetLockResolver func() *LockResolver + GetRegionCache func() *RegionCache + GetSafePointKV func() SafePointKV + GetTiKVClient func() Client + SendReq func(bo *Backoffer, req *tikvrpc.Request, regionID RegionVerID, ...) (*tikvrpc.Response, error) + SetOracle func(oracle oracle.Oracle) + SetTiKVClient func(client Client) + UpdateSPCache func(cachedSP uint64, cachedTime time.Time) + type Store struct + Addr string + ID uint64 + type TxnStatus uint64 + func (s TxnStatus) CommitTS() uint64 + func (s TxnStatus) IsCommitted() bool