Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeExtraTxnStatusKey(extraKey []byte) (key []byte)
- func DecodeKeyTS(buf []byte) uint64
- func EncodeExtraTxnStatusKey(key []byte, startTS uint64) []byte
- func EncodeLockCFValue(lock *MvccLock) ([]byte, []byte)
- func EncodeWriteCFValue(t WriteType, startTs uint64, shortVal []byte) []byte
- type DBBundle
- type DBSnapshot
- type DBUserMeta
- type DBWriter
- type LatchHandle
- type LockType
- type MvccLock
- type MvccLockHdr
- type WriteBatch
- type WriteCFValue
- type WriteType
Constants ¶
const ( LockUserMetaNoneByte = 0 LockUserMetaDeleteByte = 2 )
UserMeta value for lock.
const (
ShortValueMaxLen = 64
)
Variables ¶
var ( LockUserMetaNone = []byte{LockUserMetaNoneByte} LockUserMetaDelete = []byte{LockUserMetaDeleteByte} )
UserMeta byte slices for lock.
Functions ¶
func DecodeExtraTxnStatusKey ¶
DecodeExtraTxnStatusKey decodes a extra transaction status key.
func EncodeExtraTxnStatusKey ¶
EncodeExtraTxnStatusKey encodes a extra transaction status key. It is only used for Rollback and Op_Lock.
func EncodeLockCFValue ¶
EncodeLockCFValue encodes the mvcc lock and returns putLock value and putDefault value if exists.
Types ¶
type DBSnapshot ¶
func NewDBSnapshot ¶
func NewDBSnapshot(db *DBBundle) *DBSnapshot
type DBUserMeta ¶
type DBUserMeta []byte
DBUserMeta is the user meta used in DB.
func NewDBUserMeta ¶
func NewDBUserMeta(startTS, commitTS uint64) DBUserMeta
NewDBUserMeta creates a new DBUserMeta.
func (DBUserMeta) CommitTS ¶
func (m DBUserMeta) CommitTS() uint64
CommitTS reads the commitTS from the DBUserMeta.
func (DBUserMeta) StartTS ¶
func (m DBUserMeta) StartTS() uint64
StartTS reads the startTS from the DBUserMeta.
type DBWriter ¶
type DBWriter interface { Open() Close() Write(batch WriteBatch) error DeleteRange(start, end []byte, latchHandle LatchHandle) error NewWriteBatch(startTS, commitTS uint64, ctx *kvrpcpb.Context) WriteBatch }
DBWriter is the interface to persistent data.
type LatchHandle ¶
type MvccLock ¶
type MvccLock struct { MvccLockHdr Primary []byte Value []byte Secondaries [][]byte }
MvccLock is the structure for MVCC lock.
func DecodeLock ¶
DecodeLock decodes data to lock, the primary and value is copied, the secondaries are copied if async commit is enabled.
func ParseLockCFValue ¶
func (*MvccLock) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
type MvccLockHdr ¶
type MvccLockHdr struct { StartTS uint64 ForUpdateTS uint64 MinCommitTS uint64 TTL uint32 Op uint8 HasOldVer bool PrimaryLen uint16 UseAsyncCommit bool SecondaryNum uint32 }
MvccLockHdr holds fixed size fields for MvccLock.
type WriteBatch ¶
type WriteCFValue ¶
func ParseWriteCFValue ¶
func ParseWriteCFValue(data []byte) (wv WriteCFValue, err error)