Documentation ¶
Index ¶
- Variables
- func MustParseGetPayload(payload []byte) [][]byte
- func NewGetTxnRequest(ks [][]byte) txn.TxnRequest
- func NewMemLog() logservice.Client
- func NewSetTxnRequest(ks, vs [][]byte) txn.TxnRequest
- type Event
- type EventType
- type KV
- type KVLog
- type KVTxnStorage
- func (kv *KVTxnStorage) Commit(txnMeta txn.TxnMeta) error
- func (kv *KVTxnStorage) Committing(txnMeta txn.TxnMeta) error
- func (kv *KVTxnStorage) GetCommittedKV() *MVCCKV
- func (kv *KVTxnStorage) GetEventC() chan Event
- func (kv *KVTxnStorage) GetLatestLsn() logservice.Lsn
- func (kv *KVTxnStorage) GetUncommittedKV() *KV
- func (kv *KVTxnStorage) GetUncommittedTxn(txnID []byte) *txn.TxnMeta
- func (kv *KVTxnStorage) Prepare(txnMeta txn.TxnMeta) error
- func (kv *KVTxnStorage) Read(txnMeta txn.TxnMeta, op uint32, payload []byte) (storage.ReadResult, error)
- func (kv *KVTxnStorage) Rollback(txnMeta txn.TxnMeta) error
- func (kv *KVTxnStorage) StartRecovery(c chan txn.TxnMeta)
- func (kv *KVTxnStorage) Write(txnMeta txn.TxnMeta, op uint32, payload []byte) ([]byte, error)
- type MVCCKV
- func (mkv *MVCCKV) AscendRange(rawKey []byte, from timestamp.Timestamp, to timestamp.Timestamp, ...)
- func (mkv *MVCCKV) Delete(rawKey []byte, ts timestamp.Timestamp) bool
- func (mkv *MVCCKV) Get(rawKey []byte, ts timestamp.Timestamp) ([]byte, bool)
- func (mkv *MVCCKV) Set(rawKey []byte, ts timestamp.Timestamp, value []byte)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PrepareType prepare event PrepareType = EventType(0) // CommitType commit event CommitType = EventType(1) // CommittingType committing type CommittingType = EventType(2) // RollbackType rollback type RollbackType = EventType(3) )
Functions ¶
func MustParseGetPayload ¶
MustParseGetPayload must parse get payload
func NewGetTxnRequest ¶
func NewGetTxnRequest(ks [][]byte) txn.TxnRequest
NewGetTxnRequest returns a kv get txn request
func NewSetTxnRequest ¶
func NewSetTxnRequest(ks, vs [][]byte) txn.TxnRequest
NewSetTxnRequest returns a kv set txn request
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
KV mem kv based on btree. Just used to test transaction.
func (*KV) AscendRange ¶
AscendRange iter in [start, end)
type KVLog ¶
type KVLog struct { Txn txn.TxnMeta `json:"txn"` Keys [][]byte `json:"key,omitempty"` Values [][]byte `json:"value,omitempty"` }
KVLog kv log
func (*KVLog) MustUnmarshal ¶
MustUnmarshal must unmarshal
type KVTxnStorage ¶
KVTxnStorage KV-based implementation of TxnStorage. Just used to test.
func NewKVTxnStorage ¶
func NewKVTxnStorage(latest logservice.Lsn, logClient logservice.Client) *KVTxnStorage
NewKVTxnStorage create KV-based implementation of TxnStorage
func (*KVTxnStorage) Committing ¶
func (kv *KVTxnStorage) Committing(txnMeta txn.TxnMeta) error
func (*KVTxnStorage) GetCommittedKV ¶
func (kv *KVTxnStorage) GetCommittedKV() *MVCCKV
func (*KVTxnStorage) GetEventC ¶ added in v0.5.1
func (kv *KVTxnStorage) GetEventC() chan Event
func (*KVTxnStorage) GetLatestLsn ¶
func (kv *KVTxnStorage) GetLatestLsn() logservice.Lsn
func (*KVTxnStorage) GetUncommittedKV ¶
func (kv *KVTxnStorage) GetUncommittedKV() *KV
func (*KVTxnStorage) GetUncommittedTxn ¶
func (kv *KVTxnStorage) GetUncommittedTxn(txnID []byte) *txn.TxnMeta
func (*KVTxnStorage) Read ¶
func (kv *KVTxnStorage) Read(txnMeta txn.TxnMeta, op uint32, payload []byte) (storage.ReadResult, error)
func (*KVTxnStorage) StartRecovery ¶
func (kv *KVTxnStorage) StartRecovery(c chan txn.TxnMeta)
type MVCCKV ¶
type MVCCKV struct {
// contains filtered or unexported fields
}
MVCCKV mvcc kv based on KV
func (*MVCCKV) AscendRange ¶
func (mkv *MVCCKV) AscendRange(rawKey []byte, from timestamp.Timestamp, to timestamp.Timestamp, fn func([]byte, timestamp.Timestamp))
AscendRange iter in [rawkey:from, rawkey:to)
Click to show internal directories.
Click to hide internal directories.