Documentation ¶
Index ¶
- Constants
- Variables
- func SafeIncr(version *uint64)
- func ValidateMGetRequest(keys []string) error
- func ValidateMSetRequest(keys []string, values [][]byte) error
- type Assertions
- type AtomicTxnId
- type AtomicTxnState
- func (s *AtomicTxnState) GetTxnState() TxnState
- func (s *AtomicTxnState) IsAborted() bool
- func (s *AtomicTxnState) IsCommitted() bool
- func (s *AtomicTxnState) IsStaging() bool
- func (s *AtomicTxnState) IsTerminated() bool
- func (s *AtomicTxnState) SetRollbacking() (abortOnce bool)
- func (s *AtomicTxnState) SetTxnState(state TxnState) (newState TxnState, terminateOnce bool)
- func (s *AtomicTxnState) SetTxnStateUnsafe(state TxnState) (newState TxnState, terminateOnce bool)
- func (s *AtomicTxnState) String() string
- type DBMeta
- type DBType
- type DBValue
- type KV
- type KVCC
- type KVCCOperationOption
- func (opt *KVCCOperationOption) CondSetOperatedByDifferentTxn(b bool)
- func (opt *KVCCOperationOption) CondSetReadModifyWrite(b bool)
- func (opt *KVCCOperationOption) CondSetReadOnlyKey(b bool)
- func (opt KVCCOperationOption) GetFlagAsUint32() uint32
- func (opt KVCCOperationOption) IsOperatedByDifferentTxn() bool
- func (opt KVCCOperationOption) IsReadModifyWrite() bool
- func (opt KVCCOperationOption) IsReadOnlyKey() bool
- type KVCCReadOption
- func (opt KVCCReadOption) CondReadModifyWrite(b bool) KVCCReadOption
- func (opt KVCCReadOption) CondReadModifyWriteFirstReadOfKey(b bool) KVCCReadOption
- func (opt KVCCReadOption) CondWaitWhenReadDirty(b bool) KVCCReadOption
- func (opt KVCCReadOption) GetKVReadVersion() uint64
- func (opt KVCCReadOption) IsGetMaxReadVersion() bool
- func (opt KVCCReadOption) IsMetaOnly() bool
- func (opt KVCCReadOption) IsReadExactVersion() bool
- func (opt KVCCReadOption) IsReadModifyWrite() bool
- func (opt KVCCReadOption) IsReadModifyWriteFirstReadOfKey() bool
- func (opt KVCCReadOption) IsSnapshotRead() bool
- func (opt KVCCReadOption) IsTxnRecord() bool
- func (opt KVCCReadOption) IsUpdateTimestampCache() bool
- func (opt KVCCReadOption) IsWaitWhenReadDirty() bool
- func (opt KVCCReadOption) ToKVReadOption() (kvOpt KVReadOption)
- func (opt KVCCReadOption) ToPB() *kvccpb.KVCCReadOption
- func (opt KVCCReadOption) WithExactVersion(exactVersion uint64) KVCCReadOption
- func (opt KVCCReadOption) WithIncrReaderVersion() KVCCReadOption
- func (opt KVCCReadOption) WithKVReadVersion(kvReadVersion uint64) (kvOpt KVReadOption)
- func (opt KVCCReadOption) WithMetaOnly() KVCCReadOption
- func (opt KVCCReadOption) WithNotGetMaxReadVersion() KVCCReadOption
- func (opt KVCCReadOption) WithNotUpdateTimestampCache() KVCCReadOption
- func (opt KVCCReadOption) WithTxnRecord() KVCCReadOption
- type KVCCRemoveTxnRecordOption
- func (opt KVCCRemoveTxnRecordOption) CondRemoveByDifferentTransaction(b bool) KVCCRemoveTxnRecordOption
- func (opt KVCCRemoveTxnRecordOption) CondRollback(b bool) KVCCRemoveTxnRecordOption
- func (opt KVCCRemoveTxnRecordOption) IsRollback() bool
- func (opt KVCCRemoveTxnRecordOption) ToPB() *kvccpb.KVCCRemoveTxnRecordOption
- type KVCCRollbackKeyOption
- func (opt KVCCRollbackKeyOption) CondReadModifyWrite(b bool) KVCCRollbackKeyOption
- func (opt KVCCRollbackKeyOption) CondReadOnlyKey(b bool) KVCCRollbackKeyOption
- func (opt KVCCRollbackKeyOption) CondRollbackByDifferentTxn(b bool) KVCCRollbackKeyOption
- func (opt KVCCRollbackKeyOption) ToPB() *kvccpb.KVCCRollbackKeyOption
- type KVCCUpdateMetaOption
- func (opt KVCCUpdateMetaOption) CondReadModifyWrite(b bool) KVCCUpdateMetaOption
- func (opt KVCCUpdateMetaOption) CondReadOnlyKey(b bool) KVCCUpdateMetaOption
- func (opt KVCCUpdateMetaOption) CondUpdateByDifferentTxn(b bool) KVCCUpdateMetaOption
- func (opt KVCCUpdateMetaOption) IsClearWriteIntent() bool
- func (opt KVCCUpdateMetaOption) ToKV() KVUpdateMetaOption
- func (opt KVCCUpdateMetaOption) ToPB() *kvccpb.KVCCUpdateMetaOption
- type KVCCWriteOption
- func (opt KVCCWriteOption) CondReadModifyWrite(b bool) KVCCWriteOption
- func (opt KVCCWriteOption) IsReadModifyWrite() bool
- func (opt KVCCWriteOption) IsTxnRecord() bool
- func (opt KVCCWriteOption) ToKVWriteOption() KVWriteOption
- func (opt *KVCCWriteOption) ToPB() *kvccpb.KVCCWriteOption
- func (opt KVCCWriteOption) WithTxnRecord() KVCCWriteOption
- type KVReadOption
- type KVUpdateMetaOption
- type KVWriteOption
- type ListTask
- type Meta
- func (m Meta) IsAborted() bool
- func (m Meta) IsCommitted() bool
- func (m Meta) IsDirty() bool
- func (m Meta) IsEmpty() bool
- func (m Meta) IsFirstWriteOfKey() bool
- func (m Meta) IsWriteOfKey() bool
- func (m *Meta) SetAborted()
- func (m *Meta) SetCommitted()
- func (m Meta) ToDB() DBMeta
- func (m Meta) ToPB() *commonpb.ValueMeta
- type ReadModifyWriteQueueCfg
- type ReadResultCC
- type RecordValuesTxn
- func (txn *RecordValuesTxn) Get(ctx context.Context, key string) (TValue, error)
- func (txn *RecordValuesTxn) GetReadValues() map[string]TValue
- func (txn *RecordValuesTxn) GetWriteValues() map[string]Value
- func (txn *RecordValuesTxn) HasWritten(key string) bool
- func (txn *RecordValuesTxn) MGet(ctx context.Context, keys []string) ([]TValue, error)
- func (txn *RecordValuesTxn) MSet(ctx context.Context, keys []string, values [][]byte) error
- func (txn *RecordValuesTxn) Set(ctx context.Context, key string, val []byte) error
- type RetryDetailItem
- type RetryDetailItems
- type RetryDetails
- type T
- type TValue
- type TValues
- type TabletTxnConfig
- func (cfg TabletTxnConfig) GetWaitTimestampCacheInvalidTimeout() time.Duration
- func (cfg TabletTxnConfig) String() string
- func (cfg TabletTxnConfig) SupportReadModifyWriteTxn() bool
- func (cfg TabletTxnConfig) Validate() error
- func (cfg TabletTxnConfig) WithMaxClockDrift(val time.Duration) TabletTxnConfig
- func (cfg TabletTxnConfig) WithStaleWriteThreshold(val time.Duration) TabletTxnConfig
- type TabletTxnConfigMarshaller
- type TabletTxnManagerConfig
- type TreeTask
- type Txn
- type TxnId
- type TxnInternalVersion
- type TxnKeyUnion
- type TxnKind
- type TxnManager
- type TxnManagerConfig
- func (cfg TxnManagerConfig) Validate() error
- func (cfg TxnManagerConfig) WithClearerNum(clearerNum int) TxnManagerConfig
- func (cfg TxnManagerConfig) WithMaxTaskBufferedPerPartition(maxTaskBufferedPerPartition int) TxnManagerConfig
- func (cfg TxnManagerConfig) WithReaderNum(readerNum int) TxnManagerConfig
- func (cfg TxnManagerConfig) WithWoundUncommittedTxnThreshold(woundUncommittedTxnThreshold time.Duration) TxnManagerConfig
- func (cfg TxnManagerConfig) WithWriterNum(writerNum int) TxnManagerConfig
- type TxnOption
- func (opt TxnOption) CondSnapshotReadDontAllowVersionBack(b bool) TxnOption
- func (opt TxnOption) ToPB() *txnpb.TxnOption
- func (opt TxnOption) WithRelativeSnapshotVersion(snapshotVersionDiff uint64) TxnOption
- func (opt TxnOption) WithSnapshotReadDontAllowVersionBack() TxnOption
- func (opt TxnOption) WithSnapshotReadMinAllowedSnapshotVersion(minAllowedSnapshotVersion uint64) TxnOption
- func (opt TxnOption) WithSnapshotReadRelativeMinAllowedSnapshotVersion(relativeMinAllowedSnapshotVersionDiff uint64) TxnOption
- func (opt TxnOption) WithSnapshotVersion(snapshotVersion uint64) TxnOption
- type TxnSnapshotReadOption
- func (opt TxnSnapshotReadOption) AllowsVersionBack() bool
- func (opt TxnSnapshotReadOption) Equals(another TxnSnapshotReadOption) bool
- func (opt TxnSnapshotReadOption) IsEmpty() bool
- func (opt TxnSnapshotReadOption) IsExplicitSnapshotVersion() bool
- func (opt TxnSnapshotReadOption) IsRelativeMinAllowedSnapshotVersion() bool
- func (opt TxnSnapshotReadOption) IsRelativeSnapshotVersion() bool
- func (opt *TxnSnapshotReadOption) SetSnapshotVersion(snapshotVersion uint64, checkMinAllowedSnapshotVersion bool)
- func (opt TxnSnapshotReadOption) String() string
- func (opt TxnSnapshotReadOption) ToPB() *txnpb.TxnSnapshotReadOption
- func (opt TxnSnapshotReadOption) WithClearDontAllowsVersionBack() TxnSnapshotReadOption
- type TxnState
- type TxnType
- type Value
- func (v Value) Int() (int, error)
- func (v Value) IsEmpty() bool
- func (v Value) MustInt() int
- func (v Value) String() string
- func (v Value) ToDB() DBValue
- func (v Value) ToPB() *commonpb.Value
- func (v Value) WithCommitted() Value
- func (v Value) WithInternalVersion(version TxnInternalVersion) Value
- func (v Value) WithMaxReadVersion(maxReadVersion uint64) ValueCC
- func (v Value) WithSnapshotVersion(snapshotVersion uint64) ValueCC
- func (v Value) WithVersion(version uint64) Value
- type ValueCC
- type ValueCCs
- type Writer
- type WriterHeap
- type Writers
Constants ¶
View Source
const ( MaxTxnVersionDate = "2200-01-01T00:00:00Z" MaxTxnVersion = uint64(7258118400000000000) MaxTxnId = TxnId(MaxTxnVersion) )
Variables ¶
View Source
var ( DBTypeMemory = addDBType("memory") DBTypeRedis = addDBType("redis") DBTypeMongo = addDBType("mongo") )
View Source
var ( BasicTxnTypesDesc string TxnTypeDefault = newBasicTxnType(0, "default") TxnTypeReadModifyWrite = newBasicTxnType(1, "read_modify_write") TxnTypeWaitWhenReadDirty = newBasicTxnType(1<<1, "wait_when_read_dirty") TxnTypeSnapshotRead = newBasicTxnType(1<<2, "snapshot_read") )
View Source
var AllDBTypes []DBType
View Source
var DefaultReadModifyWriteQueueCfg = NewReadModifyWriteQueueCfg( consts.MaxReadModifyWriteQueueCapacityPerKey, consts.ReadModifyWriteQueueMaxReadersRatio, consts.DefaultStaleWriteThreshold)
View Source
var DefaultTableTxnCfg = NewTabletTxnConfig(consts.DefaultStaleWriteThreshold)
View Source
var DefaultTableTxnManagerCfg = NewTabletTxnManagerConfig(DefaultTableTxnCfg, DefaultReadModifyWriteQueueCfg)
View Source
var EmptyDBValue = DBValue{}
View Source
var EmptyKVCCRemoveTxnRecordOption = KVCCRemoveTxnRecordOption{}
View Source
var EmptyKVCCRollbackKeyOption = KVCCRollbackKeyOption{}
View Source
var EmptyTValue = TValue{}
View Source
var EmptyValue = Value{}
View Source
var EmptyValueCC = ValueCC{}
View Source
var KVCCClearWriteIntent = KVCCUpdateMetaOption{KVCCOperationOption: KVCCOperationOption{Flag: KVKVCCUpdateMetaOptBitMaskClearWriteIntent}}
Functions ¶
func ValidateMGetRequest ¶
func ValidateMSetRequest ¶
Types ¶
type Assertions ¶
type Assertions struct {
testifyassert.Assertions
}
func NewAssertion ¶
func NewAssertion(t T) *Assertions
func (*Assertions) EqualIntValue ¶
func (assert *Assertions) EqualIntValue(exp Value, actual Value) (b bool)
func (*Assertions) EqualValue ¶
func (assert *Assertions) EqualValue(exp Value, actual Value) (b bool)
type AtomicTxnId ¶
type AtomicTxnId struct {
// contains filtered or unexported fields
}
AtomicTxnId is a wrapper with a simpler interface around atomic.(Add|Store|Load|CompareAndSwap)TxnId functions.
func NewAtomicTxnId ¶
func NewAtomicTxnId(n uint64) AtomicTxnId
NewAtomicTxnId initializes a new AtomicTxnId with a given value.
func (*AtomicTxnId) Get ¶
func (i *AtomicTxnId) Get() TxnId
Get atomically returns the current value.
func (*AtomicTxnId) SetIfBiggerUnsafe ¶
func (i *AtomicTxnId) SetIfBiggerUnsafe(id TxnId)
type AtomicTxnState ¶
type AtomicTxnState struct {
// contains filtered or unexported fields
}
func NewAtomicTxnState ¶
func NewAtomicTxnState(state TxnState) AtomicTxnState
func (*AtomicTxnState) GetTxnState ¶
func (s *AtomicTxnState) GetTxnState() TxnState
func (*AtomicTxnState) IsAborted ¶
func (s *AtomicTxnState) IsAborted() bool
func (*AtomicTxnState) IsCommitted ¶
func (s *AtomicTxnState) IsCommitted() bool
func (*AtomicTxnState) IsStaging ¶
func (s *AtomicTxnState) IsStaging() bool
func (*AtomicTxnState) IsTerminated ¶
func (s *AtomicTxnState) IsTerminated() bool
func (*AtomicTxnState) SetRollbacking ¶
func (s *AtomicTxnState) SetRollbacking() (abortOnce bool)
func (*AtomicTxnState) SetTxnState ¶
func (s *AtomicTxnState) SetTxnState(state TxnState) (newState TxnState, terminateOnce bool)
func (*AtomicTxnState) SetTxnStateUnsafe ¶
func (s *AtomicTxnState) SetTxnStateUnsafe(state TxnState) (newState TxnState, terminateOnce bool)
func (*AtomicTxnState) String ¶
func (s *AtomicTxnState) String() string
type DBMeta ¶
type DBMeta struct { Flag uint8 `json:"F"` InternalVersion TxnInternalVersion `json:"I"` }
func (DBMeta) IsCommitted ¶
func (DBMeta) WithVersion ¶
type KV ¶
type KV interface { Get(ctx context.Context, key string, opt KVReadOption) (Value, error) Set(ctx context.Context, key string, val Value, opt KVWriteOption) error UpdateMeta(ctx context.Context, key string, version uint64, opt KVUpdateMetaOption) error RollbackKey(ctx context.Context, key string, version uint64) error RemoveTxnRecord(ctx context.Context, version uint64) error Close() error }
type KVCC ¶
type KVCC interface { Get(ctx context.Context, key string, opt KVCCReadOption) (ValueCC, error) Set(ctx context.Context, key string, val Value, opt KVCCWriteOption) error UpdateMeta(ctx context.Context, key string, version uint64, opt KVCCUpdateMetaOption) error RollbackKey(ctx context.Context, key string, version uint64, opt KVCCRollbackKeyOption) error RemoveTxnRecord(ctx context.Context, version uint64, opt KVCCRemoveTxnRecordOption) error Close() error }
type KVCCOperationOption ¶
type KVCCOperationOption struct {
Flag uint8
}
func (*KVCCOperationOption) CondSetOperatedByDifferentTxn ¶
func (opt *KVCCOperationOption) CondSetOperatedByDifferentTxn(b bool)
func (*KVCCOperationOption) CondSetReadModifyWrite ¶
func (opt *KVCCOperationOption) CondSetReadModifyWrite(b bool)
func (*KVCCOperationOption) CondSetReadOnlyKey ¶
func (opt *KVCCOperationOption) CondSetReadOnlyKey(b bool)
func (KVCCOperationOption) GetFlagAsUint32 ¶
func (opt KVCCOperationOption) GetFlagAsUint32() uint32
func (KVCCOperationOption) IsOperatedByDifferentTxn ¶
func (opt KVCCOperationOption) IsOperatedByDifferentTxn() bool
func (KVCCOperationOption) IsReadModifyWrite ¶
func (opt KVCCOperationOption) IsReadModifyWrite() bool
func (KVCCOperationOption) IsReadOnlyKey ¶
func (opt KVCCOperationOption) IsReadOnlyKey() bool
type KVCCReadOption ¶
type KVCCReadOption struct { ReaderVersion uint64 ExactVersion uint64 MinAllowedSnapshotVersion uint64 // contains filtered or unexported fields }
func NewKVCCReadOption ¶
func NewKVCCReadOption(readerVersion uint64) KVCCReadOption
func NewKVCCReadOptionFromPB ¶
func NewKVCCReadOptionFromPB(x *kvccpb.KVCCReadOption) KVCCReadOption
func NewSnapshotKVCCReadOption ¶
func NewSnapshotKVCCReadOption(snapshotVersion uint64, minAllowedSnapshotVersion uint64) KVCCReadOption
func (KVCCReadOption) CondReadModifyWrite ¶
func (opt KVCCReadOption) CondReadModifyWrite(b bool) KVCCReadOption
func (KVCCReadOption) CondReadModifyWriteFirstReadOfKey ¶
func (opt KVCCReadOption) CondReadModifyWriteFirstReadOfKey(b bool) KVCCReadOption
func (KVCCReadOption) CondWaitWhenReadDirty ¶
func (opt KVCCReadOption) CondWaitWhenReadDirty(b bool) KVCCReadOption
func (KVCCReadOption) GetKVReadVersion ¶
func (opt KVCCReadOption) GetKVReadVersion() uint64
func (KVCCReadOption) IsGetMaxReadVersion ¶
func (opt KVCCReadOption) IsGetMaxReadVersion() bool
func (KVCCReadOption) IsMetaOnly ¶
func (opt KVCCReadOption) IsMetaOnly() bool
func (KVCCReadOption) IsReadExactVersion ¶
func (opt KVCCReadOption) IsReadExactVersion() bool
func (KVCCReadOption) IsReadModifyWrite ¶
func (opt KVCCReadOption) IsReadModifyWrite() bool
func (KVCCReadOption) IsReadModifyWriteFirstReadOfKey ¶
func (opt KVCCReadOption) IsReadModifyWriteFirstReadOfKey() bool
func (KVCCReadOption) IsSnapshotRead ¶
func (opt KVCCReadOption) IsSnapshotRead() bool
func (KVCCReadOption) IsTxnRecord ¶
func (opt KVCCReadOption) IsTxnRecord() bool
func (KVCCReadOption) IsUpdateTimestampCache ¶
func (opt KVCCReadOption) IsUpdateTimestampCache() bool
func (KVCCReadOption) IsWaitWhenReadDirty ¶
func (opt KVCCReadOption) IsWaitWhenReadDirty() bool
func (KVCCReadOption) ToKVReadOption ¶
func (opt KVCCReadOption) ToKVReadOption() (kvOpt KVReadOption)
func (KVCCReadOption) ToPB ¶
func (opt KVCCReadOption) ToPB() *kvccpb.KVCCReadOption
func (KVCCReadOption) WithExactVersion ¶
func (opt KVCCReadOption) WithExactVersion(exactVersion uint64) KVCCReadOption
func (KVCCReadOption) WithIncrReaderVersion ¶
func (opt KVCCReadOption) WithIncrReaderVersion() KVCCReadOption
func (KVCCReadOption) WithKVReadVersion ¶
func (opt KVCCReadOption) WithKVReadVersion(kvReadVersion uint64) (kvOpt KVReadOption)
func (KVCCReadOption) WithMetaOnly ¶
func (opt KVCCReadOption) WithMetaOnly() KVCCReadOption
func (KVCCReadOption) WithNotGetMaxReadVersion ¶
func (opt KVCCReadOption) WithNotGetMaxReadVersion() KVCCReadOption
func (KVCCReadOption) WithNotUpdateTimestampCache ¶
func (opt KVCCReadOption) WithNotUpdateTimestampCache() KVCCReadOption
func (KVCCReadOption) WithTxnRecord ¶
func (opt KVCCReadOption) WithTxnRecord() KVCCReadOption
type KVCCRemoveTxnRecordOption ¶
type KVCCRemoveTxnRecordOption struct {
KVCCOperationOption
}
func NewKVCCCRemoveTxnRecordOptionFromPB ¶
func NewKVCCCRemoveTxnRecordOptionFromPB(opt *kvccpb.KVCCRemoveTxnRecordOption) KVCCRemoveTxnRecordOption
func (KVCCRemoveTxnRecordOption) CondRemoveByDifferentTransaction ¶
func (opt KVCCRemoveTxnRecordOption) CondRemoveByDifferentTransaction(b bool) KVCCRemoveTxnRecordOption
func (KVCCRemoveTxnRecordOption) CondRollback ¶
func (opt KVCCRemoveTxnRecordOption) CondRollback(b bool) KVCCRemoveTxnRecordOption
func (KVCCRemoveTxnRecordOption) IsRollback ¶
func (opt KVCCRemoveTxnRecordOption) IsRollback() bool
func (KVCCRemoveTxnRecordOption) ToPB ¶
func (opt KVCCRemoveTxnRecordOption) ToPB() *kvccpb.KVCCRemoveTxnRecordOption
type KVCCRollbackKeyOption ¶
type KVCCRollbackKeyOption struct {
KVCCOperationOption
}
func NewKVCCCRollbackKeyOptionFromPB ¶
func NewKVCCCRollbackKeyOptionFromPB(opt *kvccpb.KVCCRollbackKeyOption) KVCCRollbackKeyOption
func (KVCCRollbackKeyOption) CondReadModifyWrite ¶
func (opt KVCCRollbackKeyOption) CondReadModifyWrite(b bool) KVCCRollbackKeyOption
func (KVCCRollbackKeyOption) CondReadOnlyKey ¶
func (opt KVCCRollbackKeyOption) CondReadOnlyKey(b bool) KVCCRollbackKeyOption
func (KVCCRollbackKeyOption) CondRollbackByDifferentTxn ¶
func (opt KVCCRollbackKeyOption) CondRollbackByDifferentTxn(b bool) KVCCRollbackKeyOption
func (KVCCRollbackKeyOption) ToPB ¶
func (opt KVCCRollbackKeyOption) ToPB() *kvccpb.KVCCRollbackKeyOption
type KVCCUpdateMetaOption ¶
type KVCCUpdateMetaOption struct {
KVCCOperationOption
}
func NewKVCCCUpdateMetaOptionFromPB ¶
func NewKVCCCUpdateMetaOptionFromPB(opt *kvccpb.KVCCUpdateMetaOption) KVCCUpdateMetaOption
func (KVCCUpdateMetaOption) CondReadModifyWrite ¶
func (opt KVCCUpdateMetaOption) CondReadModifyWrite(b bool) KVCCUpdateMetaOption
func (KVCCUpdateMetaOption) CondReadOnlyKey ¶
func (opt KVCCUpdateMetaOption) CondReadOnlyKey(b bool) KVCCUpdateMetaOption
func (KVCCUpdateMetaOption) CondUpdateByDifferentTxn ¶
func (opt KVCCUpdateMetaOption) CondUpdateByDifferentTxn(b bool) KVCCUpdateMetaOption
func (KVCCUpdateMetaOption) IsClearWriteIntent ¶
func (opt KVCCUpdateMetaOption) IsClearWriteIntent() bool
func (KVCCUpdateMetaOption) ToKV ¶
func (opt KVCCUpdateMetaOption) ToKV() KVUpdateMetaOption
func (KVCCUpdateMetaOption) ToPB ¶
func (opt KVCCUpdateMetaOption) ToPB() *kvccpb.KVCCUpdateMetaOption
type KVCCWriteOption ¶
type KVCCWriteOption struct {
// contains filtered or unexported fields
}
func NewKVCCWriteOption ¶
func NewKVCCWriteOption() KVCCWriteOption
func NewKVCCWriteOptionFromPB ¶
func NewKVCCWriteOptionFromPB(x *kvccpb.KVCCWriteOption) KVCCWriteOption
func (KVCCWriteOption) CondReadModifyWrite ¶
func (opt KVCCWriteOption) CondReadModifyWrite(b bool) KVCCWriteOption
func (KVCCWriteOption) IsReadModifyWrite ¶
func (opt KVCCWriteOption) IsReadModifyWrite() bool
func (KVCCWriteOption) IsTxnRecord ¶
func (opt KVCCWriteOption) IsTxnRecord() bool
func (KVCCWriteOption) ToKVWriteOption ¶
func (opt KVCCWriteOption) ToKVWriteOption() KVWriteOption
func (*KVCCWriteOption) ToPB ¶
func (opt *KVCCWriteOption) ToPB() *kvccpb.KVCCWriteOption
func (KVCCWriteOption) WithTxnRecord ¶
func (opt KVCCWriteOption) WithTxnRecord() KVCCWriteOption
type KVReadOption ¶
func NewKVReadOption ¶
func NewKVReadOption(Version uint64) KVReadOption
func NewKVReadOptionFromPB ¶
func NewKVReadOptionFromPB(x *kvpb.KVReadOption) KVReadOption
func (KVReadOption) IsMetaOnly ¶
func (opt KVReadOption) IsMetaOnly() bool
func (KVReadOption) IsReadExactVersion ¶
func (opt KVReadOption) IsReadExactVersion() bool
func (KVReadOption) IsTxnRecord ¶
func (opt KVReadOption) IsTxnRecord() bool
func (KVReadOption) ToPB ¶
func (opt KVReadOption) ToPB() *kvpb.KVReadOption
func (KVReadOption) WithExactVersion ¶
func (opt KVReadOption) WithExactVersion() KVReadOption
func (KVReadOption) WithTxnRecord ¶
func (opt KVReadOption) WithTxnRecord() KVReadOption
type KVUpdateMetaOption ¶
type KVUpdateMetaOption uint8
func NewKVUpdateMetaOptionFromPB ¶
func NewKVUpdateMetaOptionFromPB(opt *kvpb.KVUpdateMetaOption) KVUpdateMetaOption
func (KVUpdateMetaOption) IsClearWriteIntent ¶
func (opt KVUpdateMetaOption) IsClearWriteIntent() bool
func (KVUpdateMetaOption) ToPB ¶
func (opt KVUpdateMetaOption) ToPB() *kvpb.KVUpdateMetaOption
type KVWriteOption ¶
type KVWriteOption struct {
// contains filtered or unexported fields
}
func NewKVWriteOption ¶
func NewKVWriteOption() KVWriteOption
func NewKVWriteOptionFromPB ¶
func NewKVWriteOptionFromPB(x *kvpb.KVWriteOption) KVWriteOption
func (KVWriteOption) IsTxnRecord ¶
func (opt KVWriteOption) IsTxnRecord() bool
func (*KVWriteOption) ToPB ¶
func (opt *KVWriteOption) ToPB() *kvpb.KVWriteOption
func (KVWriteOption) WithTxnRecord ¶
func (opt KVWriteOption) WithTxnRecord() KVWriteOption
type ListTask ¶
func NewListTaskNoResult ¶
func NewListTaskWithResult ¶
func (*ListTask) Initialize ¶
type Meta ¶
type Meta struct { Version uint64 InternalVersion TxnInternalVersion Flag uint8 }
func NewMetaFromPB ¶
func (Meta) IsCommitted ¶
func (Meta) IsFirstWriteOfKey ¶
func (Meta) IsWriteOfKey ¶
func (*Meta) SetAborted ¶
func (m *Meta) SetAborted()
func (*Meta) SetCommitted ¶
func (m *Meta) SetCommitted()
type ReadModifyWriteQueueCfg ¶
type ReadModifyWriteQueueCfg struct { CapacityPerKey int MaxReadersRatio float64 MaxQueuedAge time.Duration }
func NewReadModifyWriteQueueCfg ¶
func NewReadModifyWriteQueueCfg( capacityPerKey int, maxReadersRatio float64, maxQueuedAge time.Duration) ReadModifyWriteQueueCfg
func (ReadModifyWriteQueueCfg) WithMaxQueuedAge ¶
func (cfg ReadModifyWriteQueueCfg) WithMaxQueuedAge(maxQueuedAge time.Duration) ReadModifyWriteQueueCfg
type ReadResultCC ¶
func (ReadResultCC) Contains ¶
func (r ReadResultCC) Contains(key string) bool
func (ReadResultCC) MustFirst ¶
func (r ReadResultCC) MustFirst() string
type RecordValuesTxn ¶
type RecordValuesTxn struct { Txn // contains filtered or unexported fields }
func NewRecordValuesTxn ¶
func NewRecordValuesTxn(txn Txn) *RecordValuesTxn
func (*RecordValuesTxn) GetReadValues ¶
func (txn *RecordValuesTxn) GetReadValues() map[string]TValue
func (*RecordValuesTxn) GetWriteValues ¶
func (txn *RecordValuesTxn) GetWriteValues() map[string]Value
func (*RecordValuesTxn) HasWritten ¶
func (txn *RecordValuesTxn) HasWritten(key string) bool
type RetryDetailItem ¶
func (RetryDetailItem) String ¶
func (i RetryDetailItem) String() string
type RetryDetailItems ¶
type RetryDetailItems []RetryDetailItem
func (RetryDetailItems) Len ¶
func (r RetryDetailItems) Len() int
func (RetryDetailItems) Less ¶
func (r RetryDetailItems) Less(i, j int) bool
func (RetryDetailItems) Swap ¶
func (r RetryDetailItems) Swap(i, j int)
type RetryDetails ¶
func (RetryDetails) Collect ¶
func (d RetryDetails) Collect(another RetryDetails)
func (RetryDetails) GetSortedRetryDetails ¶
func (d RetryDetails) GetSortedRetryDetails() (items RetryDetailItems)
func (RetryDetails) String ¶
func (d RetryDetails) String() string
type TValue ¶
func NewTValueFromPB ¶
func NewTValuesFromPB ¶
func (TValue) CondPreventedFutureWrite ¶
func (TValue) IsFutureWritePrevented ¶
type TabletTxnConfig ¶
func NewTabletTxnConfig ¶
func NewTabletTxnConfig(staleWriteThreshold time.Duration) TabletTxnConfig
func (TabletTxnConfig) GetWaitTimestampCacheInvalidTimeout ¶
func (cfg TabletTxnConfig) GetWaitTimestampCacheInvalidTimeout() time.Duration
func (TabletTxnConfig) String ¶
func (cfg TabletTxnConfig) String() string
func (TabletTxnConfig) SupportReadModifyWriteTxn ¶
func (cfg TabletTxnConfig) SupportReadModifyWriteTxn() bool
func (TabletTxnConfig) Validate ¶
func (cfg TabletTxnConfig) Validate() error
func (TabletTxnConfig) WithMaxClockDrift ¶
func (cfg TabletTxnConfig) WithMaxClockDrift(val time.Duration) TabletTxnConfig
func (TabletTxnConfig) WithStaleWriteThreshold ¶
func (cfg TabletTxnConfig) WithStaleWriteThreshold(val time.Duration) TabletTxnConfig
type TabletTxnManagerConfig ¶
type TabletTxnManagerConfig struct { TabletTxnConfig ReadModifyWriteQueueCfg // outputs TxnLifeSpan time.Duration }
func NewTabletTxnManagerConfig ¶
func NewTabletTxnManagerConfig( tabletCfg TabletTxnConfig, readModifyWriteQueueCfg ReadModifyWriteQueueCfg) TabletTxnManagerConfig
func (TabletTxnManagerConfig) Sanitize ¶
func (c TabletTxnManagerConfig) Sanitize() TabletTxnManagerConfig
type TreeTask ¶
func NewTreeTaskNoResult ¶
func NewTreeTaskWithResult ¶
func (*TreeTask) AllChildrenSuccess ¶
func (*TreeTask) ChildrenSuccess ¶
type Txn ¶
type Txn interface { GetId() TxnId GetState() TxnState GetType() TxnType GetSnapshotReadOption() TxnSnapshotReadOption // only used when txn type is snapshot Get(ctx context.Context, key string) (TValue, error) MGet(ctx context.Context, keys []string) (values []TValue, err error) Set(ctx context.Context, key string, val []byte) error // async func, doesn't guarantee see set result after call MSet(ctx context.Context, keys []string, values [][]byte) error Commit(ctx context.Context) error Rollback(ctx context.Context) error GetReadValues() map[string]TValue GetWriteValues() map[string]Value }
type TxnInternalVersion ¶
type TxnInternalVersion uint8
const ( TxnInternalVersionMin TxnInternalVersion = consts.MinTxnInternalVersion TxnInternalVersionMax TxnInternalVersion = consts.MaxTxnInternalVersion TxnInternalVersionPositiveInvalid TxnInternalVersion = consts.PositiveInvalidTxnInternalVersion )
func (TxnInternalVersion) IsValid ¶
func (v TxnInternalVersion) IsValid() bool
type TxnKeyUnion ¶
func (TxnKeyUnion) Hash ¶
func (tk TxnKeyUnion) Hash() uint64
func (TxnKeyUnion) String ¶
func (tk TxnKeyUnion) String() string
type TxnManager ¶
type TxnManagerConfig ¶
type TxnManagerConfig struct { WoundUncommittedTxnThreshold time.Duration ClearerNum, WriterNum, ReaderNum int ClearTimeout time.Duration MaxTaskBufferedPerPartition int SnapshotBackwardPeriod time.Duration }
func NewTxnManagerConfig ¶
func NewTxnManagerConfig(woundUncommittedTxnThreshold time.Duration) TxnManagerConfig
func (TxnManagerConfig) Validate ¶
func (cfg TxnManagerConfig) Validate() error
func (TxnManagerConfig) WithClearerNum ¶
func (cfg TxnManagerConfig) WithClearerNum(clearerNum int) TxnManagerConfig
func (TxnManagerConfig) WithMaxTaskBufferedPerPartition ¶
func (cfg TxnManagerConfig) WithMaxTaskBufferedPerPartition(maxTaskBufferedPerPartition int) TxnManagerConfig
func (TxnManagerConfig) WithReaderNum ¶
func (cfg TxnManagerConfig) WithReaderNum(readerNum int) TxnManagerConfig
func (TxnManagerConfig) WithWoundUncommittedTxnThreshold ¶
func (cfg TxnManagerConfig) WithWoundUncommittedTxnThreshold(woundUncommittedTxnThreshold time.Duration) TxnManagerConfig
func (TxnManagerConfig) WithWriterNum ¶
func (cfg TxnManagerConfig) WithWriterNum(writerNum int) TxnManagerConfig
type TxnOption ¶
type TxnOption struct { TxnType SnapshotReadOption TxnSnapshotReadOption // only valid if TxnType is SnapshotRead }
func NewDefaultTxnOption ¶
func NewDefaultTxnOption() TxnOption
func NewTxnOption ¶
func NewTxnOptionFromPB ¶
func (TxnOption) CondSnapshotReadDontAllowVersionBack ¶
func (TxnOption) WithRelativeSnapshotVersion ¶
func (TxnOption) WithSnapshotReadDontAllowVersionBack ¶
func (TxnOption) WithSnapshotReadMinAllowedSnapshotVersion ¶
func (TxnOption) WithSnapshotReadRelativeMinAllowedSnapshotVersion ¶
func (TxnOption) WithSnapshotVersion ¶
type TxnSnapshotReadOption ¶
type TxnSnapshotReadOption struct { SnapshotVersion uint64 MinAllowedSnapshotVersion uint64 // contains filtered or unexported fields }
func NewTxnSnapshotReadOptionFromPB ¶
func NewTxnSnapshotReadOptionFromPB(opt *txnpb.TxnSnapshotReadOption) TxnSnapshotReadOption
func (TxnSnapshotReadOption) AllowsVersionBack ¶
func (opt TxnSnapshotReadOption) AllowsVersionBack() bool
func (TxnSnapshotReadOption) Equals ¶
func (opt TxnSnapshotReadOption) Equals(another TxnSnapshotReadOption) bool
func (TxnSnapshotReadOption) IsEmpty ¶
func (opt TxnSnapshotReadOption) IsEmpty() bool
func (TxnSnapshotReadOption) IsExplicitSnapshotVersion ¶
func (opt TxnSnapshotReadOption) IsExplicitSnapshotVersion() bool
func (TxnSnapshotReadOption) IsRelativeMinAllowedSnapshotVersion ¶
func (opt TxnSnapshotReadOption) IsRelativeMinAllowedSnapshotVersion() bool
func (TxnSnapshotReadOption) IsRelativeSnapshotVersion ¶
func (opt TxnSnapshotReadOption) IsRelativeSnapshotVersion() bool
func (*TxnSnapshotReadOption) SetSnapshotVersion ¶
func (opt *TxnSnapshotReadOption) SetSnapshotVersion(snapshotVersion uint64, checkMinAllowedSnapshotVersion bool)
func (TxnSnapshotReadOption) String ¶
func (opt TxnSnapshotReadOption) String() string
func (TxnSnapshotReadOption) ToPB ¶
func (opt TxnSnapshotReadOption) ToPB() *txnpb.TxnSnapshotReadOption
func (TxnSnapshotReadOption) WithClearDontAllowsVersionBack ¶
func (opt TxnSnapshotReadOption) WithClearDontAllowsVersionBack() TxnSnapshotReadOption
type TxnType ¶
type TxnType uint8
func ParseTxnType ¶
func (TxnType) CondWaitWhenReadDirty ¶
func (TxnType) IsReadModifyWrite ¶
func (TxnType) IsSnapshotRead ¶
func (TxnType) IsWaitWhenReadDirty ¶
type Value ¶
func NewIntValue ¶
func NewValueFromPB ¶
func (Value) WithCommitted ¶
func (Value) WithInternalVersion ¶
func (v Value) WithInternalVersion(version TxnInternalVersion) Value
func (Value) WithMaxReadVersion ¶
func (Value) WithSnapshotVersion ¶
func (Value) WithVersion ¶
type ValueCC ¶
func NewValueCCFromPB ¶
func (ValueCC) WithCommitted ¶
func (ValueCC) WithMaxReadVersion ¶
Hide Value::WithMaxReadVersion
func (ValueCC) WithSnapshotVersion ¶
Hide Value::WithMaxReadVersion
type Writer ¶
type Writer struct { Version uint64 OnUnlocked func() Next *Writer // contains filtered or unexported fields }
Deprecated
func (*Writer) IsRollbacked ¶
func (*Writer) MarkRollbacked ¶
func (w *Writer) MarkRollbacked()
func (*Writer) WaitFinish ¶
func (w *Writer) WaitFinish()
type WriterHeap ¶
type WriterHeap Writers
func (*WriterHeap) Initialize ¶
func (h *WriterHeap) Initialize()
func (WriterHeap) Min ¶
func (h WriterHeap) Min() *Writer
func (*WriterHeap) MustContain ¶
func (h *WriterHeap) MustContain(writers ...*Writer)
func (*WriterHeap) Push ¶
func (h *WriterHeap) Push(x *Writer)
func (*WriterHeap) Remove ¶
func (h *WriterHeap) Remove(writer *Writer)
type Writers ¶
type Writers struct {
// contains filtered or unexported fields
}
func (*Writers) Initialize ¶
func (ws *Writers) Initialize()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.