Versions in this module Expand all Collapse all v1 v1.0.9 Apr 20, 2018 Changes in this version + const FlagIgnoreTruncate + const FlagTruncateAsWarning + var ErrInvalidEncodedKey = errors.New("invalid encoded key") + func BootstrapWithMultiRegions(cluster *Cluster, splitKeys ...[]byte) (storeID uint64, regionIDs, peerIDs []uint64) + func BootstrapWithMultiStores(cluster *Cluster, n int) (storeIDs, peerIDs []uint64, regionID uint64, leaderPeer uint64) + func BootstrapWithSingleStore(cluster *Cluster) (storeID, peerID, regionID uint64) + func NewPDClient(cluster *Cluster) pd.Client + type Cluster struct + func NewCluster() *Cluster + func (c *Cluster) AddPeer(regionID, storeID, peerID uint64) + func (c *Cluster) AddStore(storeID uint64, addr string) + func (c *Cluster) AllocID() uint64 + func (c *Cluster) AllocIDs(n int) []uint64 + func (c *Cluster) Bootstrap(regionID uint64, storeIDs, peerIDs []uint64, leaderStoreID uint64) + func (c *Cluster) CancelStore(storeID uint64) + func (c *Cluster) ChangeLeader(regionID, leaderStoreID uint64) + func (c *Cluster) GetAllRegions() []*Region + func (c *Cluster) GetAndCheckStoreByAddr(addr string) (*metapb.Store, error) + func (c *Cluster) GetRegion(regionID uint64) (*metapb.Region, uint64) + func (c *Cluster) GetRegionByID(regionID uint64) (*metapb.Region, *metapb.Peer) + func (c *Cluster) GetRegionByKey(key []byte) (*metapb.Region, *metapb.Peer) + func (c *Cluster) GetStore(storeID uint64) *metapb.Store + func (c *Cluster) GetStoreByAddr(addr string) *metapb.Store + func (c *Cluster) GiveUpLeader(regionID uint64) + func (c *Cluster) Merge(regionID1, regionID2 uint64) + func (c *Cluster) RemovePeer(regionID, storeID uint64) + func (c *Cluster) RemoveStore(storeID uint64) + func (c *Cluster) Split(regionID, newRegionID uint64, key []byte, peerIDs []uint64, ...) + func (c *Cluster) SplitIndex(mvccStore *MvccStore, tableID, indexID int64, count int) + func (c *Cluster) SplitRaw(regionID, newRegionID uint64, rawKey []byte, peerIDs []uint64, ...) + func (c *Cluster) SplitTable(mvccStore *MvccStore, tableID int64, count int) + func (c *Cluster) StartStore(storeID uint64) + func (c *Cluster) StopStore(storeID uint64) + func (c *Cluster) UnCancelStore(storeID uint64) + func (c *Cluster) UpdateStoreAddr(storeID uint64, addr string) + type ErrAbort string + func (e ErrAbort) Error() string + type ErrAlreadyCommitted uint64 + func (e ErrAlreadyCommitted) Error() string + type ErrLocked struct + Key MvccKey + Primary []byte + StartTS uint64 + TTL uint64 + func (e *ErrLocked) Error() string + type ErrRetryable string + func (e ErrRetryable) Error() string + type Iterator struct + func (iter *Iterator) Next() + func (iter *Iterator) Valid() bool + type MVCCDebugger interface + MvccGetByKey func(key []byte) *kvrpcpb.MvccInfo + MvccGetByStartTS func(startKey, endKey []byte, starTS uint64) (*kvrpcpb.MvccInfo, []byte) + type MVCCLevelDB struct + func NewMVCCLevelDB(path string) (*MVCCLevelDB, error) + func (mvcc *MVCCLevelDB) BatchGet(ks [][]byte, startTS uint64, isoLevel kvrpcpb.IsolationLevel) []Pair + func (mvcc *MVCCLevelDB) Cleanup(key []byte, startTS uint64) error + func (mvcc *MVCCLevelDB) Close() error + func (mvcc *MVCCLevelDB) Commit(keys [][]byte, startTS, commitTS uint64) error + func (mvcc *MVCCLevelDB) Get(key []byte, startTS uint64, isoLevel kvrpcpb.IsolationLevel) ([]byte, error) + func (mvcc *MVCCLevelDB) Prewrite(mutations []*kvrpcpb.Mutation, primary []byte, startTS uint64, ttl uint64) []error + func (mvcc *MVCCLevelDB) ResolveLock(startKey, endKey []byte, startTS, commitTS uint64) error + func (mvcc *MVCCLevelDB) ReverseScan(startKey, endKey []byte, limit int, startTS uint64, ...) []Pair + func (mvcc *MVCCLevelDB) Rollback(keys [][]byte, startTS uint64) error + func (mvcc *MVCCLevelDB) Scan(startKey, endKey []byte, limit int, startTS uint64, ...) []Pair + func (mvcc *MVCCLevelDB) ScanLock(startKey, endKey []byte, maxTS uint64) ([]*kvrpcpb.LockInfo, error) + type MVCCStore interface + BatchGet func(ks [][]byte, startTS uint64, isoLevel kvrpcpb.IsolationLevel) []Pair + Cleanup func(key []byte, startTS uint64) error + Commit func(keys [][]byte, startTS, commitTS uint64) error + Get func(key []byte, startTS uint64, isoLevel kvrpcpb.IsolationLevel) ([]byte, error) + Prewrite func(mutations []*kvrpcpb.Mutation, primary []byte, startTS uint64, ttl uint64) []error + ResolveLock func(startKey, endKey []byte, startTS, commitTS uint64) error + ReverseScan func(startKey, endKey []byte, limit int, startTS uint64, ...) []Pair + Rollback func(keys [][]byte, startTS uint64) error + Scan func(startKey, endKey []byte, limit int, startTS uint64, ...) []Pair + ScanLock func(startKey, endKey []byte, maxTS uint64) ([]*kvrpcpb.LockInfo, error) + type MvccKey []byte + func NewMvccKey(key []byte) MvccKey + func (key MvccKey) Raw() []byte + type MvccStore struct + func NewMvccStore() *MvccStore + func (s *MvccStore) BatchGet(ks [][]byte, startTS uint64, isoLevel kvrpcpb.IsolationLevel) []Pair + func (s *MvccStore) Cleanup(key []byte, startTS uint64) error + func (s *MvccStore) Commit(keys [][]byte, startTS, commitTS uint64) error + func (s *MvccStore) Get(key []byte, startTS uint64, isoLevel kvrpcpb.IsolationLevel) ([]byte, error) + func (s *MvccStore) MvccGetByKey(key []byte) *kvrpcpb.MvccInfo + func (s *MvccStore) MvccGetByStartTS(startKey, endKey []byte, starTS uint64) (*kvrpcpb.MvccInfo, []byte) + func (s *MvccStore) Prewrite(mutations []*kvrpcpb.Mutation, primary []byte, startTS uint64, ttl uint64) []error + func (s *MvccStore) RawDelete(key []byte) + func (s *MvccStore) RawGet(key []byte) []byte + func (s *MvccStore) RawPut(key, value []byte) + func (s *MvccStore) RawScan(startKey, endKey []byte, limit int) []Pair + func (s *MvccStore) ResolveLock(startKey, endKey []byte, startTS, commitTS uint64) error + func (s *MvccStore) ReverseScan(startKey, endKey []byte, limit int, startTS uint64, ...) []Pair + func (s *MvccStore) Rollback(keys [][]byte, startTS uint64) error + func (s *MvccStore) Scan(startKey, endKey []byte, limit int, startTS uint64, ...) []Pair + func (s *MvccStore) ScanLock(startKey, endKey []byte, maxTS uint64) ([]*kvrpcpb.LockInfo, error) + type Pair struct + Err error + Key []byte + Value []byte + type RPCClient struct + Cluster *Cluster + MvccStore MVCCStore + func NewRPCClient(cluster *Cluster, mvccStore MVCCStore) *RPCClient + func (c *RPCClient) Close() error + func (c *RPCClient) SendReq(ctx goctx.Context, addr string, req *tikvrpc.Request) (*tikvrpc.Response, error) + type RawKV interface + RawDelete func(key []byte) + RawGet func(key []byte) []byte + RawPut func(key, value []byte) + RawScan func(startKey, endKey []byte, limit int) []Pair + type Region struct + Meta *metapb.Region + type Store struct