Versions in this module Expand all Collapse all v1 v1.0.1 Sep 26, 2022 Changes in this version + const TxnRetryableMark + var ErrNotImplemented = errors.New("not implemented") + var ErrPDServerTimeout = errors.New("PD server timeout") + var ErrResultUndetermined = errors.New("result undetermined") + var ErrStartTSFallBehind = errors.New("StartTS may fall behind safePoint") + func SplitRegion(ctx context.Context, store *TiKVStore, splitKey key.Key) error + type CommitDetails struct + CommitTime time.Duration + GetCommitTsTime time.Duration + LocalLatchTime time.Duration + PrewriteRegionNum int32 + PrewriteTime time.Duration + ResolveLockTime int64 + TotalBackoffTime time.Duration + TxnRetry int + WriteKeys int + WriteSize int + type DeleteRangeTask struct + func NewDeleteRangeTask(ctx context.Context, store *TiKVStore, startKey []byte, endKey []byte) *DeleteRangeTask + func (t *DeleteRangeTask) CompletedRegions() int + func (t *DeleteRangeTask) Execute() error + func (t *DeleteRangeTask) IsCanceled() bool + type ErrKeyAlreadyExist key.Key + func (e ErrKeyAlreadyExist) Error() string + 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 ExecDetails struct + BackoffTime time.Duration + CalleeAddress string + CommitDetail *CommitDetails + ProcessTime time.Duration + ProcessedKeys int64 + RequestCount int + TotalKeys int64 + WaitTime time.Duration + func (d ExecDetails) String() string + type Lock struct + Key []byte + Primary []byte + TTL uint64 + TxnID uint64 + func NewLock(l *kvrpcpb.LockInfo, defaultTTL uint64) *Lock + type LockResolver struct + func NewLockResolver(ctx context.Context, etcdAddrs []string, conf config.Config) (*LockResolver, error) + func (lr *LockResolver) BatchResolveLocks(bo *retry.Backoffer, locks []*Lock, loc locate.RegionVerID) (bool, error) + func (lr *LockResolver) GetTxnStatus(ctx context.Context, txnID uint64, primary []byte) (TxnStatus, error) + func (lr *LockResolver) ResolveLocks(bo *retry.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 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() key.Key + func (s *Scanner) Next(ctx context.Context) error + func (s *Scanner) Valid() bool + func (s *Scanner) Value() []byte + type TiKVSnapshot struct + KeyOnly bool + NotFillCache bool + Priority pb.CommandPri + SyncLog bool + func (s *TiKVSnapshot) BatchGet(ctx context.Context, keys []key.Key) (map[string][]byte, error) + func (s *TiKVSnapshot) Get(ctx context.Context, k key.Key) ([]byte, error) + func (s *TiKVSnapshot) Iter(ctx context.Context, k key.Key, upperBound key.Key) (kv.Iterator, error) + func (s *TiKVSnapshot) IterReverse(ctx context.Context, k key.Key) (kv.Iterator, error) + func (s *TiKVSnapshot) SetPriority(priority int) + type TiKVStore struct + func NewStore(ctx context.Context, pdAddrs []string, conf config.Config) (*TiKVStore, error) + func (s *TiKVStore) CheckVisibility(startTS uint64) error + func (s *TiKVStore) Close() error + func (s *TiKVStore) Closed() <-chan struct{} + func (s *TiKVStore) GetConfig() *config.Config + func (s *TiKVStore) GetLockResolver() *LockResolver + func (s *TiKVStore) GetOracle() oracle.Oracle + func (s *TiKVStore) GetRPCClient() rpc.Client + func (s *TiKVStore) GetRegionCache() *locate.RegionCache + func (s *TiKVStore) GetSnapshot(ts uint64) *TiKVSnapshot + func (s *TiKVStore) GetTimestampWithRetry(bo *retry.Backoffer) (uint64, error) + func (s *TiKVStore) GetTxnLatches() *latch.LatchesScheduler + func (s *TiKVStore) SendReq(bo *retry.Backoffer, req *rpc.Request, regionID locate.RegionVerID, ...) (*rpc.Response, error) + type TxnCommitter struct + ConnID uint64 + Priority pb.CommandPri + SyncLog bool + func NewTxnCommitter(store *TiKVStore, startTS uint64, startTime time.Time, ...) (*TxnCommitter, error) + func (c *TxnCommitter) Execute(ctx context.Context) error + func (c *TxnCommitter) GetCommitTS() uint64 + func (c *TxnCommitter) GetKeys() [][]byte + type TxnStatus uint64 + func (s TxnStatus) CommitTS() uint64 + func (s TxnStatus) IsCommitted() bool