Documentation ¶
Index ¶
- Constants
- Variables
- func GetTS() (int64, int64)
- func InternalRegionMetaKey(regionID uint64) []byte
- func NewDBWriter(bundle *mvcc.DBBundle) mvcc.DBWriter
- type Detector
- type DetectorClient
- type DetectorServer
- type GCCompactionFilter
- type InnerServer
- type LockPair
- type MPPTaskHandlerMap
- type MVCCStore
- func (store *MVCCStore) BatchGet(reqCtx *requestCtx, keys [][]byte, version uint64) []*kvrpcpb.KvPair
- func (store *MVCCStore) CheckKeysLock(startTS uint64, resolved, committed []uint64, keys ...[]byte) ([]*LockPair, error)
- func (store *MVCCStore) CheckKeysLockForRcCheckTS(startTS uint64, resolved []uint64, keys ...[]byte) error
- func (store *MVCCStore) CheckRangeLock(startTS uint64, startKey, endKey []byte, resolved []uint64) error
- func (store *MVCCStore) CheckSecondaryLocks(reqCtx *requestCtx, keys [][]byte, startTS uint64) (SecondaryLocksStatus, error)
- func (store *MVCCStore) CheckTxnStatus(reqCtx *requestCtx, req *kvrpcpb.CheckTxnStatusRequest) (txnStatusRes TxnStatus, err error)
- func (store *MVCCStore) Cleanup(reqCtx *requestCtx, key []byte, startTS, currentTs uint64) error
- func (store *MVCCStore) Close() error
- func (store *MVCCStore) Commit(req *requestCtx, keys [][]byte, startTS, commitTS uint64) error
- func (store *MVCCStore) DeleteFileInRange(start, end []byte)
- func (store *MVCCStore) Flush(reqCtx *requestCtx, req *kvrpcpb.FlushRequest) error
- func (store *MVCCStore) Get(reqCtx *requestCtx, key []byte, version uint64) ([]byte, error)
- func (store *MVCCStore) MvccGetByKey(reqCtx *requestCtx, key []byte) (*kvrpcpb.MvccInfo, error)
- func (store *MVCCStore) MvccGetByStartTs(reqCtx *requestCtx, startTs uint64) (*kvrpcpb.MvccInfo, []byte, error)
- func (store *MVCCStore) PessimisticLock(reqCtx *requestCtx, req *kvrpcpb.PessimisticLockRequest, ...) (*lockwaiter.Waiter, error)
- func (store *MVCCStore) PessimisticRollback(reqCtx *requestCtx, req *kvrpcpb.PessimisticRollbackRequest) error
- func (store *MVCCStore) PessimisticRollbackWithScanFirst(reqCtx *requestCtx, req *kvrpcpb.PessimisticRollbackRequest) error
- func (store *MVCCStore) PhysicalScanLock(startKey []byte, maxTS uint64, limit int) []*kvrpcpb.LockInfo
- func (store *MVCCStore) Prewrite(reqCtx *requestCtx, req *kvrpcpb.PrewriteRequest) error
- func (store *MVCCStore) ReadBufferFromLock(startTS uint64, keys ...[]byte) []*kvrpcpb.KvPair
- func (store *MVCCStore) ResolveLock(reqCtx *requestCtx, lockKeys [][]byte, startTS, commitTS uint64) error
- func (store *MVCCStore) Rollback(reqCtx *requestCtx, keys [][]byte, startTS uint64) error
- func (store *MVCCStore) Scan(reqCtx *requestCtx, req *kvrpcpb.ScanRequest) []*kvrpcpb.KvPair
- func (store *MVCCStore) ScanLock(reqCtx *requestCtx, maxTS uint64, limit int) ([]*kvrpcpb.LockInfo, error)
- func (store *MVCCStore) StartDeadlockDetection(isRaft bool)
- func (store *MVCCStore) TxnHeartBeat(reqCtx *requestCtx, req *kvrpcpb.TxnHeartBeatRequest) (lockTTL uint64, err error)
- func (store *MVCCStore) UpdateSafePoint(safePoint uint64)
- type MockPD
- func (pd *MockPD) AllocID(ctx context.Context) (uint64, error)
- func (pd *MockPD) AskBatchSplit(ctx context.Context, region *metapb.Region, count int) (*pdpb.AskBatchSplitResponse, error)
- func (pd *MockPD) AskSplit(ctx context.Context, region *metapb.Region) (*pdpb.AskSplitResponse, error)
- func (pd *MockPD) Bootstrap(ctx context.Context, store *metapb.Store, region *metapb.Region) (*pdpb.BootstrapResponse, error)
- func (pd *MockPD) Close()
- func (pd *MockPD) GetAllStores(ctx context.Context, opts ...pdclient.GetStoreOption) ([]*metapb.Store, error)
- func (pd *MockPD) GetClusterID(ctx context.Context) uint64
- func (pd *MockPD) GetExternalTimestamp(ctx context.Context) (uint64, error)
- func (pd *MockPD) GetGCSafePoint(ctx context.Context) (uint64, error)
- func (pd *MockPD) GetPrevRegion(ctx context.Context, key []byte, opts ...pdclient.GetRegionOption) (*pdclient.Region, error)
- func (pd *MockPD) GetRegion(ctx context.Context, key []byte, opts ...pdclient.GetRegionOption) (*pdclient.Region, error)
- func (pd *MockPD) GetRegionByID(ctx context.Context, regionID uint64, opts ...pdclient.GetRegionOption) (*pdclient.Region, error)
- func (pd *MockPD) GetStore(ctx context.Context, storeID uint64) (*metapb.Store, error)
- func (pd *MockPD) GetTS(ctx context.Context) (int64, int64, error)
- func (pd *MockPD) IsBootstrapped(ctx context.Context) (bool, error)
- func (pd *MockPD) PutStore(ctx context.Context, store *metapb.Store) error
- func (pd *MockPD) ReportBatchSplit(ctx context.Context, regions []*metapb.Region) error
- func (pd *MockPD) ReportRegion(*pdpb.RegionHeartbeatRequest)
- func (pd *MockPD) ScanRegions(ctx context.Context, startKey []byte, endKey []byte, limit int, ...) ([]*pdclient.Region, error)
- func (pd *MockPD) ScatterRegion(ctx context.Context, regionID uint64) error
- func (pd *MockPD) SetExternalTimestamp(ctx context.Context, newTimestamp uint64) error
- func (pd *MockPD) SetRegionHeartbeatResponseHandler(h func(*pdpb.RegionHeartbeatResponse))
- func (pd *MockPD) StoreHeartbeat(ctx context.Context, stats *pdpb.StoreStats) error
- func (pd *MockPD) UpdateGCSafePoint(ctx context.Context, safePoint uint64) (uint64, error)
- type MockRegionManager
- func (rm *MockRegionManager) AddPeer(regionID, storeID, peerID uint64)
- func (rm *MockRegionManager) AddStore(storeID uint64, addr string, labels ...*metapb.StoreLabel)
- func (rm *MockRegionManager) AllocID() uint64
- func (rm *MockRegionManager) AllocIDs(n int) []uint64
- func (rm *MockRegionManager) Bootstrap(stores []*metapb.Store, region *metapb.Region) error
- func (rm *MockRegionManager) Close() error
- func (rm *MockRegionManager) GetAllStores() []*metapb.Store
- func (rm *MockRegionManager) GetRegion(id uint64) *metapb.Region
- func (rm *MockRegionManager) GetRegionByEndKey(key []byte) (region *metapb.Region, peer *metapb.Peer)
- func (rm *MockRegionManager) GetRegionByKey(key []byte) (region *metapb.Region, peer *metapb.Peer, buckets *metapb.Buckets, ...)
- func (rm *MockRegionManager) GetRegionFromCtx(ctx *kvrpcpb.Context) (RegionCtx, *errorpb.Error)
- func (rm *MockRegionManager) GetStoreAddrByStoreID(storeID uint64) (string, error)
- func (rm *MockRegionManager) GetStoreIDByAddr(addr string) (uint64, error)
- func (rm *MockRegionManager) GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error)
- func (rm *MockRegionManager) IsBootstrapped() (bool, error)
- func (rm *MockRegionManager) RemoveStore(storeID uint64)
- func (rm *MockRegionManager) ScanRegions(startKey, endKey []byte, limit int, _ ...pdclient.GetRegionOption) []*pdclient.Region
- func (rm *MockRegionManager) Split(regionID, newRegionID uint64, key []byte, peerIDs []uint64, ...)
- func (rm *MockRegionManager) SplitArbitrary(keys ...[]byte)
- func (rm *MockRegionManager) SplitIndex(tableID, indexID int64, count int)
- func (rm *MockRegionManager) SplitKeys(start, end kv.Key, count int)
- func (rm *MockRegionManager) SplitRaw(regionID, newRegionID uint64, rawKey []byte, peerIDs []uint64, ...) *metapb.Region
- func (rm *MockRegionManager) SplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpcpb.SplitRegionResponse
- func (rm *MockRegionManager) SplitTable(tableID int64, count int)
- type RegionCtx
- type RegionError
- type RegionManager
- type RegionOptions
- type SafePoint
- type SecondaryLocksStatus
- type Server
- func (svr *Server) BatchCommands(stream tikvpb.Tikv_BatchCommandsServer) error
- func (svr *Server) BatchCoprocessor(req *coprocessor.BatchRequest, ...) error
- func (svr *Server) BatchRaft(stream tikvpb.Tikv_BatchRaftServer) error
- func (svr *Server) CancelMPPTask(_ context.Context, _ *mpp.CancelTaskRequest) (*mpp.CancelTaskResponse, error)
- func (svr *Server) CheckLeader(context.Context, *kvrpcpb.CheckLeaderRequest) (*kvrpcpb.CheckLeaderResponse, error)
- func (svr *Server) CheckLockObserver(context.Context, *kvrpcpb.CheckLockObserverRequest) (*kvrpcpb.CheckLockObserverResponse, error)
- func (svr *Server) Compact(ctx context.Context, req *kvrpcpb.CompactRequest) (*kvrpcpb.CompactResponse, error)
- func (svr *Server) Coprocessor(ctx context.Context, req *coprocessor.Request) (*coprocessor.Response, error)
- func (svr *Server) CoprocessorStream(*coprocessor.Request, tikvpb.Tikv_CoprocessorStreamServer) error
- func (svr *Server) CreateMPPTaskHandler(meta *mpp.TaskMeta, storeID uint64) (*cophandler.MPPTaskHandler, error)
- func (svr *Server) Detect(stream deadlockPb.Deadlock_DetectServer) error
- func (svr *Server) DispatchMPPTask(_ context.Context, _ *mpp.DispatchTaskRequest) (*mpp.DispatchTaskResponse, error)
- func (svr *Server) DispatchMPPTaskWithStoreID(ctx context.Context, req *mpp.DispatchTaskRequest, storeID uint64) (*mpp.DispatchTaskResponse, error)
- func (svr *Server) EstablishMPPConnection(*mpp.EstablishMPPConnectionRequest, tikvpb.Tikv_EstablishMPPConnectionServer) error
- func (svr *Server) EstablishMPPConnectionWithStoreID(req *mpp.EstablishMPPConnectionRequest, ...) error
- func (svr *Server) GetLockWaitHistory(context.Context, *kvrpcpb.GetLockWaitHistoryRequest) (*kvrpcpb.GetLockWaitHistoryResponse, error)
- func (svr *Server) GetLockWaitInfo(context.Context, *kvrpcpb.GetLockWaitInfoRequest) (*kvrpcpb.GetLockWaitInfoResponse, error)
- func (svr *Server) GetMPPTaskHandler(taskID int64, storeID uint64) (*cophandler.MPPTaskHandler, error)
- func (svr *Server) GetStoreAddrByStoreID(storeID uint64) (string, error)
- func (svr *Server) GetStoreIDByAddr(addr string) (uint64, error)
- func (svr *Server) GetStoreSafeTS(context.Context, *kvrpcpb.StoreSafeTSRequest) (*kvrpcpb.StoreSafeTSResponse, error)
- func (svr *Server) GetWaitForEntries(ctx context.Context, req *deadlockPb.WaitForEntriesRequest) (*deadlockPb.WaitForEntriesResponse, error)
- func (svr *Server) IsAlive(_ context.Context, _ *mpp.IsAliveRequest) (*mpp.IsAliveResponse, error)
- func (svr *Server) KVPessimisticRollback(ctx context.Context, req *kvrpcpb.PessimisticRollbackRequest) (*kvrpcpb.PessimisticRollbackResponse, error)
- func (svr *Server) KvBatchGet(ctx context.Context, req *kvrpcpb.BatchGetRequest) (*kvrpcpb.BatchGetResponse, error)
- func (svr *Server) KvBatchRollback(ctx context.Context, req *kvrpcpb.BatchRollbackRequest) (*kvrpcpb.BatchRollbackResponse, error)
- func (svr *Server) KvBufferBatchGet(ctx context.Context, req *kvrpcpb.BufferBatchGetRequest) (*kvrpcpb.BufferBatchGetResponse, error)
- func (svr *Server) KvCheckSecondaryLocks(ctx context.Context, req *kvrpcpb.CheckSecondaryLocksRequest) (*kvrpcpb.CheckSecondaryLocksResponse, error)
- func (svr *Server) KvCheckTxnStatus(ctx context.Context, req *kvrpcpb.CheckTxnStatusRequest) (*kvrpcpb.CheckTxnStatusResponse, error)
- func (svr *Server) KvCleanup(ctx context.Context, req *kvrpcpb.CleanupRequest) (*kvrpcpb.CleanupResponse, error)
- func (svr *Server) KvCommit(ctx context.Context, req *kvrpcpb.CommitRequest) (*kvrpcpb.CommitResponse, error)
- func (svr *Server) KvDeleteRange(ctx context.Context, req *kvrpcpb.DeleteRangeRequest) (*kvrpcpb.DeleteRangeResponse, error)
- func (svr *Server) KvFlush(ctx context.Context, req *kvrpcpb.FlushRequest) (*kvrpcpb.FlushResponse, error)
- func (svr *Server) KvGC(ctx context.Context, req *kvrpcpb.GCRequest) (*kvrpcpb.GCResponse, error)
- func (svr *Server) KvGet(ctx context.Context, req *kvrpcpb.GetRequest) (*kvrpcpb.GetResponse, error)
- func (svr *Server) KvImport(context.Context, *kvrpcpb.ImportRequest) (*kvrpcpb.ImportResponse, error)
- func (svr *Server) KvPessimisticLock(ctx context.Context, req *kvrpcpb.PessimisticLockRequest) (*kvrpcpb.PessimisticLockResponse, error)
- func (svr *Server) KvPrewrite(ctx context.Context, req *kvrpcpb.PrewriteRequest) (*kvrpcpb.PrewriteResponse, error)
- func (svr *Server) KvResolveLock(ctx context.Context, req *kvrpcpb.ResolveLockRequest) (*kvrpcpb.ResolveLockResponse, error)
- func (svr *Server) KvScan(ctx context.Context, req *kvrpcpb.ScanRequest) (*kvrpcpb.ScanResponse, error)
- func (svr *Server) KvScanLock(ctx context.Context, req *kvrpcpb.ScanLockRequest) (*kvrpcpb.ScanLockResponse, error)
- func (svr *Server) KvTxnHeartBeat(ctx context.Context, req *kvrpcpb.TxnHeartBeatRequest) (*kvrpcpb.TxnHeartBeatResponse, error)
- func (svr *Server) MvccGetByKey(ctx context.Context, req *kvrpcpb.MvccGetByKeyRequest) (*kvrpcpb.MvccGetByKeyResponse, error)
- func (svr *Server) MvccGetByStartTs(ctx context.Context, req *kvrpcpb.MvccGetByStartTsRequest) (*kvrpcpb.MvccGetByStartTsResponse, error)
- func (svr *Server) PhysicalScanLock(ctx context.Context, req *kvrpcpb.PhysicalScanLockRequest) (*kvrpcpb.PhysicalScanLockResponse, error)
- func (svr *Server) Raft(stream tikvpb.Tikv_RaftServer) error
- func (svr *Server) RawBatchDelete(context.Context, *kvrpcpb.RawBatchDeleteRequest) (*kvrpcpb.RawBatchDeleteResponse, error)
- func (svr *Server) RawBatchGet(context.Context, *kvrpcpb.RawBatchGetRequest) (*kvrpcpb.RawBatchGetResponse, error)
- func (svr *Server) RawBatchPut(context.Context, *kvrpcpb.RawBatchPutRequest) (*kvrpcpb.RawBatchPutResponse, error)
- func (svr *Server) RawBatchScan(context.Context, *kvrpcpb.RawBatchScanRequest) (*kvrpcpb.RawBatchScanResponse, error)
- func (svr *Server) RawChecksum(context.Context, *kvrpcpb.RawChecksumRequest) (*kvrpcpb.RawChecksumResponse, error)
- func (svr *Server) RawCompareAndSwap(context.Context, *kvrpcpb.RawCASRequest) (*kvrpcpb.RawCASResponse, error)
- func (svr *Server) RawCoprocessor(context.Context, *kvrpcpb.RawCoprocessorRequest) (*kvrpcpb.RawCoprocessorResponse, error)
- func (svr *Server) RawDelete(context.Context, *kvrpcpb.RawDeleteRequest) (*kvrpcpb.RawDeleteResponse, error)
- func (svr *Server) RawDeleteRange(context.Context, *kvrpcpb.RawDeleteRangeRequest) (*kvrpcpb.RawDeleteRangeResponse, error)
- func (svr *Server) RawGet(context.Context, *kvrpcpb.RawGetRequest) (*kvrpcpb.RawGetResponse, error)
- func (svr *Server) RawGetKeyTTL(ctx context.Context, req *kvrpcpb.RawGetKeyTTLRequest) (*kvrpcpb.RawGetKeyTTLResponse, error)
- func (svr *Server) RawPut(context.Context, *kvrpcpb.RawPutRequest) (*kvrpcpb.RawPutResponse, error)
- func (svr *Server) RawScan(context.Context, *kvrpcpb.RawScanRequest) (*kvrpcpb.RawScanResponse, error)
- func (svr *Server) ReadIndex(context.Context, *kvrpcpb.ReadIndexRequest) (*kvrpcpb.ReadIndexResponse, error)
- func (svr *Server) RegisterLockObserver(context.Context, *kvrpcpb.RegisterLockObserverRequest) (*kvrpcpb.RegisterLockObserverResponse, error)
- func (svr *Server) RemoveLockObserver(context.Context, *kvrpcpb.RemoveLockObserverRequest) (*kvrpcpb.RemoveLockObserverResponse, error)
- func (svr *Server) RemoveMPPTaskHandler(taskID int64, storeID uint64) error
- func (svr *Server) Snapshot(stream tikvpb.Tikv_SnapshotServer) error
- func (svr *Server) SplitRegion(ctx context.Context, req *kvrpcpb.SplitRegionRequest) (*kvrpcpb.SplitRegionResponse, error)
- func (svr *Server) Stop()
- func (svr *Server) StoreBatchCoprocessor(ctx context.Context, req *coprocessor.Request) []*coprocessor.StoreBatchTaskResponse
- func (svr *Server) UnsafeDestroyRange(ctx context.Context, req *kvrpcpb.UnsafeDestroyRangeRequest) (*kvrpcpb.UnsafeDestroyRangeResponse, error)
- type StandAloneRegionManager
- func (rm *StandAloneRegionManager) Close() error
- func (rm *StandAloneRegionManager) GetRegionFromCtx(ctx *kvrpcpb.Context) (RegionCtx, *errorpb.Error)
- func (rm *StandAloneRegionManager) GetStoreAddrByStoreID(storeID uint64) (string, error)
- func (rm *StandAloneRegionManager) GetStoreIDByAddr(addr string) (uint64, error)
- func (rm *StandAloneRegionManager) GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error)
- func (rm *StandAloneRegionManager) SplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpcpb.SplitRegionResponse
- type StandAlongInnerServer
- func (is *StandAlongInnerServer) BatchRaft(stream tikvpb.Tikv_BatchRaftServer) error
- func (is *StandAlongInnerServer) Raft(stream tikvpb.Tikv_RaftServer) error
- func (is *StandAlongInnerServer) Setup(pdClient pd.Client)
- func (is *StandAlongInnerServer) Snapshot(stream tikvpb.Tikv_SnapshotServer) error
- func (is *StandAlongInnerServer) Start(pdClient pd.Client) error
- func (is *StandAlongInnerServer) Stop() error
- type TxnStatus
Constants ¶
const ( Follower = iota Leader )
Follower will send detection rpc to Leader
Variables ¶
var ( InternalKeyPrefix = []byte{0xff} InternalRegionMetaPrefix = append(InternalKeyPrefix, "region"...) InternalStoreMetaKey = append(InternalKeyPrefix, "store"...) InternalSafePointKey = append(InternalKeyPrefix, "safepoint"...) )
InternalKey
Functions ¶
func InternalRegionMetaKey ¶
InternalRegionMetaKey returns internal region meta key with the given region id.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector detects deadlock.
func NewDetector ¶
NewDetector creates a new Detector.
func (*Detector) CleanUpWaitFor ¶
CleanUpWaitFor removes a key in the wait for entry for the transaction.
type DetectorClient ¶
type DetectorClient struct {
// contains filtered or unexported fields
}
DetectorClient represents a detector client.
func NewDetectorClient ¶
func NewDetectorClient(waiterMgr *lockwaiter.Manager, pdClient pd.Client) *DetectorClient
NewDetectorClient will create a new detector util, entryTTL is used for recycling the lock wait edge in detector wait wap. chSize is the pending detection sending task size(used on non leader node)
func (*DetectorClient) CleanUp ¶
func (dt *DetectorClient) CleanUp(startTs uint64)
CleanUp processes cleaup task on local detector user interfaces
func (*DetectorClient) CleanUpWaitFor ¶
func (dt *DetectorClient) CleanUpWaitFor(txnTs, waitForTxn, keyHash uint64)
CleanUpWaitFor cleans up the specific wait edge in detector's wait map
func (*DetectorClient) Detect ¶
func (dt *DetectorClient) Detect(txnTs uint64, waitForTxnTs uint64, keyHash uint64, key []byte, resourceGroupTag []byte)
Detect post the detection request to local deadlock detector or remote first region leader, the caller should use `waiter.ch` to receive possible deadlock response
type DetectorServer ¶
type DetectorServer struct { Detector *Detector // contains filtered or unexported fields }
DetectorServer represents a detector server.
func NewDetectorServer ¶
func NewDetectorServer() *DetectorServer
NewDetectorServer creates local detector used by RPC detection handler
func (*DetectorServer) ChangeRole ¶
func (ds *DetectorServer) ChangeRole(newRole int32)
ChangeRole changes the server role.
func (*DetectorServer) Detect ¶
func (ds *DetectorServer) Detect(req *deadlockPb.DeadlockRequest) *deadlockPb.DeadlockResponse
Detect detects deadlock.
func (*DetectorServer) IsLeader ¶
func (ds *DetectorServer) IsLeader() bool
IsLeader returns whether the server is leader or not.
type GCCompactionFilter ¶
type GCCompactionFilter struct {
// contains filtered or unexported fields
}
GCCompactionFilter implements the badger.CompactionFilter interface.
func (*GCCompactionFilter) Filter ¶
func (f *GCCompactionFilter) Filter(key, value, userMeta []byte) badger.Decision
Filter implements the badger.CompactionFilter interface. Since we use txn ts as badger version, we only need to filter Delete, Rollback and Op_Lock. It is called for the first valid version before safe point, older versions are discarded automatically.
func (*GCCompactionFilter) Guards ¶
func (f *GCCompactionFilter) Guards() []badger.Guard
Guards implements the badger.CompactionFilter interface. Guards returns specifications that may splits the SST files A key is associated to a guard that has the longest matched Prefix.
type InnerServer ¶
type InnerServer interface { Setup(pdClient pd.Client) Start(pdClient pd.Client) error Stop() error Raft(stream tikvpb.Tikv_RaftServer) error BatchRaft(stream tikvpb.Tikv_BatchRaftServer) error Snapshot(stream tikvpb.Tikv_SnapshotServer) error }
InnerServer defines the inner server interface.
type LockPair ¶
type LockPair struct {
// contains filtered or unexported fields
}
LockPair contains a pair of key and lock. It's used for reading through locks.
type MPPTaskHandlerMap ¶
type MPPTaskHandlerMap struct {
// contains filtered or unexported fields
}
MPPTaskHandlerMap is a map of *cophandler.MPPTaskHandler.
type MVCCStore ¶
type MVCCStore struct { DeadlockDetectCli *DetectorClient DeadlockDetectSvr *DetectorServer // contains filtered or unexported fields }
MVCCStore is a wrapper of badger.DB to provide MVCC functions.
func NewMVCCStore ¶
func NewMVCCStore(conf *config.Config, bundle *mvcc.DBBundle, dataDir string, safePoint *SafePoint, writer mvcc.DBWriter, pdClient pd.Client) *MVCCStore
NewMVCCStore creates a new MVCCStore
func (*MVCCStore) BatchGet ¶
func (store *MVCCStore) BatchGet(reqCtx *requestCtx, keys [][]byte, version uint64) []*kvrpcpb.KvPair
BatchGet implements the MVCCStore interface.
func (*MVCCStore) CheckKeysLock ¶
func (store *MVCCStore) CheckKeysLock(startTS uint64, resolved, committed []uint64, keys ...[]byte) ([]*LockPair, error)
CheckKeysLock implements the MVCCStore interface.
func (*MVCCStore) CheckKeysLockForRcCheckTS ¶
func (store *MVCCStore) CheckKeysLockForRcCheckTS(startTS uint64, resolved []uint64, keys ...[]byte) error
CheckKeysLockForRcCheckTS is used to check version timestamp if `RcCheckTS` isolation level is used.
func (*MVCCStore) CheckRangeLock ¶
func (store *MVCCStore) CheckRangeLock(startTS uint64, startKey, endKey []byte, resolved []uint64) error
CheckRangeLock implements the MVCCStore interface.
func (*MVCCStore) CheckSecondaryLocks ¶
func (store *MVCCStore) CheckSecondaryLocks(reqCtx *requestCtx, keys [][]byte, startTS uint64) (SecondaryLocksStatus, error)
CheckSecondaryLocks implements the MVCCStore interface.
func (*MVCCStore) CheckTxnStatus ¶
func (store *MVCCStore) CheckTxnStatus(reqCtx *requestCtx, req *kvrpcpb.CheckTxnStatusRequest) (txnStatusRes TxnStatus, err error)
CheckTxnStatus implements the MVCCStore interface.
func (*MVCCStore) DeleteFileInRange ¶
DeleteFileInRange implements the MVCCStore interface.
func (*MVCCStore) Flush ¶
func (store *MVCCStore) Flush(reqCtx *requestCtx, req *kvrpcpb.FlushRequest) error
Flush implements the MVCCStore interface.
func (*MVCCStore) MvccGetByKey ¶
MvccGetByKey gets mvcc information using input key as rawKey
func (*MVCCStore) MvccGetByStartTs ¶
func (store *MVCCStore) MvccGetByStartTs(reqCtx *requestCtx, startTs uint64) (*kvrpcpb.MvccInfo, []byte, error)
MvccGetByStartTs implements the MVCCStore interface.
func (*MVCCStore) PessimisticLock ¶
func (store *MVCCStore) PessimisticLock(reqCtx *requestCtx, req *kvrpcpb.PessimisticLockRequest, resp *kvrpcpb.PessimisticLockResponse) (*lockwaiter.Waiter, error)
PessimisticLock will add pessimistic lock on key
func (*MVCCStore) PessimisticRollback ¶
func (store *MVCCStore) PessimisticRollback(reqCtx *requestCtx, req *kvrpcpb.PessimisticRollbackRequest) error
PessimisticRollback implements the MVCCStore interface.
func (*MVCCStore) PessimisticRollbackWithScanFirst ¶
func (store *MVCCStore) PessimisticRollbackWithScanFirst(reqCtx *requestCtx, req *kvrpcpb.PessimisticRollbackRequest) error
PessimisticRollbackWithScanFirst is used to scan the region first to collect related pessimistic locks and then pessimistic rollback them.
func (*MVCCStore) PhysicalScanLock ¶
func (store *MVCCStore) PhysicalScanLock(startKey []byte, maxTS uint64, limit int) []*kvrpcpb.LockInfo
PhysicalScanLock implements the MVCCStore interface.
func (*MVCCStore) Prewrite ¶
func (store *MVCCStore) Prewrite(reqCtx *requestCtx, req *kvrpcpb.PrewriteRequest) error
Prewrite implements the MVCCStore interface.
func (*MVCCStore) ReadBufferFromLock ¶
ReadBufferFromLock implements the MVCCStore interface.
func (*MVCCStore) ResolveLock ¶
func (store *MVCCStore) ResolveLock(reqCtx *requestCtx, lockKeys [][]byte, startTS, commitTS uint64) error
ResolveLock implements the MVCCStore interface.
func (*MVCCStore) Scan ¶
func (store *MVCCStore) Scan(reqCtx *requestCtx, req *kvrpcpb.ScanRequest) []*kvrpcpb.KvPair
Scan implements the MVCCStore interface.
func (*MVCCStore) ScanLock ¶
func (store *MVCCStore) ScanLock(reqCtx *requestCtx, maxTS uint64, limit int) ([]*kvrpcpb.LockInfo, error)
ScanLock implements the MVCCStore interface.
func (*MVCCStore) StartDeadlockDetection ¶
StartDeadlockDetection implements the MVCCStore interface.
func (*MVCCStore) TxnHeartBeat ¶
func (store *MVCCStore) TxnHeartBeat(reqCtx *requestCtx, req *kvrpcpb.TxnHeartBeatRequest) (lockTTL uint64, err error)
TxnHeartBeat implements the MVCCStore interface.
func (*MVCCStore) UpdateSafePoint ¶
UpdateSafePoint implements the MVCCStore interface.
type MockPD ¶
type MockPD struct {
// contains filtered or unexported fields
}
MockPD implements gRPC PDServer.
func (*MockPD) AskBatchSplit ¶
func (pd *MockPD) AskBatchSplit(ctx context.Context, region *metapb.Region, count int) (*pdpb.AskBatchSplitResponse, error)
AskBatchSplit implements gRPC PDServer.
func (*MockPD) AskSplit ¶
func (pd *MockPD) AskSplit(ctx context.Context, region *metapb.Region) (*pdpb.AskSplitResponse, error)
AskSplit implements gRPC PDServer.
func (*MockPD) Bootstrap ¶
func (pd *MockPD) Bootstrap(ctx context.Context, store *metapb.Store, region *metapb.Region) (*pdpb.BootstrapResponse, error)
Bootstrap implements gRPC PDServer.
func (*MockPD) GetAllStores ¶
func (pd *MockPD) GetAllStores(ctx context.Context, opts ...pdclient.GetStoreOption) ([]*metapb.Store, error)
GetAllStores gets all stores from pd. The store may expire later. Caller is responsible for caching and taking care of store change.
func (*MockPD) GetClusterID ¶
GetClusterID implements gRPC PDServer.
func (*MockPD) GetExternalTimestamp ¶
GetExternalTimestamp returns external timestamp
func (*MockPD) GetGCSafePoint ¶
GetGCSafePoint gets the gc safePoint
func (*MockPD) GetPrevRegion ¶
func (pd *MockPD) GetPrevRegion(ctx context.Context, key []byte, opts ...pdclient.GetRegionOption) (*pdclient.Region, error)
GetPrevRegion gets the previous region and its leader Peer of the region where the key is located.
func (*MockPD) GetRegion ¶
func (pd *MockPD) GetRegion(ctx context.Context, key []byte, opts ...pdclient.GetRegionOption) (*pdclient.Region, error)
GetRegion implements gRPC PDServer.
func (*MockPD) GetRegionByID ¶
func (pd *MockPD) GetRegionByID(ctx context.Context, regionID uint64, opts ...pdclient.GetRegionOption) (*pdclient.Region, error)
GetRegionByID implements gRPC PDServer.
func (*MockPD) IsBootstrapped ¶
IsBootstrapped implements gRPC PDServer.
func (*MockPD) ReportBatchSplit ¶
ReportBatchSplit implements gRPC PDServer.
func (*MockPD) ReportRegion ¶
func (pd *MockPD) ReportRegion(*pdpb.RegionHeartbeatRequest)
ReportRegion implements gRPC PDServer.
func (*MockPD) ScanRegions ¶
func (pd *MockPD) ScanRegions(ctx context.Context, startKey []byte, endKey []byte, limit int, opts ...pdclient.GetRegionOption) ([]*pdclient.Region, error)
ScanRegions gets a list of regions, starts from the region that contains key. Limit limits the maximum number of regions returned. If a region has no leader, corresponding leader will be placed by a peer with empty value (PeerID is 0).
func (*MockPD) ScatterRegion ¶
ScatterRegion scatters the specified region. Should use it for a batch of regions, and the distribution of these regions will be dispersed. NOTICE: This method is the old version of ScatterRegions, you should use the later one as your first choice.
func (*MockPD) SetExternalTimestamp ¶
SetExternalTimestamp sets external timestamp
func (*MockPD) SetRegionHeartbeatResponseHandler ¶
func (pd *MockPD) SetRegionHeartbeatResponseHandler(h func(*pdpb.RegionHeartbeatResponse))
SetRegionHeartbeatResponseHandler sets the region heartbeat.
func (*MockPD) StoreHeartbeat ¶
StoreHeartbeat stores the heartbeat.
func (*MockPD) UpdateGCSafePoint ¶
UpdateGCSafePoint implements gRPC PDServer. TiKV will check it and do GC themselves if necessary. If the given safePoint is less than the current one, it will not be updated. Returns the new safePoint after updating.
type MockRegionManager ¶
type MockRegionManager struct {
// contains filtered or unexported fields
}
MockRegionManager implements RegionManager interface.
func NewMockRegionManager ¶
func NewMockRegionManager(bundle *mvcc.DBBundle, clusterID uint64, opts RegionOptions) (*MockRegionManager, error)
NewMockRegionManager returns a new MockRegionManager.
func (*MockRegionManager) AddPeer ¶
func (rm *MockRegionManager) AddPeer(regionID, storeID, peerID uint64)
AddPeer adds a new Peer to the cluster.
func (*MockRegionManager) AddStore ¶
func (rm *MockRegionManager) AddStore(storeID uint64, addr string, labels ...*metapb.StoreLabel)
AddStore adds a new Store to the cluster.
func (*MockRegionManager) AllocID ¶
func (rm *MockRegionManager) AllocID() uint64
AllocID allocs an id.
func (*MockRegionManager) AllocIDs ¶
func (rm *MockRegionManager) AllocIDs(n int) []uint64
AllocIDs allocs ids with the given number n.
func (*MockRegionManager) Close ¶
func (rm *MockRegionManager) Close() error
Close closes the MockRegionManager.
func (*MockRegionManager) GetAllStores ¶
func (rm *MockRegionManager) GetAllStores() []*metapb.Store
GetAllStores gets all stores from pd. The store may expire later. Caller is responsible for caching and taking care of store change.
func (*MockRegionManager) GetRegion ¶
func (rm *MockRegionManager) GetRegion(id uint64) *metapb.Region
GetRegion gets a region by the id.
func (*MockRegionManager) GetRegionByEndKey ¶
func (rm *MockRegionManager) GetRegionByEndKey(key []byte) (region *metapb.Region, peer *metapb.Peer)
GetRegionByEndKey gets a region by the end key.
func (*MockRegionManager) GetRegionByKey ¶
func (rm *MockRegionManager) GetRegionByKey(key []byte) (region *metapb.Region, peer *metapb.Peer, buckets *metapb.Buckets, downPeers []*metapb.Peer)
GetRegionByKey gets a region by the key.
func (*MockRegionManager) GetRegionFromCtx ¶
GetRegionFromCtx gets the region from the context.
func (*MockRegionManager) GetStoreAddrByStoreID ¶
func (rm *MockRegionManager) GetStoreAddrByStoreID(storeID uint64) (string, error)
GetStoreAddrByStoreID gets a store address by the store id.
func (*MockRegionManager) GetStoreIDByAddr ¶
func (rm *MockRegionManager) GetStoreIDByAddr(addr string) (uint64, error)
GetStoreIDByAddr gets a store id by the store address.
func (*MockRegionManager) GetStoreInfoFromCtx ¶
func (rm *MockRegionManager) GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error)
GetStoreInfoFromCtx gets the store info from the context.
func (*MockRegionManager) IsBootstrapped ¶
func (rm *MockRegionManager) IsBootstrapped() (bool, error)
IsBootstrapped returns whether the MockRegionManager is bootstrapped or not.
func (*MockRegionManager) RemoveStore ¶
func (rm *MockRegionManager) RemoveStore(storeID uint64)
RemoveStore removes a Store from the cluster.
func (*MockRegionManager) ScanRegions ¶
func (rm *MockRegionManager) ScanRegions(startKey, endKey []byte, limit int, _ ...pdclient.GetRegionOption) []*pdclient.Region
ScanRegions gets a list of regions, starts from the region that contains key. Limit limits the maximum number of regions returned. If a region has no leader, corresponding leader will be placed by a peer with empty value (PeerID is 0).
func (*MockRegionManager) Split ¶
func (rm *MockRegionManager) Split(regionID, newRegionID uint64, key []byte, peerIDs []uint64, leaderPeerID uint64)
Split splits a Region at the key (encoded) and creates new Region.
func (*MockRegionManager) SplitArbitrary ¶
func (rm *MockRegionManager) SplitArbitrary(keys ...[]byte)
SplitArbitrary splits the cluster by the split point manually provided. The keys provided are raw key.
func (*MockRegionManager) SplitIndex ¶
func (rm *MockRegionManager) SplitIndex(tableID, indexID int64, count int)
SplitIndex evenly splits the data in index into count regions.
func (*MockRegionManager) SplitKeys ¶
func (rm *MockRegionManager) SplitKeys(start, end kv.Key, count int)
SplitKeys evenly splits the start, end key into "count" regions.
func (*MockRegionManager) SplitRaw ¶
func (rm *MockRegionManager) SplitRaw(regionID, newRegionID uint64, rawKey []byte, peerIDs []uint64, leaderPeerID uint64) *metapb.Region
SplitRaw splits a Region at the key (not encoded) and creates new Region.
func (*MockRegionManager) SplitRegion ¶
func (rm *MockRegionManager) SplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpcpb.SplitRegionResponse
SplitRegion implements the RegionManager interface.
func (*MockRegionManager) SplitTable ¶
func (rm *MockRegionManager) SplitTable(tableID int64, count int)
SplitTable evenly splits the data in table into count regions.
type RegionCtx ¶
type RegionCtx interface { Meta() *metapb.Region Diff() *int64 RawStart() []byte RawEnd() []byte AcquireLatches(hashes []uint64) ReleaseLatches(hashes []uint64) }
RegionCtx defines the region context interface.
type RegionError ¶
type RegionError struct {
// contains filtered or unexported fields
}
RegionError represents a region error
func (*RegionError) Error ¶
func (regionError *RegionError) Error() string
Error implements Error method.
type RegionManager ¶
type RegionManager interface { GetRegionFromCtx(ctx *kvrpcpb.Context) (RegionCtx, *errorpb.Error) GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error) SplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpcpb.SplitRegionResponse GetStoreIDByAddr(addr string) (uint64, error) GetStoreAddrByStoreID(storeID uint64) (string, error) Close() error }
RegionManager defines the region manager interface.
type RegionOptions ¶
RegionOptions represents the region options.
type SafePoint ¶
type SafePoint struct {
// contains filtered or unexported fields
}
SafePoint represents a safe point.
func (*SafePoint) CreateCompactionFilter ¶
func (sp *SafePoint) CreateCompactionFilter(targetLevel int, startKey, endKey []byte) badger.CompactionFilter
CreateCompactionFilter implements badger.CompactionFilterFactory function.
type SecondaryLocksStatus ¶
type SecondaryLocksStatus struct {
// contains filtered or unexported fields
}
SecondaryLocksStatus is the result of `CheckSecondaryLocksStatus` API.
type Server ¶
type Server struct { // After updating the kvproto, some methods of TikvServer are not implemented. // Construct `Server` based on `UnimplementedTikvServer`, in order to compile successfully tikvpb.UnimplementedTikvServer RPCClient client.Client // contains filtered or unexported fields }
Server implements the tikvpb.TikvServer interface.
func NewServer ¶
func NewServer(rm RegionManager, store *MVCCStore, innerServer InnerServer) *Server
NewServer returns a new server.
func (*Server) BatchCommands ¶
func (svr *Server) BatchCommands(stream tikvpb.Tikv_BatchCommandsServer) error
BatchCommands implements the TiKVServer interface.
func (*Server) BatchCoprocessor ¶
func (svr *Server) BatchCoprocessor(req *coprocessor.BatchRequest, batchCopServer tikvpb.Tikv_BatchCoprocessorServer) error
BatchCoprocessor implements the tikvpb.TikvServer interface.
func (*Server) BatchRaft ¶
func (svr *Server) BatchRaft(stream tikvpb.Tikv_BatchRaftServer) error
BatchRaft implements the tikvpb.TikvServer interface.
func (*Server) CancelMPPTask ¶
func (svr *Server) CancelMPPTask(_ context.Context, _ *mpp.CancelTaskRequest) (*mpp.CancelTaskResponse, error)
CancelMPPTask implements the tikvpb.TikvServer interface.
func (*Server) CheckLeader ¶
func (svr *Server) CheckLeader(context.Context, *kvrpcpb.CheckLeaderRequest) (*kvrpcpb.CheckLeaderResponse, error)
CheckLeader implements the tikvpb.TikvServer interface.
func (*Server) CheckLockObserver ¶
func (svr *Server) CheckLockObserver(context.Context, *kvrpcpb.CheckLockObserverRequest) (*kvrpcpb.CheckLockObserverResponse, error)
CheckLockObserver implements the tikvpb.TikvServer interface.
func (*Server) Compact ¶
func (svr *Server) Compact(ctx context.Context, req *kvrpcpb.CompactRequest) (*kvrpcpb.CompactResponse, error)
Compact implements the tikvpb.TikvServer interface.
func (*Server) Coprocessor ¶
func (svr *Server) Coprocessor(ctx context.Context, req *coprocessor.Request) (*coprocessor.Response, error)
Coprocessor implements the tikvpb.TikvServer interface.
func (*Server) CoprocessorStream ¶
func (svr *Server) CoprocessorStream(*coprocessor.Request, tikvpb.Tikv_CoprocessorStreamServer) error
CoprocessorStream implements the tikvpb.TikvServer interface.
func (*Server) CreateMPPTaskHandler ¶
func (svr *Server) CreateMPPTaskHandler(meta *mpp.TaskMeta, storeID uint64) (*cophandler.MPPTaskHandler, error)
CreateMPPTaskHandler implements the tikvpb.TikvServer interface.
func (*Server) Detect ¶
func (svr *Server) Detect(stream deadlockPb.Deadlock_DetectServer) error
Detect will handle detection rpc from other nodes
func (*Server) DispatchMPPTask ¶
func (svr *Server) DispatchMPPTask(_ context.Context, _ *mpp.DispatchTaskRequest) (*mpp.DispatchTaskResponse, error)
DispatchMPPTask implements the tikvpb.TikvServer interface.
func (*Server) DispatchMPPTaskWithStoreID ¶
func (svr *Server) DispatchMPPTaskWithStoreID(ctx context.Context, req *mpp.DispatchTaskRequest, storeID uint64) (*mpp.DispatchTaskResponse, error)
DispatchMPPTaskWithStoreID implements the tikvpb.TikvServer interface.
func (*Server) EstablishMPPConnection ¶
func (svr *Server) EstablishMPPConnection(*mpp.EstablishMPPConnectionRequest, tikvpb.Tikv_EstablishMPPConnectionServer) error
EstablishMPPConnection implements the tikvpb.TikvServer interface.
func (*Server) EstablishMPPConnectionWithStoreID ¶
func (svr *Server) EstablishMPPConnectionWithStoreID(req *mpp.EstablishMPPConnectionRequest, server tikvpb.Tikv_EstablishMPPConnectionServer, storeID uint64) error
EstablishMPPConnectionWithStoreID implements the tikvpb.TikvServer interface.
func (*Server) GetLockWaitHistory ¶
func (svr *Server) GetLockWaitHistory(context.Context, *kvrpcpb.GetLockWaitHistoryRequest) (*kvrpcpb.GetLockWaitHistoryResponse, error)
GetLockWaitHistory implements the tikvpb.TikvServer interface.
func (*Server) GetLockWaitInfo ¶
func (svr *Server) GetLockWaitInfo(context.Context, *kvrpcpb.GetLockWaitInfoRequest) (*kvrpcpb.GetLockWaitInfoResponse, error)
GetLockWaitInfo implements the tikvpb.TikvServer interface.
func (*Server) GetMPPTaskHandler ¶
func (svr *Server) GetMPPTaskHandler(taskID int64, storeID uint64) (*cophandler.MPPTaskHandler, error)
GetMPPTaskHandler implements the tikvpb.TikvServer interface.
func (*Server) GetStoreAddrByStoreID ¶
GetStoreAddrByStoreID gets a store address by the store id.
func (*Server) GetStoreIDByAddr ¶
GetStoreIDByAddr gets a store id by the store address.
func (*Server) GetStoreSafeTS ¶
func (svr *Server) GetStoreSafeTS(context.Context, *kvrpcpb.StoreSafeTSRequest) (*kvrpcpb.StoreSafeTSResponse, error)
GetStoreSafeTS implements the tikvpb.TikvServer interface.
func (*Server) GetWaitForEntries ¶
func (svr *Server) GetWaitForEntries(ctx context.Context, req *deadlockPb.WaitForEntriesRequest) (*deadlockPb.WaitForEntriesResponse, error)
GetWaitForEntries tries to get the waitFor entries deadlock detection related services
func (*Server) IsAlive ¶
func (svr *Server) IsAlive(_ context.Context, _ *mpp.IsAliveRequest) (*mpp.IsAliveResponse, error)
IsAlive implements the tikvpb.TikvServer interface.
func (*Server) KVPessimisticRollback ¶
func (svr *Server) KVPessimisticRollback(ctx context.Context, req *kvrpcpb.PessimisticRollbackRequest) (*kvrpcpb.PessimisticRollbackResponse, error)
KVPessimisticRollback implements the tikvpb.TikvServer interface.
func (*Server) KvBatchGet ¶
func (svr *Server) KvBatchGet(ctx context.Context, req *kvrpcpb.BatchGetRequest) (*kvrpcpb.BatchGetResponse, error)
KvBatchGet implements the tikvpb.TikvServer interface.
func (*Server) KvBatchRollback ¶
func (svr *Server) KvBatchRollback(ctx context.Context, req *kvrpcpb.BatchRollbackRequest) (*kvrpcpb.BatchRollbackResponse, error)
KvBatchRollback implements the tikvpb.TikvServer interface.
func (*Server) KvBufferBatchGet ¶
func (svr *Server) KvBufferBatchGet(ctx context.Context, req *kvrpcpb.BufferBatchGetRequest) (*kvrpcpb.BufferBatchGetResponse, error)
KvBufferBatchGet implements the tikvpb.TikvServer interface.
func (*Server) KvCheckSecondaryLocks ¶
func (svr *Server) KvCheckSecondaryLocks(ctx context.Context, req *kvrpcpb.CheckSecondaryLocksRequest) (*kvrpcpb.CheckSecondaryLocksResponse, error)
KvCheckSecondaryLocks implements the tikvpb.TikvServer interface.
func (*Server) KvCheckTxnStatus ¶
func (svr *Server) KvCheckTxnStatus(ctx context.Context, req *kvrpcpb.CheckTxnStatusRequest) (*kvrpcpb.CheckTxnStatusResponse, error)
KvCheckTxnStatus implements the tikvpb.TikvServer interface.
func (*Server) KvCleanup ¶
func (svr *Server) KvCleanup(ctx context.Context, req *kvrpcpb.CleanupRequest) (*kvrpcpb.CleanupResponse, error)
KvCleanup implements the tikvpb.TikvServer interface.
func (*Server) KvCommit ¶
func (svr *Server) KvCommit(ctx context.Context, req *kvrpcpb.CommitRequest) (*kvrpcpb.CommitResponse, error)
KvCommit implements the tikvpb.TikvServer interface.
func (*Server) KvDeleteRange ¶
func (svr *Server) KvDeleteRange(ctx context.Context, req *kvrpcpb.DeleteRangeRequest) (*kvrpcpb.DeleteRangeResponse, error)
KvDeleteRange implements the tikvpb.TikvServer interface.
func (*Server) KvFlush ¶
func (svr *Server) KvFlush(ctx context.Context, req *kvrpcpb.FlushRequest) (*kvrpcpb.FlushResponse, error)
KvFlush implements the tikvpb.TikvServer interface.
func (*Server) KvGet ¶
func (svr *Server) KvGet(ctx context.Context, req *kvrpcpb.GetRequest) (*kvrpcpb.GetResponse, error)
KvGet implements the tikvpb.TikvServer interface.
func (*Server) KvImport ¶
func (svr *Server) KvImport(context.Context, *kvrpcpb.ImportRequest) (*kvrpcpb.ImportResponse, error)
KvImport implements the tikvpb.TikvServer interface.
func (*Server) KvPessimisticLock ¶
func (svr *Server) KvPessimisticLock(ctx context.Context, req *kvrpcpb.PessimisticLockRequest) (*kvrpcpb.PessimisticLockResponse, error)
KvPessimisticLock implements the tikvpb.TikvServer interface.
func (*Server) KvPrewrite ¶
func (svr *Server) KvPrewrite(ctx context.Context, req *kvrpcpb.PrewriteRequest) (*kvrpcpb.PrewriteResponse, error)
KvPrewrite implements the tikvpb.TikvServer interface.
func (*Server) KvResolveLock ¶
func (svr *Server) KvResolveLock(ctx context.Context, req *kvrpcpb.ResolveLockRequest) (*kvrpcpb.ResolveLockResponse, error)
KvResolveLock implements the tikvpb.TikvServer interface.
func (*Server) KvScan ¶
func (svr *Server) KvScan(ctx context.Context, req *kvrpcpb.ScanRequest) (*kvrpcpb.ScanResponse, error)
KvScan implements the tikvpb.TikvServer interface.
func (*Server) KvScanLock ¶
func (svr *Server) KvScanLock(ctx context.Context, req *kvrpcpb.ScanLockRequest) (*kvrpcpb.ScanLockResponse, error)
KvScanLock implements the tikvpb.TikvServer interface.
func (*Server) KvTxnHeartBeat ¶
func (svr *Server) KvTxnHeartBeat(ctx context.Context, req *kvrpcpb.TxnHeartBeatRequest) (*kvrpcpb.TxnHeartBeatResponse, error)
KvTxnHeartBeat implements the tikvpb.TikvServer interface.
func (*Server) MvccGetByKey ¶
func (svr *Server) MvccGetByKey(ctx context.Context, req *kvrpcpb.MvccGetByKeyRequest) (*kvrpcpb.MvccGetByKeyResponse, error)
MvccGetByKey implements the tikvpb.TikvServer interface.
func (*Server) MvccGetByStartTs ¶
func (svr *Server) MvccGetByStartTs(ctx context.Context, req *kvrpcpb.MvccGetByStartTsRequest) (*kvrpcpb.MvccGetByStartTsResponse, error)
MvccGetByStartTs implements the tikvpb.TikvServer interface.
func (*Server) PhysicalScanLock ¶
func (svr *Server) PhysicalScanLock(ctx context.Context, req *kvrpcpb.PhysicalScanLockRequest) (*kvrpcpb.PhysicalScanLockResponse, error)
PhysicalScanLock implements the tikvpb.TikvServer interface.
func (*Server) Raft ¶
func (svr *Server) Raft(stream tikvpb.Tikv_RaftServer) error
Raft implements the tikvpb.TikvServer interface.
func (*Server) RawBatchDelete ¶
func (svr *Server) RawBatchDelete(context.Context, *kvrpcpb.RawBatchDeleteRequest) (*kvrpcpb.RawBatchDeleteResponse, error)
RawBatchDelete implements the tikvpb.TikvServer interface.
func (*Server) RawBatchGet ¶
func (svr *Server) RawBatchGet(context.Context, *kvrpcpb.RawBatchGetRequest) (*kvrpcpb.RawBatchGetResponse, error)
RawBatchGet implements the tikvpb.TikvServer interface.
func (*Server) RawBatchPut ¶
func (svr *Server) RawBatchPut(context.Context, *kvrpcpb.RawBatchPutRequest) (*kvrpcpb.RawBatchPutResponse, error)
RawBatchPut implements the tikvpb.TikvServer interface.
func (*Server) RawBatchScan ¶
func (svr *Server) RawBatchScan(context.Context, *kvrpcpb.RawBatchScanRequest) (*kvrpcpb.RawBatchScanResponse, error)
RawBatchScan implements the tikvpb.TikvServer interface.
func (*Server) RawChecksum ¶
func (svr *Server) RawChecksum(context.Context, *kvrpcpb.RawChecksumRequest) (*kvrpcpb.RawChecksumResponse, error)
RawChecksum implements the tikvpb.TikvServer interface.
func (*Server) RawCompareAndSwap ¶
func (svr *Server) RawCompareAndSwap(context.Context, *kvrpcpb.RawCASRequest) (*kvrpcpb.RawCASResponse, error)
RawCompareAndSwap implements the tikvpb.TikvServer interface.
func (*Server) RawCoprocessor ¶
func (svr *Server) RawCoprocessor(context.Context, *kvrpcpb.RawCoprocessorRequest) (*kvrpcpb.RawCoprocessorResponse, error)
RawCoprocessor implements the tikvpb.TikvServer interface.
func (*Server) RawDelete ¶
func (svr *Server) RawDelete(context.Context, *kvrpcpb.RawDeleteRequest) (*kvrpcpb.RawDeleteResponse, error)
RawDelete implements the tikvpb.TikvServer interface.
func (*Server) RawDeleteRange ¶
func (svr *Server) RawDeleteRange(context.Context, *kvrpcpb.RawDeleteRangeRequest) (*kvrpcpb.RawDeleteRangeResponse, error)
RawDeleteRange implements the tikvpb.TikvServer interface.
func (*Server) RawGet ¶
func (svr *Server) RawGet(context.Context, *kvrpcpb.RawGetRequest) (*kvrpcpb.RawGetResponse, error)
RawGet implements the tikvpb.TikvServer interface.
func (*Server) RawGetKeyTTL ¶
func (svr *Server) RawGetKeyTTL(ctx context.Context, req *kvrpcpb.RawGetKeyTTLRequest) (*kvrpcpb.RawGetKeyTTLResponse, error)
RawGetKeyTTL implements the tikvpb.TikvServer interface.
func (*Server) RawPut ¶
func (svr *Server) RawPut(context.Context, *kvrpcpb.RawPutRequest) (*kvrpcpb.RawPutResponse, error)
RawPut implements the tikvpb.TikvServer interface.
func (*Server) RawScan ¶
func (svr *Server) RawScan(context.Context, *kvrpcpb.RawScanRequest) (*kvrpcpb.RawScanResponse, error)
RawScan implements the tikvpb.TikvServer interface.
func (*Server) ReadIndex ¶
func (svr *Server) ReadIndex(context.Context, *kvrpcpb.ReadIndexRequest) (*kvrpcpb.ReadIndexResponse, error)
ReadIndex implements the tikvpb.TikvServer interface.
func (*Server) RegisterLockObserver ¶
func (svr *Server) RegisterLockObserver(context.Context, *kvrpcpb.RegisterLockObserverRequest) (*kvrpcpb.RegisterLockObserverResponse, error)
RegisterLockObserver implements the tikvpb.TikvServer interface.
func (*Server) RemoveLockObserver ¶
func (svr *Server) RemoveLockObserver(context.Context, *kvrpcpb.RemoveLockObserverRequest) (*kvrpcpb.RemoveLockObserverResponse, error)
RemoveLockObserver implements the tikvpb.TikvServer interface.
func (*Server) RemoveMPPTaskHandler ¶
RemoveMPPTaskHandler implements the tikvpb.TikvServer interface.
func (*Server) Snapshot ¶
func (svr *Server) Snapshot(stream tikvpb.Tikv_SnapshotServer) error
Snapshot implements the tikvpb.TikvServer interface.
func (*Server) SplitRegion ¶
func (svr *Server) SplitRegion(ctx context.Context, req *kvrpcpb.SplitRegionRequest) (*kvrpcpb.SplitRegionResponse, error)
SplitRegion implements the tikvpb.TikvServer interface.
func (*Server) StoreBatchCoprocessor ¶
func (svr *Server) StoreBatchCoprocessor(ctx context.Context, req *coprocessor.Request) []*coprocessor.StoreBatchTaskResponse
StoreBatchCoprocessor handle batched tasks in the same store.
func (*Server) UnsafeDestroyRange ¶
func (svr *Server) UnsafeDestroyRange(ctx context.Context, req *kvrpcpb.UnsafeDestroyRangeRequest) (*kvrpcpb.UnsafeDestroyRangeResponse, error)
UnsafeDestroyRange implements the tikvpb.TikvServer interface.
type StandAloneRegionManager ¶
type StandAloneRegionManager struct {
// contains filtered or unexported fields
}
StandAloneRegionManager represents a standalone region manager.
func NewStandAloneRegionManager ¶
func NewStandAloneRegionManager(bundle *mvcc.DBBundle, opts RegionOptions, pdc pd.Client) *StandAloneRegionManager
NewStandAloneRegionManager returns a new standalone region manager.
func (*StandAloneRegionManager) Close ¶
func (rm *StandAloneRegionManager) Close() error
Close closes the standalone region manager.
func (*StandAloneRegionManager) GetRegionFromCtx ¶
func (*StandAloneRegionManager) GetStoreAddrByStoreID ¶
func (*StandAloneRegionManager) GetStoreIDByAddr ¶
func (*StandAloneRegionManager) GetStoreInfoFromCtx ¶
func (*StandAloneRegionManager) SplitRegion ¶
func (rm *StandAloneRegionManager) SplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpcpb.SplitRegionResponse
SplitRegion splits a region.
type StandAlongInnerServer ¶
type StandAlongInnerServer struct {
// contains filtered or unexported fields
}
StandAlongInnerServer implements the InnerServer interface.
func NewStandAlongInnerServer ¶
func NewStandAlongInnerServer(bundle *mvcc.DBBundle) *StandAlongInnerServer
NewStandAlongInnerServer returns a new StandAlongInnerServer.
func (*StandAlongInnerServer) BatchRaft ¶
func (is *StandAlongInnerServer) BatchRaft(stream tikvpb.Tikv_BatchRaftServer) error
BatchRaft implements the InnerServer BatchRaft method.
func (*StandAlongInnerServer) Raft ¶
func (is *StandAlongInnerServer) Raft(stream tikvpb.Tikv_RaftServer) error
Raft implements the InnerServer Raft method.
func (*StandAlongInnerServer) Setup ¶
func (is *StandAlongInnerServer) Setup(pdClient pd.Client)
Setup implements the InnerServer Setup method.
func (*StandAlongInnerServer) Snapshot ¶
func (is *StandAlongInnerServer) Snapshot(stream tikvpb.Tikv_SnapshotServer) error
Snapshot implements the InnerServer Snapshot method.
func (*StandAlongInnerServer) Start ¶
func (is *StandAlongInnerServer) Start(pdClient pd.Client) error
Start implements the InnerServer Start method.
func (*StandAlongInnerServer) Stop ¶
func (is *StandAlongInnerServer) Stop() error
Stop implements the InnerServer Stop method.