Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2017 Changes in this version + const DecorrJitter + const EqualJitter + const FullJitter + const NoJitter + var ErrMaxScanLimitExceeded = errors.New("limit should be less than MaxRawKVScanLimit") + var ErrPDServerTimeout = terror.ClassTiKV.New(mysql.ErrPDServerTimeout, ...) + var ErrRegionUnavaiable = terror.ClassTiKV.New(mysql.ErrRegionUnavaiable, ...) + var ErrResolveLockTimeout = terror.ClassTiKV.New(mysql.ErrResolveLockTimeout, ...) + var ErrTiKVServerBusy = terror.ClassTiKV.New(mysql.ErrTiKVServerBusy, ...) + var ErrTiKVServerTimeout = terror.ClassTiKV.New(mysql.ErrTiKVServerTimeout, ...) + var MaxRawKVScanLimit = 10240 + func NewBackoffFn(base, cap, jitter int) func() int + func NewMockTikvStore(options ...MockTiKVStoreOption) (kv.Storage, error) + func ParseEtcdAddr(path string) (etcdAddrs []string, err error) + func RunGCJob(ctx goctx.Context, store kv.Storage, safePoint uint64, identifier string) error + type Backoffer struct + func NewBackoffer(maxSleep int, ctx goctx.Context) *Backoffer + func (b *Backoffer) Backoff(typ backoffType, err error) error + func (b *Backoffer) Clone() *Backoffer + func (b *Backoffer) Fork() (*Backoffer, goctx.CancelFunc) + func (b *Backoffer) String() string + type CachedRegion struct + type Client interface + Close func() error + SendReq func(ctx goctx.Context, addr string, req *tikvrpc.Request) (*tikvrpc.Response, error) + type CopClient struct + func (c *CopClient) IsRequestTypeSupported(reqType, subType int64) bool + func (c *CopClient) Send(ctx goctx.Context, req *kv.Request) kv.Response + type Driver struct + func (d Driver) Open(path string) (kv.Storage, error) + type EtcdSafePointKV struct + func NewEtcdSafePointKV(addrs []string) (*EtcdSafePointKV, error) + func (w *EtcdSafePointKV) Get(k string) (string, error) + func (w *EtcdSafePointKV) Put(k string, v string) error + type GCWorker struct + func NewGCWorker(store kv.Storage, enableGC bool) (*GCWorker, error) + func (w *GCWorker) Close() + func (w *GCWorker) StartSafePointChecker() + 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 + type LockResolver struct + func NewLockResolver(etcdAddrs []string) (*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 MockDriver struct + func (d MockDriver) Open(path string) (kv.Storage, error) + type MockGCWorker struct + func NewMockGCWorker(store kv.Storage) (*MockGCWorker, error) + func (w *MockGCWorker) DeleteRanges(ctx goctx.Context, safePoint uint64) 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 MockTiKVStoreOption func(*mockOptions) + func WithCluster(cluster *mocktikv.Cluster) MockTiKVStoreOption + func WithHijackClient(wrap func(Client) Client) MockTiKVStoreOption + func WithHijackPDClient(wrap func(pd.Client) pd.Client) MockTiKVStoreOption + func WithMVCCStore(store mocktikv.MVCCStore) MockTiKVStoreOption + func WithPath(path string) MockTiKVStoreOption + 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) (*RawKVClient, error) + func (c *RawKVClient) Close() error + func (c *RawKVClient) ClusterID() uint64 + func (c *RawKVClient) Delete(key []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) OnRequestFail(storeID uint64) bool + 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) GetCachedRegion(id RegionVerID) *Region + 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) OnRequestFail(ctx *RPCContext, err 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 + 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 Store struct + Addr string + ID uint64 + type TxnStatus uint64 + func (s TxnStatus) CommitTS() uint64 + func (s TxnStatus) IsCommitted() bool