Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Close() error
- func (c *Client) Get(ctx context.Context, key string, opt types.KVCCReadOption) (types.ValueCC, error)
- func (c *Client) RemoveTxnRecord(ctx context.Context, version uint64, opt types.KVCCRemoveTxnRecordOption) error
- func (c *Client) RollbackKey(ctx context.Context, key string, version uint64, ...) error
- func (c *Client) Set(ctx context.Context, key string, val types.Value, opt types.KVCCWriteOption) error
- func (c *Client) UpdateMeta(ctx context.Context, key string, version uint64, ...) error
- type KVCC
- func (kv *KVCC) Close() error
- func (kv *KVCC) Get(ctx context.Context, key string, opt types.KVCCReadOption) (types.ValueCC, error)
- func (kv *KVCC) RemoveTxnRecord(ctx context.Context, version uint64, opt types.KVCCRemoveTxnRecordOption) error
- func (kv *KVCC) RollbackKey(ctx context.Context, key string, version uint64, ...) (err error)
- func (kv *KVCC) Set(ctx context.Context, key string, val types.Value, opt types.KVCCWriteOption) error
- func (kv *KVCC) UpdateMeta(ctx context.Context, key string, version uint64, ...) (err error)
- type KeyInfo
- type Server
- type Stub
- func (stub *Stub) Get(ctx context.Context, req *kvccpb.KVCCGetRequest) (*kvccpb.KVCCGetResponse, error)
- func (stub *Stub) RemoveTxnRecord(ctx context.Context, req *kvccpb.KVCCRemoveTxnRecordRequest) (*kvccpb.KVCCRemoveTxnRecordResponse, error)
- func (stub *Stub) RollbackKey(ctx context.Context, req *kvccpb.KVCCRollbackKeyRequest) (*kvccpb.KVCCRollbackKeyResponse, error)
- func (stub *Stub) Set(ctx context.Context, req *kvccpb.KVCCSetRequest) (*kvccpb.KVCCSetResponse, error)
- func (stub *Stub) UpdateMeta(ctx context.Context, req *kvccpb.KVCCUpdateMetaRequest) (*kvccpb.KVCCUpdateMetaResponse, error)
- type TimestampCache
- func (cache *TimestampCache) FindWriters(key string, opt *types.KVCCReadOption) (w *transaction.Writer, writingWritersBefore transaction.WritingWriters, ...)
- func (cache *TimestampCache) GetMaxReaderVersion(key string) uint64
- func (cache *TimestampCache) RemoveVersion(key string, writerVersion uint64)
- func (cache *TimestampCache) TryLock(key string, meta types.DBMeta, txn *transaction.Transaction) (writer *transaction.Writer, err error)
Constants ¶
View Source
const OCCVerboseLevel = 160
View Source
const TimestampCacheVerboseLevel = 260
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) RemoveTxnRecord ¶
func (*Client) RollbackKey ¶
func (*Client) UpdateMeta ¶
type KVCC ¶
type KVCC struct { types.TabletTxnConfig // contains filtered or unexported fields }
KV with concurrency control
func NewKVCCForTesting ¶
func NewKVCCForTesting(db types.KV, cfg types.TabletTxnConfig) *KVCC
func (*KVCC) RemoveTxnRecord ¶
func (*KVCC) RollbackKey ¶
func (*KVCC) Set ¶
func (kv *KVCC) Set(ctx context.Context, key string, val types.Value, opt types.KVCCWriteOption) error
Set must be non-blocking in current io framework.
func (*KVCC) UpdateMeta ¶
type KeyInfo ¶
type KeyInfo struct {
// contains filtered or unexported fields
}
func NewKeyInfo ¶
func (*KeyInfo) GetMaxReaderVersion ¶
func (*KeyInfo) RemoveVersion ¶
func (*KeyInfo) TryLock ¶
func (i *KeyInfo) TryLock(dbMeta types.DBMeta, txn *transaction.Transaction) (writer *transaction.Writer, err error)
type Server ¶
type Server struct { Port int Done chan struct{} // contains filtered or unexported fields }
func NewServer ¶
func NewServer(port int, db types.KV, cfg types.TabletTxnConfig, gid int, store *topo.Store) *Server
readOnly indicate this is outer service
func NewServerForTesting ¶
type Stub ¶
type Stub struct {
// contains filtered or unexported fields
}
func (*Stub) Get ¶
func (stub *Stub) Get(ctx context.Context, req *kvccpb.KVCCGetRequest) (*kvccpb.KVCCGetResponse, error)
func (*Stub) RemoveTxnRecord ¶
func (stub *Stub) RemoveTxnRecord(ctx context.Context, req *kvccpb.KVCCRemoveTxnRecordRequest) (*kvccpb.KVCCRemoveTxnRecordResponse, error)
func (*Stub) RollbackKey ¶
func (stub *Stub) RollbackKey(ctx context.Context, req *kvccpb.KVCCRollbackKeyRequest) (*kvccpb.KVCCRollbackKeyResponse, error)
func (*Stub) Set ¶
func (stub *Stub) Set(ctx context.Context, req *kvccpb.KVCCSetRequest) (*kvccpb.KVCCSetResponse, error)
func (*Stub) UpdateMeta ¶
func (stub *Stub) UpdateMeta(ctx context.Context, req *kvccpb.KVCCUpdateMetaRequest) (*kvccpb.KVCCUpdateMetaResponse, error)
type TimestampCache ¶
type TimestampCache struct {
// contains filtered or unexported fields
}
func NewTimestampCache ¶
func NewTimestampCache() *TimestampCache
func (*TimestampCache) FindWriters ¶
func (cache *TimestampCache) FindWriters(key string, opt *types.KVCCReadOption) (w *transaction.Writer, writingWritersBefore transaction.WritingWriters, maxReadVersion uint64, err error)
func (*TimestampCache) GetMaxReaderVersion ¶
func (cache *TimestampCache) GetMaxReaderVersion(key string) uint64
func (*TimestampCache) RemoveVersion ¶
func (cache *TimestampCache) RemoveVersion(key string, writerVersion uint64)
func (*TimestampCache) TryLock ¶
func (cache *TimestampCache) TryLock(key string, meta types.DBMeta, txn *transaction.Transaction) (writer *transaction.Writer, err error)
Click to show internal directories.
Click to hide internal directories.