Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCommandFrom(r io.Reader) (cmd txnif.TxnCmd, n int64, err error)
- func CompareTxnMVCCNode(e, o *TxnMVCCNode) int
- func IDCtxToID(buf []byte) string
- func IDToIDCtx(id uint64) []byte
- func IsCustomizedCmd(cmd txnif.TxnCmd) bool
- func MarshalID(id *common.ID) []byte
- func TxnField(txn txnif.AsyncTxn) zap.Field
- func TxnMgrField(mgr *TxnManager) zap.Field
- func UnmarshalID(buf []byte) *common.ID
- type BaseCmd
- type BaseCustomizedCmd
- type BatchCmd
- func (e *BatchCmd) ApplyCommit()
- func (e *BatchCmd) ApplyRollback()
- func (e *BatchCmd) Close()
- func (e *BatchCmd) Desc() string
- func (e *BatchCmd) GetType() int16
- func (e *BatchCmd) Marshal() (buf []byte, err error)
- func (e *BatchCmd) ReadFrom(r io.Reader) (n int64, err error)
- func (e *BatchCmd) SetReplayTxn(_ txnif.AsyncTxn)
- func (e *BatchCmd) String() string
- func (e *BatchCmd) Unmarshal(buf []byte) error
- func (e *BatchCmd) VerboseString() string
- func (e *BatchCmd) WriteTo(w io.Writer) (n int64, err error)
- type ComposedCmd
- func (cc *ComposedCmd) AddCmd(cmd txnif.TxnCmd)
- func (cc *ComposedCmd) ApplyCommit()
- func (cc *ComposedCmd) ApplyRollback()
- func (cc *ComposedCmd) Close()
- func (cc *ComposedCmd) Desc() string
- func (cc *ComposedCmd) GetType() int16
- func (cc *ComposedCmd) Marshal() (buf []byte, err error)
- func (cc *ComposedCmd) ReadFrom(r io.Reader) (n int64, err error)
- func (cc *ComposedCmd) SetCmdSize(size uint32)
- func (cc *ComposedCmd) SetReplayTxn(txn txnif.AsyncTxn)
- func (cc *ComposedCmd) String() string
- func (cc *ComposedCmd) ToDesc(prefix string) string
- func (cc *ComposedCmd) ToString(prefix string) string
- func (cc *ComposedCmd) ToVerboseString(prefix string) string
- func (cc *ComposedCmd) Unmarshal(buf []byte) (err error)
- func (cc *ComposedCmd) VerboseString() string
- func (cc *ComposedCmd) WriteTo(w io.Writer) (n int64, err error)
- type CustomizedCmd
- type DeleteBitmapCmd
- func (e *DeleteBitmapCmd) ApplyCommit()
- func (e *DeleteBitmapCmd) ApplyRollback()
- func (e *DeleteBitmapCmd) Desc() string
- func (e *DeleteBitmapCmd) GetType() int16
- func (e *DeleteBitmapCmd) Marshal() (buf []byte, err error)
- func (e *DeleteBitmapCmd) ReadFrom(r io.Reader) (n int64, err error)
- func (e *DeleteBitmapCmd) SetReplayTxn(_ txnif.AsyncTxn)
- func (e *DeleteBitmapCmd) String() string
- func (e *DeleteBitmapCmd) Unmarshal(buf []byte) error
- func (e *DeleteBitmapCmd) VerboseString() string
- func (e *DeleteBitmapCmd) WriteTo(w io.Writer) (n int64, err error)
- type MVCCChain
- func (be *MVCCChain) Apply1PCCommit(index *wal.Index) error
- func (be *MVCCChain) ApplyCommit(index *wal.Index) error
- func (be *MVCCChain) ApplyRollback(index *wal.Index) error
- func (be *MVCCChain) CheckConflict(txn txnif.TxnReader) (err error)
- func (be *MVCCChain) CloneCommittedInRange(start, end types.TS) (ret *MVCCChain)
- func (be *MVCCChain) CloneLatestNode() (*MVCCChain, txnif.MVCCNode)
- func (be *MVCCChain) ClonePreparedInRange(start, end types.TS) (ret []txnif.MVCCNode)
- func (be *MVCCChain) Depth() int
- func (be *MVCCChain) GetIndexes() []*wal.Index
- func (be *MVCCChain) GetLatestCommittedNode() (node txnif.MVCCNode)
- func (be *MVCCChain) GetLatestNodeLocked() txnif.MVCCNode
- func (be *MVCCChain) GetLogIndex() *wal.Index
- func (be *MVCCChain) GetPrepareTs() types.TS
- func (be *MVCCChain) GetTxn() txnif.TxnReader
- func (be *MVCCChain) GetVisibleNode(ts types.TS) (node txnif.MVCCNode)
- func (be *MVCCChain) HasCommittedNode() bool
- func (be *MVCCChain) HasCommittedNodeInRange(start, end types.TS) (ok bool)
- func (be *MVCCChain) HasUncommittedNode() bool
- func (be *MVCCChain) Insert(vun txnif.MVCCNode) (node *common.GenericDLNode[txnif.MVCCNode])
- func (be *MVCCChain) IsCommitted() bool
- func (be *MVCCChain) IsCommitting() bool
- func (be *MVCCChain) IsCreatingOrAborted() bool
- func (be *MVCCChain) IsEmpty() bool
- func (be *MVCCChain) LoopChain(fn func(txnif.MVCCNode) bool)
- func (be *MVCCChain) MustOneNodeLocked() (txnif.MVCCNode, bool)
- func (be *MVCCChain) NeedWaitCommitting(ts types.TS) (bool, txnif.TxnReader)
- func (be *MVCCChain) PrepareCommit() error
- func (be *MVCCChain) PrepareRollback() (bool, error)
- func (be *MVCCChain) ReadAllFrom(r io.Reader) (n int64, err error)
- func (be *MVCCChain) ReadOneNodeFrom(r io.Reader) (n int64, err error)
- func (be *MVCCChain) SearchNode(o txnif.MVCCNode) (node txnif.MVCCNode)
- func (be *MVCCChain) StringLocked() string
- func (be *MVCCChain) WriteAllTo(w io.Writer) (n int64, err error)
- func (be *MVCCChain) WriteOneNodeTo(w io.Writer) (n int64, err error)
- type MVCCSlice
- func (be *MVCCSlice) Close()
- func (be *MVCCSlice) DeleteNode(node txnif.MVCCNode)
- func (be *MVCCSlice) ForEach(fn func(un txnif.MVCCNode) bool, reverse bool)
- func (be *MVCCSlice) GetCommittedNode() (node txnif.MVCCNode)
- func (be *MVCCSlice) GetLastNonAbortedNode() (node txnif.MVCCNode)
- func (be *MVCCSlice) GetNodeByOffset(offset int) txnif.MVCCNode
- func (be *MVCCSlice) GetNodeToReadByPrepareTS(ts types.TS) (offset int, node txnif.MVCCNode)
- func (be *MVCCSlice) GetTs() types.TS
- func (be *MVCCSlice) GetUpdateNodeLocked() txnif.MVCCNode
- func (be *MVCCSlice) GetVisibleNode(ts types.TS) (node txnif.MVCCNode)
- func (be *MVCCSlice) InsertNode(un txnif.MVCCNode)
- func (be *MVCCSlice) IsCommitted() bool
- func (be *MVCCSlice) IsCommitting() bool
- func (be *MVCCSlice) IsEmpty() bool
- func (be *MVCCSlice) LoopInRange(start, end types.TS, fn func(txnif.MVCCNode) bool) (indexes []*wal.Index)
- func (be *MVCCSlice) LoopOffsetRange(start, end int, fn func(txnif.MVCCNode) bool)
- func (be *MVCCSlice) SearchNode(o txnif.MVCCNode) (node txnif.MVCCNode)
- func (be *MVCCSlice) SearchNodeByCompareFn(fn func(a txnif.MVCCNode) int) (offset int, node txnif.MVCCNode)
- func (be *MVCCSlice) SearchNodeByTS(ts types.TS) (node txnif.MVCCNode)
- func (be *MVCCSlice) StringLocked() string
- type Node
- type NodeState
- type NodeType
- type NoopCommitListener
- type NoopTxnStore
- func (store *NoopTxnStore) AddBlksWithMetaLoc(dbId, tid uint64, pks []containers.Vector, file string, metaLocs []string, ...) error
- func (store *NoopTxnStore) AddTxnEntry(t txnif.TxnEntryType, entry txnif.TxnEntry)
- func (store *NoopTxnStore) Append(dbId, id uint64, data *containers.Batch) error
- func (store *NoopTxnStore) Apply2PCPrepare() error
- func (store *NoopTxnStore) ApplyCommit() error
- func (store *NoopTxnStore) ApplyRollback() error
- func (store *NoopTxnStore) BatchDedup(uint64, uint64, containers.Vector) (err error)
- func (store *NoopTxnStore) BindTxn(txn txnif.AsyncTxn)
- func (store *NoopTxnStore) Close() error
- func (store *NoopTxnStore) CreateBlock(uint64, uint64, uint64, bool) (blk handle.Block, err error)
- func (store *NoopTxnStore) CreateDatabase(name, creatSql string) (db handle.Database, err error)
- func (store *NoopTxnStore) CreateDatabaseWithID(name, createSql string, id uint64) (db handle.Database, err error)
- func (store *NoopTxnStore) CreateNonAppendableBlock(dbId uint64, id *common.ID) (blk handle.Block, err error)
- func (store *NoopTxnStore) CreateNonAppendableBlockWithMeta(_ uint64, _ *common.ID, _ string, _ string) (blk handle.Block, err error)
- func (store *NoopTxnStore) CreateNonAppendableSegment(dbId, tid uint64, _ bool) (seg handle.Segment, err error)
- func (store *NoopTxnStore) CreateRelation(dbId uint64, def any) (rel handle.Relation, err error)
- func (store *NoopTxnStore) CreateRelationWithTableId(dbId uint64, tableId uint64, def any) (rel handle.Relation, err error)
- func (store *NoopTxnStore) CreateSegment(dbId, tid uint64, is1PC bool) (seg handle.Segment, err error)
- func (store *NoopTxnStore) DatabaseNames() (names []string)
- func (store *NoopTxnStore) DropDatabase(name string) (db handle.Database, err error)
- func (store *NoopTxnStore) DropDatabaseByID(id uint64) (db handle.Database, err error)
- func (store *NoopTxnStore) DropRelationByID(dbId uint64, id uint64) (rel handle.Relation, err error)
- func (store *NoopTxnStore) DropRelationByName(dbId uint64, name string) (rel handle.Relation, err error)
- func (store *NoopTxnStore) GetBlock(dbId uint64, id *common.ID) (blk handle.Block, err error)
- func (store *NoopTxnStore) GetByFilter(uint64, uint64, *handle.Filter) (id *common.ID, offset uint32, err error)
- func (store *NoopTxnStore) GetDatabase(name string) (db handle.Database, err error)
- func (store *NoopTxnStore) GetDatabaseByID(id uint64) (db handle.Database, err error)
- func (store *NoopTxnStore) GetDirty() *common.Tree
- func (store *NoopTxnStore) GetDirtyTableByID(id uint64) *common.TableTree
- func (store *NoopTxnStore) GetLSN() uint64
- func (store *NoopTxnStore) GetRelationByID(dbId uint64, id uint64) (rel handle.Relation, err error)
- func (store *NoopTxnStore) GetRelationByName(dbId uint64, name string) (rel handle.Relation, err error)
- func (store *NoopTxnStore) GetSegment(dbId uint64, id *common.ID) (seg handle.Segment, err error)
- func (store *NoopTxnStore) GetValue(uint64, *common.ID, uint32, uint16) (v any, err error)
- func (store *NoopTxnStore) HasAnyTableDataChanges() bool
- func (store *NoopTxnStore) HasCatalogChanges() bool
- func (store *NoopTxnStore) HasTableDataChanges(id uint64) bool
- func (store *NoopTxnStore) IncreateWriteCnt() int
- func (store *NoopTxnStore) IsReadonly() bool
- func (store *NoopTxnStore) LogBlockID(dbId, tid, bid uint64)
- func (store *NoopTxnStore) LogSegmentID(dbId, tid, sid uint64)
- func (store *NoopTxnStore) LogTxnEntry(dbId, tableId uint64, entry txnif.TxnEntry, readed []*common.ID) (err error)
- func (store *NoopTxnStore) LogTxnState(sync bool) (logEntry entry.Entry, err error)
- func (store *NoopTxnStore) PreApplyCommit() error
- func (store *NoopTxnStore) PrePrepare() error
- func (store *NoopTxnStore) PrepareCommit() error
- func (store *NoopTxnStore) PrepareRollback() error
- func (store *NoopTxnStore) RangeDelete(uint64, *common.ID, uint32, uint32, handle.DeleteType) (err error)
- func (store *NoopTxnStore) SoftDeleteBlock(dbId uint64, id *common.ID) (err error)
- func (store *NoopTxnStore) SoftDeleteSegment(dbId uint64, id *common.ID) (err error)
- func (store *NoopTxnStore) UnsafeGetDatabase(id uint64) (db handle.Database, err error)
- func (store *NoopTxnStore) UnsafeGetRelation(dbId, id uint64) (rel handle.Relation, err error)
- func (store *NoopTxnStore) Update(uint64, *common.ID, uint32, uint16, any) (err error)
- func (store *NoopTxnStore) UpdateDeltaLoc(dbId uint64, id *common.ID, un string) (err error)
- func (store *NoopTxnStore) UpdateMetaLoc(dbId uint64, id *common.ID, un string) (err error)
- func (store *NoopTxnStore) WaitPrepared() (err error)
- type OpTxn
- type OpType
- type PointerCmd
- func (e *PointerCmd) ApplyCommit()
- func (e *PointerCmd) ApplyRollback()
- func (e *PointerCmd) Desc() string
- func (e *PointerCmd) GetType() int16
- func (e *PointerCmd) Marshal() (buf []byte, err error)
- func (e *PointerCmd) ReadFrom(r io.Reader) (n int64, err error)
- func (e *PointerCmd) SetReplayTxn(_ txnif.AsyncTxn)
- func (e *PointerCmd) String() string
- func (e *PointerCmd) Unmarshal(buf []byte) error
- func (e *PointerCmd) VerboseString() string
- func (e *PointerCmd) WriteTo(w io.Writer) (n int64, err error)
- type Txn
- func (txn *Txn) ApplyCommit() (err error)
- func (txn *Txn) ApplyRollback() (err error)
- func (txn *Txn) BindAccessInfo(tenantID, userID, roleID uint32)
- func (txn *Txn) Commit() (err error)
- func (txn *Txn) CommitInRecovery() (err error)
- func (txn *Txn) Committing() (err error)
- func (txn *Txn) CommittingInRecovery() (err error)
- func (txn *Txn) CreateDatabase(name, createSql string) (db handle.Database, err error)
- func (txn *Txn) CreateDatabaseWithID(name, createSql string, id uint64) (db handle.Database, err error)
- func (txn *Txn) CurrentDatabase() (db handle.Database)
- func (txn *Txn) DatabaseNames() (names []string)
- func (txn *Txn) DoneWithErr(err error, isAbort bool)
- func (txn *Txn) DropDatabase(name string) (db handle.Database, err error)
- func (txn *Txn) DropDatabaseByID(id uint64) (db handle.Database, err error)
- func (txn *Txn) GetDatabase(name string) (db handle.Database, err error)
- func (txn *Txn) GetDatabaseByID(id uint64) (db handle.Database, err error)
- func (txn *Txn) GetError() error
- func (txn *Txn) GetLSN() uint64
- func (txn *Txn) GetLsn() uint64
- func (txn *Txn) GetStore() txnif.TxnStore
- func (txn *Txn) GetTenantID() uint32
- func (txn *Txn) GetUserAndRoleID() (uint32, uint32)
- func (txn *Txn) IsReplay() bool
- func (txn *Txn) LogTxnEntry(dbId, tableId uint64, entry txnif.TxnEntry, readed []*common.ID) (err error)
- func (txn *Txn) LogTxnState(sync bool) (logEntry entry.Entry, err error)
- func (txn *Txn) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (txn *Txn) MockIncWriteCnt() int
- func (txn *Txn) PreApplyCommit() (err error)
- func (txn *Txn) PrePrepare() error
- func (txn *Txn) Prepare() (pts types.TS, err error)
- func (txn *Txn) PrepareCommit() (err error)
- func (txn *Txn) PrepareRollback() (err error)
- func (txn *Txn) Rollback() (err error)
- func (txn *Txn) SetApplyCommitFn(fn func(txnif.AsyncTxn) error)
- func (txn *Txn) SetApplyRollbackFn(fn func(txnif.AsyncTxn) error)
- func (txn *Txn) SetError(err error)
- func (txn *Txn) SetPrepareCommitFn(fn func(txnif.AsyncTxn) error)
- func (txn *Txn) SetPrepareRollbackFn(fn func(txnif.AsyncTxn) error)
- func (txn *Txn) String() string
- func (txn *Txn) UnsafeGetDatabase(id uint64) (db handle.Database, err error)
- func (txn *Txn) UnsafeGetRelation(dbId, id uint64) (db handle.Relation, err error)
- func (txn *Txn) UseDatabase(name string) (err error)
- func (txn *Txn) WaitDone(err error, isAbort bool) error
- func (txn *Txn) WaitPrepared() error
- type TxnBlock
- func (blk *TxnBlock) Append(*containers.Batch, uint32) (n uint32, err error)
- func (blk *TxnBlock) BatchDedup(containers.Vector) (err error)
- func (blk *TxnBlock) Close() error
- func (blk *TxnBlock) Fingerprint() *common.ID
- func (blk *TxnBlock) GetByFilter(*handle.Filter) (offset uint32, err error)
- func (blk *TxnBlock) GetMeta() any
- func (blk *TxnBlock) GetSegment() (seg handle.Segment)
- func (blk *TxnBlock) GetTotalChanges() int
- func (blk *TxnBlock) ID() uint64
- func (blk *TxnBlock) IsAppendableBlock() bool
- func (blk *TxnBlock) PushDeleteOp(handle.Filter) (err error)
- func (blk *TxnBlock) PushUpdateOp(handle.Filter, string, any) (err error)
- func (blk *TxnBlock) RangeDelete(uint32, uint32, handle.DeleteType) (err error)
- func (blk *TxnBlock) Rows() int
- func (blk *TxnBlock) String() string
- func (blk *TxnBlock) Update(uint32, uint16, any) (err error)
- type TxnCmd
- func (c *TxnCmd) ApplyCommit()
- func (c *TxnCmd) ApplyRollback()
- func (c *TxnCmd) Close()
- func (c *TxnCmd) Desc() string
- func (c *TxnCmd) GetType() int16
- func (c *TxnCmd) Marshal() (buf []byte, err error)
- func (c *TxnCmd) ReadFrom(r io.Reader) (n int64, err error)
- func (c *TxnCmd) SetReplayTxn(txn txnif.AsyncTxn)
- func (c *TxnCmd) SetTxn(txn txnif.AsyncTxn)
- func (c *TxnCmd) String() string
- func (c *TxnCmd) Unmarshal(buf []byte) (err error)
- func (c *TxnCmd) VerboseString() string
- func (c *TxnCmd) WriteTo(w io.Writer) (n int64, err error)
- type TxnCommitListener
- type TxnCtx
- func (ctx *TxnCtx) CommitAfter(startTs types.TS) bool
- func (ctx *TxnCtx) CommitBefore(startTs types.TS) bool
- func (ctx *TxnCtx) GetCommitTS() types.TS
- func (ctx *TxnCtx) GetCtx() []byte
- func (ctx *TxnCtx) GetID() string
- func (ctx *TxnCtx) GetInfo() []byte
- func (ctx *TxnCtx) GetMemo() *txnif.TxnMemo
- func (ctx *TxnCtx) GetParticipants() []uint64
- func (ctx *TxnCtx) GetPrepareTS() types.TS
- func (ctx *TxnCtx) GetStartTS() types.TS
- func (ctx *TxnCtx) GetTxnState(waitIfCommitting bool) (state txnif.TxnState)
- func (ctx *TxnCtx) Is2PC() bool
- func (ctx *TxnCtx) IsActiveLocked() bool
- func (ctx *TxnCtx) IsReplay() bool
- func (ctx *TxnCtx) IsVisible(o txnif.TxnReader) bool
- func (ctx *TxnCtx) Repr() string
- func (ctx *TxnCtx) SameTxn(startTs types.TS) bool
- func (ctx *TxnCtx) SetCommitTS(cts types.TS) (err error)
- func (ctx *TxnCtx) SetParticipants(ids []uint64) (err error)
- func (ctx *TxnCtx) String() string
- func (ctx *TxnCtx) ToCommittedLocked() error
- func (ctx *TxnCtx) ToCommittingFinished() (err error)
- func (ctx *TxnCtx) ToCommittingFinishedLocked() (err error)
- func (ctx *TxnCtx) ToPrepared() (err error)
- func (ctx *TxnCtx) ToPreparedLocked() (err error)
- func (ctx *TxnCtx) ToPreparingLocked(ts types.TS) error
- func (ctx *TxnCtx) ToRollbackedLocked() error
- func (ctx *TxnCtx) ToRollbacking(ts types.TS) error
- func (ctx *TxnCtx) ToRollbackingLocked(ts types.TS) error
- func (ctx *TxnCtx) ToUnknownLocked()
- type TxnDatabase
- func (db *TxnDatabase) Close() error
- func (db *TxnDatabase) CreateRelation(def any) (rel handle.Relation, err error)
- func (db *TxnDatabase) DropRelationByName(name string) (rel handle.Relation, err error)
- func (db *TxnDatabase) GetID() uint64
- func (db *TxnDatabase) GetMeta() any
- func (db *TxnDatabase) GetName() string
- func (db *TxnDatabase) GetRelationByName(name string) (rel handle.Relation, err error)
- func (db *TxnDatabase) MakeRelationIt() (it handle.RelationIt)
- func (db *TxnDatabase) RelationCnt() int64
- func (db *TxnDatabase) Relations() (rels []handle.Relation)
- func (db *TxnDatabase) String() string
- func (db *TxnDatabase) UnsafeGetRelation(id uint64) (rel handle.Relation, err error)
- type TxnFactory
- type TxnMVCCNode
- func (un *TxnMVCCNode) AppendTuple(bat *containers.Batch)
- func (un *TxnMVCCNode) ApplyCommit(index *wal.Index) (ts types.TS, err error)
- func (un *TxnMVCCNode) ApplyRollback(index *wal.Index) (ts types.TS, err error)
- func (un *TxnMVCCNode) CheckConflict(ts types.TS) error
- func (un *TxnMVCCNode) CloneAll() *TxnMVCCNode
- func (un *TxnMVCCNode) Close()
- func (un *TxnMVCCNode) CommittedIn(minTS, maxTS types.TS) (in, before bool)
- func (un *TxnMVCCNode) Compare(o *TxnMVCCNode) int
- func (un *TxnMVCCNode) Compare2(o *TxnMVCCNode) int
- func (un *TxnMVCCNode) GetEnd() types.TS
- func (un *TxnMVCCNode) GetLogIndex() *wal.Index
- func (un *TxnMVCCNode) GetPrepare() types.TS
- func (un *TxnMVCCNode) GetStart() types.TS
- func (un *TxnMVCCNode) GetTxn() txnif.TxnReader
- func (un *TxnMVCCNode) Is1PC() bool
- func (un *TxnMVCCNode) IsAborted() bool
- func (un *TxnMVCCNode) IsActive() bool
- func (un *TxnMVCCNode) IsCommitted() bool
- func (un *TxnMVCCNode) IsCommitting() bool
- func (un *TxnMVCCNode) IsSameTxn(ts types.TS) bool
- func (un *TxnMVCCNode) IsVisible(ts types.TS) (visible bool)
- func (un *TxnMVCCNode) NeedWaitCommitting(ts types.TS) (bool, txnif.TxnReader)
- func (un *TxnMVCCNode) PrepareCommit() (ts types.TS, err error)
- func (un *TxnMVCCNode) PrepareRollback() (err error)
- func (un *TxnMVCCNode) PreparedIn(minTS, maxTS types.TS) (in, before bool)
- func (un *TxnMVCCNode) ReadFrom(r io.Reader) (n int64, err error)
- func (un *TxnMVCCNode) ReadTuple(bat *containers.Batch, offset int)
- func (un *TxnMVCCNode) Set1PC()
- func (un *TxnMVCCNode) SetLogIndex(idx *wal.Index)
- func (un *TxnMVCCNode) String() string
- func (un *TxnMVCCNode) Update(o *TxnMVCCNode)
- func (un *TxnMVCCNode) WriteTo(w io.Writer) (n int64, err error)
- type TxnManager
- func (mgr *TxnManager) DeleteTxn(id string) (err error)
- func (mgr *TxnManager) EnqueueFlushing(op any) (err error)
- func (mgr *TxnManager) GetOrCreateTxnWithMeta(info []byte, id []byte, ts types.TS) (txn txnif.AsyncTxn, err error)
- func (mgr *TxnManager) GetTxn(id string) txnif.AsyncTxn
- func (mgr *TxnManager) GetTxnByCtx(ctx []byte) txnif.AsyncTxn
- func (mgr *TxnManager) Init(prevTs types.TS) error
- func (mgr *TxnManager) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (mgr *TxnManager) MinTSForTest() types.TS
- func (mgr *TxnManager) OnException(new error)
- func (mgr *TxnManager) OnOpTxn(op *OpTxn) (err error)
- func (mgr *TxnManager) OnReplayTxn(txn txnif.AsyncTxn) (err error)
- func (mgr *TxnManager) Start()
- func (mgr *TxnManager) StartTxn(info []byte) (txn txnif.AsyncTxn, err error)
- func (mgr *TxnManager) StatMaxCommitTS() (ts types.TS)
- func (mgr *TxnManager) Stop()
- type TxnRelation
- func (rel *TxnRelation) AddBlksWithMetaLoc([]containers.Vector, string, []string, int32) error
- func (rel *TxnRelation) Append(data *containers.Batch) error
- func (rel *TxnRelation) BatchDedup(col containers.Vector) error
- func (rel *TxnRelation) Close() error
- func (rel *TxnRelation) CreateNonAppendableSegment(bool) (seg handle.Segment, err error)
- func (rel *TxnRelation) CreateSegment(bool) (seg handle.Segment, err error)
- func (rel *TxnRelation) DeleteByFilter(filter *handle.Filter) (err error)
- func (rel *TxnRelation) DeleteByPhyAddrKey(any) (err error)
- func (rel *TxnRelation) DeleteByPhyAddrKeys(containers.Vector) (err error)
- func (rel *TxnRelation) GetByFilter(*handle.Filter) (id *common.ID, offset uint32, err error)
- func (rel *TxnRelation) GetCardinality(attr string) int64
- func (rel *TxnRelation) GetMeta() any
- func (rel *TxnRelation) GetSegment(id uint64) (seg handle.Segment, err error)
- func (rel *TxnRelation) GetValue(*common.ID, uint32, uint16) (v any, err error)
- func (rel *TxnRelation) GetValueByFilter(filter *handle.Filter, col int) (v any, err error)
- func (rel *TxnRelation) GetValueByPhyAddrKey(any, int) (v any, err error)
- func (rel *TxnRelation) ID() uint64
- func (rel *TxnRelation) LogTxnEntry(entry txnif.TxnEntry, readed []*common.ID) (err error)
- func (rel *TxnRelation) MakeBlockIt() handle.BlockIt
- func (rel *TxnRelation) MakeSegmentIt() handle.SegmentIt
- func (rel *TxnRelation) RangeDelete(*common.ID, uint32, uint32, handle.DeleteType) (err error)
- func (rel *TxnRelation) Rows() int64
- func (rel *TxnRelation) Schema() any
- func (rel *TxnRelation) SimplePPString(_ common.PPLevel) string
- func (rel *TxnRelation) Size(attr string) int64
- func (rel *TxnRelation) SoftDeleteSegment(id uint64) (err error)
- func (rel *TxnRelation) String() string
- func (rel *TxnRelation) Update(*common.ID, uint32, uint16, any) (err error)
- func (rel *TxnRelation) UpdateByFilter(filter *handle.Filter, col uint16, v any) (err error)
- func (rel *TxnRelation) UpdateConstraint(cstr []byte) (err error)
- type TxnSegment
- func (seg *TxnSegment) BatchDedup(containers.Vector) (err error)
- func (seg *TxnSegment) Close() error
- func (seg *TxnSegment) CreateBlock() (blk handle.Block, err error)
- func (seg *TxnSegment) CreateNonAppendableBlock() (blk handle.Block, err error)
- func (seg *TxnSegment) GetBlock(id uint64) (blk handle.Block, err error)
- func (seg *TxnSegment) GetID() uint64
- func (seg *TxnSegment) GetMeta() any
- func (seg *TxnSegment) GetRelation() (rel handle.Relation)
- func (seg *TxnSegment) MakeBlockIt() (it handle.BlockIt)
- func (seg *TxnSegment) PushDeleteOp(handle.Filter) (err error)
- func (seg *TxnSegment) PushUpdateOp(handle.Filter, string, any) (err error)
- func (seg *TxnSegment) RangeDelete(uint64, uint32, uint32, handle.DeleteType) (err error)
- func (seg *TxnSegment) SoftDeleteBlock(id uint64) (err error)
- func (seg *TxnSegment) String() string
- func (seg *TxnSegment) Update(uint64, uint32, uint16, any) (err error)
- type TxnState
- type TxnStateCmd
- func (c *TxnStateCmd) ApplyCommit()
- func (c *TxnStateCmd) ApplyRollback()
- func (c *TxnStateCmd) Close()
- func (c *TxnStateCmd) Desc() string
- func (c *TxnStateCmd) GetType() int16
- func (c *TxnStateCmd) Marshal() (buf []byte, err error)
- func (c *TxnStateCmd) ReadFrom(r io.Reader) (n int64, err error)
- func (c *TxnStateCmd) SetReplayTxn(_ txnif.AsyncTxn)
- func (c *TxnStateCmd) String() string
- func (c *TxnStateCmd) Unmarshal(buf []byte) (err error)
- func (c *TxnStateCmd) VerboseString() string
- func (c *TxnStateCmd) WriteTo(w io.Writer) (n int64, err error)
- type TxnStoreFactory
Constants ¶
const ( CmdPointer int16 = iota CmdDeleteBitmap CmdBatch CmdAppend CmdDelete CmdComposed CmdTxn CmdTxnState CmdCustomized )
const ( TSUncommitted int32 = iota TSCommitting TSCommitted TSRollbacking TSRollbacked )
const ( OpCommit = iota OpRollback OpPrepare OpCommitting OpInvalid )
const ( EventRollback = iota + 1 EventCommitting EventCommit )
const (
IDSize = 8 + 8 + 8 + 4 + 2 + 1
)
const (
MaxNodeRows uint32 = 10000
)
Variables ¶
var ( SnapshotAttr_StartTS = "start_ts" SnapshotAttr_PrepareTS = "prepare_ts" SnapshotAttr_CommitTS = "commit_ts" SnapshotAttr_LogIndex_LSN = "log_index_lsn" SnapshotAttr_LogIndex_CSN = "log_index_csn" SnapshotAttr_LogIndex_Size = "log_index_size" )
var DefaultTxnFactory = func( mgr *TxnManager, store txnif.TxnStore, id []byte, startTS types.TS, info []byte) txnif.AsyncTxn { return NewTxn(mgr, store, id, startTS, info) }
var (
ErrTransferTransactionState = moerr.NewInternalErrorNoCtx("tae: transfer transaction state error")
)
var NoopStoreFactory = func() txnif.TxnStore { return new(NoopTxnStore) }
Functions ¶
func CompareTxnMVCCNode ¶ added in v0.6.0
func CompareTxnMVCCNode(e, o *TxnMVCCNode) int
func IsCustomizedCmd ¶
func TxnMgrField ¶
func TxnMgrField(mgr *TxnManager) zap.Field
func UnmarshalID ¶
Types ¶
type BaseCustomizedCmd ¶
func NewBaseCustomizedCmd ¶
func NewBaseCustomizedCmd(id uint32, impl txnif.TxnCmd) *BaseCustomizedCmd
func (*BaseCustomizedCmd) GetID ¶
func (c *BaseCustomizedCmd) GetID() uint32
type BatchCmd ¶
type BatchCmd struct { BaseCmd Bat *containers.Batch }
func NewBatchCmd ¶
func NewBatchCmd(bat *containers.Batch) *BatchCmd
func (*BatchCmd) ApplyCommit ¶ added in v0.6.0
func (e *BatchCmd) ApplyCommit()
func (*BatchCmd) ApplyRollback ¶ added in v0.6.0
func (e *BatchCmd) ApplyRollback()
func (*BatchCmd) SetReplayTxn ¶ added in v0.6.0
func (*BatchCmd) VerboseString ¶
type ComposedCmd ¶
func NewComposedCmd ¶
func NewComposedCmd() *ComposedCmd
func (*ComposedCmd) AddCmd ¶
func (cc *ComposedCmd) AddCmd(cmd txnif.TxnCmd)
func (*ComposedCmd) ApplyCommit ¶ added in v0.6.0
func (cc *ComposedCmd) ApplyCommit()
func (*ComposedCmd) ApplyRollback ¶ added in v0.6.0
func (cc *ComposedCmd) ApplyRollback()
func (*ComposedCmd) Close ¶
func (cc *ComposedCmd) Close()
func (*ComposedCmd) Desc ¶
func (cc *ComposedCmd) Desc() string
func (*ComposedCmd) GetType ¶
func (cc *ComposedCmd) GetType() int16
func (*ComposedCmd) Marshal ¶
func (cc *ComposedCmd) Marshal() (buf []byte, err error)
func (*ComposedCmd) SetCmdSize ¶
func (cc *ComposedCmd) SetCmdSize(size uint32)
func (*ComposedCmd) SetReplayTxn ¶ added in v0.6.0
func (cc *ComposedCmd) SetReplayTxn(txn txnif.AsyncTxn)
func (*ComposedCmd) String ¶
func (cc *ComposedCmd) String() string
func (*ComposedCmd) ToDesc ¶
func (cc *ComposedCmd) ToDesc(prefix string) string
func (*ComposedCmd) ToString ¶
func (cc *ComposedCmd) ToString(prefix string) string
func (*ComposedCmd) ToVerboseString ¶
func (cc *ComposedCmd) ToVerboseString(prefix string) string
func (*ComposedCmd) Unmarshal ¶
func (cc *ComposedCmd) Unmarshal(buf []byte) (err error)
func (*ComposedCmd) VerboseString ¶
func (cc *ComposedCmd) VerboseString() string
type CustomizedCmd ¶
type CustomizedCmd interface {
GetID() uint32
}
type DeleteBitmapCmd ¶
func NewDeleteBitmapCmd ¶
func NewDeleteBitmapCmd(bitmap *roaring.Bitmap) *DeleteBitmapCmd
func (*DeleteBitmapCmd) ApplyCommit ¶ added in v0.6.0
func (e *DeleteBitmapCmd) ApplyCommit()
func (*DeleteBitmapCmd) ApplyRollback ¶ added in v0.6.0
func (e *DeleteBitmapCmd) ApplyRollback()
func (*DeleteBitmapCmd) Desc ¶
func (e *DeleteBitmapCmd) Desc() string
func (*DeleteBitmapCmd) GetType ¶
func (e *DeleteBitmapCmd) GetType() int16
func (*DeleteBitmapCmd) Marshal ¶
func (e *DeleteBitmapCmd) Marshal() (buf []byte, err error)
func (*DeleteBitmapCmd) ReadFrom ¶
func (e *DeleteBitmapCmd) ReadFrom(r io.Reader) (n int64, err error)
func (*DeleteBitmapCmd) SetReplayTxn ¶ added in v0.6.0
func (e *DeleteBitmapCmd) SetReplayTxn(_ txnif.AsyncTxn)
func (*DeleteBitmapCmd) String ¶
func (e *DeleteBitmapCmd) String() string
func (*DeleteBitmapCmd) Unmarshal ¶
func (e *DeleteBitmapCmd) Unmarshal(buf []byte) error
func (*DeleteBitmapCmd) VerboseString ¶
func (e *DeleteBitmapCmd) VerboseString() string
type MVCCChain ¶ added in v0.6.0
type MVCCChain struct { *sync.RWMutex MVCC *common.GenericSortedDList[txnif.MVCCNode] // contains filtered or unexported fields }
func NewMVCCChain ¶ added in v0.6.0
func (*MVCCChain) Apply1PCCommit ¶ added in v0.6.0
func (*MVCCChain) ApplyCommit ¶ added in v0.6.0
func (*MVCCChain) ApplyRollback ¶ added in v0.6.0
func (*MVCCChain) CheckConflict ¶ added in v0.6.0
func (*MVCCChain) CloneCommittedInRange ¶ added in v0.6.0
func (*MVCCChain) CloneLatestNode ¶ added in v0.6.0
func (*MVCCChain) ClonePreparedInRange ¶ added in v0.6.0
func (*MVCCChain) GetIndexes ¶ added in v0.6.0
func (*MVCCChain) GetLatestCommittedNode ¶ added in v0.6.0
GetLatestCommittedNode gets the latest committed mvcc node. It's useful when check whether the catalog/metadata entry is deleted.
func (*MVCCChain) GetLatestNodeLocked ¶ added in v0.6.0
GetLatestNodeLocked gets the latest mvcc node. It is useful in making command, apply state(e.g. ApplyCommit), check confilct.
func (*MVCCChain) GetLogIndex ¶ added in v0.6.0
func (*MVCCChain) GetPrepareTs ¶ added in v0.6.0
for replay
func (*MVCCChain) GetVisibleNode ¶ added in v0.6.0
GetVisibleNode gets mvcc node according to the timestamp. It returns the mvcc node in the same txn as the read txn or returns the latest mvcc node with commitTS less than the timestamp.
func (*MVCCChain) HasCommittedNode ¶ added in v0.6.0
func (*MVCCChain) HasCommittedNodeInRange ¶ added in v0.6.0
[start, end] Check whether there is any committed node in between [start, end] -----+------+-------+--------+----------+--------->
| | | | | Time | start | end | commitTs <----- commitTs <--------- commitTs|uncommitted <= MVCCChain Header (1) (2) (3)
func (*MVCCChain) HasUncommittedNode ¶ added in v0.6.0
func (*MVCCChain) IsCommitted ¶ added in v0.6.0
func (*MVCCChain) IsCommitting ¶ added in v0.6.0
In /Catalog, there're three states: Active, Committing and Committed. A txn is Active before its CommitTs is allocated. It's Committed when its state will never change, i.e. TxnStateCommitted and TxnStateRollbacked. It's Committing when it's in any other state, including TxnStateCommitting, TxnStateRollbacking, TxnStatePrepared and so on. When read or write an entry, if the last txn of the entry is Committing, we wait for it. When write on an Entry, if there's an Active txn, we report w-w conflict.
func (*MVCCChain) IsCreatingOrAborted ¶ added in v0.6.0
func (*MVCCChain) MustOneNodeLocked ¶ added in v0.6.0
func (*MVCCChain) NeedWaitCommitting ¶ added in v0.6.0
func (*MVCCChain) PrepareCommit ¶ added in v0.6.0
func (*MVCCChain) PrepareRollback ¶ added in v0.6.0
func (*MVCCChain) ReadAllFrom ¶ added in v0.6.0
func (*MVCCChain) ReadOneNodeFrom ¶ added in v0.6.0
func (*MVCCChain) SearchNode ¶ added in v0.6.0
It's only used in replay
func (*MVCCChain) StringLocked ¶ added in v0.6.0
func (*MVCCChain) WriteAllTo ¶ added in v0.6.0
type MVCCSlice ¶ added in v0.6.0
func NewMVCCSlice ¶ added in v0.6.0
func (*MVCCSlice) DeleteNode ¶ added in v0.6.0
func (*MVCCSlice) GetCommittedNode ¶ added in v0.6.0
GetCommittedNode gets the latest committed UpdateNode. It's useful when check whether the catalog/metadata entry is deleted.
func (*MVCCSlice) GetLastNonAbortedNode ¶ added in v0.6.0
func (*MVCCSlice) GetNodeByOffset ¶ added in v0.6.0
func (*MVCCSlice) GetNodeToReadByPrepareTS ¶ added in v0.6.0
GetNodeToRead gets UpdateNode according to the timestamp. It returns the UpdateNode in the same txn as the read txn or returns the latest UpdateNode with commitTS less than the timestamp. todo getend or getcommitts
func (*MVCCSlice) GetUpdateNodeLocked ¶ added in v0.6.0
GetUpdateNode gets the latest UpdateNode. It is useful in making command, apply state(e.g. ApplyCommit), check confilct.
func (*MVCCSlice) GetVisibleNode ¶ added in v0.6.0
func (*MVCCSlice) InsertNode ¶ added in v0.6.0
func (*MVCCSlice) IsCommitted ¶ added in v0.6.0
func (*MVCCSlice) IsCommitting ¶ added in v0.6.0
func (*MVCCSlice) LoopInRange ¶ added in v0.6.0
func (*MVCCSlice) LoopOffsetRange ¶ added in v0.6.0
func (*MVCCSlice) SearchNode ¶ added in v0.6.0
func (*MVCCSlice) SearchNodeByCompareFn ¶ added in v0.6.0
func (*MVCCSlice) SearchNodeByTS ¶ added in v0.6.0
func (*MVCCSlice) StringLocked ¶ added in v0.6.0
type NoopCommitListener ¶ added in v0.6.0
type NoopCommitListener struct{}
func (*NoopCommitListener) OnBeginPrePrepare ¶ added in v0.6.0
func (bl *NoopCommitListener) OnBeginPrePrepare(txn txnif.AsyncTxn)
func (*NoopCommitListener) OnEndPrePrepare ¶ added in v0.6.0
func (bl *NoopCommitListener) OnEndPrePrepare(txn txnif.AsyncTxn)
type NoopTxnStore ¶
type NoopTxnStore struct{}
func (*NoopTxnStore) AddBlksWithMetaLoc ¶ added in v0.7.0
func (store *NoopTxnStore) AddBlksWithMetaLoc( dbId, tid uint64, pks []containers.Vector, file string, metaLocs []string, flag int32) error
func (*NoopTxnStore) AddTxnEntry ¶
func (store *NoopTxnStore) AddTxnEntry(t txnif.TxnEntryType, entry txnif.TxnEntry)
func (*NoopTxnStore) Append ¶
func (store *NoopTxnStore) Append(dbId, id uint64, data *containers.Batch) error
func (*NoopTxnStore) Apply2PCPrepare ¶ added in v0.6.0
func (store *NoopTxnStore) Apply2PCPrepare() error
func (*NoopTxnStore) ApplyCommit ¶
func (store *NoopTxnStore) ApplyCommit() error
func (*NoopTxnStore) ApplyRollback ¶
func (store *NoopTxnStore) ApplyRollback() error
func (*NoopTxnStore) BatchDedup ¶
func (store *NoopTxnStore) BatchDedup(uint64, uint64, containers.Vector) (err error)
func (*NoopTxnStore) BindTxn ¶
func (store *NoopTxnStore) BindTxn(txn txnif.AsyncTxn)
func (*NoopTxnStore) Close ¶
func (store *NoopTxnStore) Close() error
func (*NoopTxnStore) CreateBlock ¶
func (*NoopTxnStore) CreateDatabase ¶
func (store *NoopTxnStore) CreateDatabase(name, creatSql string) (db handle.Database, err error)
func (*NoopTxnStore) CreateDatabaseWithID ¶ added in v0.6.0
func (*NoopTxnStore) CreateNonAppendableBlock ¶
func (*NoopTxnStore) CreateNonAppendableBlockWithMeta ¶ added in v0.7.0
func (*NoopTxnStore) CreateNonAppendableSegment ¶
func (*NoopTxnStore) CreateRelation ¶
func (*NoopTxnStore) CreateRelationWithTableId ¶ added in v0.6.0
func (*NoopTxnStore) CreateSegment ¶
func (*NoopTxnStore) DatabaseNames ¶
func (store *NoopTxnStore) DatabaseNames() (names []string)
func (*NoopTxnStore) DropDatabase ¶
func (store *NoopTxnStore) DropDatabase(name string) (db handle.Database, err error)
func (*NoopTxnStore) DropDatabaseByID ¶ added in v0.6.0
func (store *NoopTxnStore) DropDatabaseByID(id uint64) (db handle.Database, err error)
func (*NoopTxnStore) DropRelationByID ¶ added in v0.6.0
func (*NoopTxnStore) DropRelationByName ¶
func (*NoopTxnStore) GetByFilter ¶
func (*NoopTxnStore) GetDatabase ¶
func (store *NoopTxnStore) GetDatabase(name string) (db handle.Database, err error)
func (*NoopTxnStore) GetDatabaseByID ¶ added in v0.6.0
func (store *NoopTxnStore) GetDatabaseByID(id uint64) (db handle.Database, err error)
func (*NoopTxnStore) GetDirty ¶ added in v0.6.0
func (store *NoopTxnStore) GetDirty() *common.Tree
func (*NoopTxnStore) GetDirtyTableByID ¶ added in v0.6.0
func (store *NoopTxnStore) GetDirtyTableByID(id uint64) *common.TableTree
func (*NoopTxnStore) GetLSN ¶
func (store *NoopTxnStore) GetLSN() uint64
func (*NoopTxnStore) GetRelationByID ¶ added in v0.6.0
func (*NoopTxnStore) GetRelationByName ¶
func (*NoopTxnStore) GetSegment ¶
func (*NoopTxnStore) HasAnyTableDataChanges ¶ added in v0.6.0
func (store *NoopTxnStore) HasAnyTableDataChanges() bool
func (*NoopTxnStore) HasCatalogChanges ¶ added in v0.6.0
func (store *NoopTxnStore) HasCatalogChanges() bool
func (*NoopTxnStore) HasTableDataChanges ¶ added in v0.6.0
func (store *NoopTxnStore) HasTableDataChanges(id uint64) bool
func (*NoopTxnStore) IncreateWriteCnt ¶
func (store *NoopTxnStore) IncreateWriteCnt() int
func (*NoopTxnStore) IsReadonly ¶
func (store *NoopTxnStore) IsReadonly() bool
func (*NoopTxnStore) LogBlockID ¶
func (store *NoopTxnStore) LogBlockID(dbId, tid, bid uint64)
func (*NoopTxnStore) LogSegmentID ¶
func (store *NoopTxnStore) LogSegmentID(dbId, tid, sid uint64)
func (*NoopTxnStore) LogTxnEntry ¶
func (*NoopTxnStore) LogTxnState ¶ added in v0.6.0
func (store *NoopTxnStore) LogTxnState(sync bool) (logEntry entry.Entry, err error)
func (*NoopTxnStore) PreApplyCommit ¶
func (store *NoopTxnStore) PreApplyCommit() error
func (*NoopTxnStore) PrePrepare ¶ added in v0.6.0
func (store *NoopTxnStore) PrePrepare() error
func (*NoopTxnStore) PrepareCommit ¶
func (store *NoopTxnStore) PrepareCommit() error
func (*NoopTxnStore) PrepareRollback ¶
func (store *NoopTxnStore) PrepareRollback() error
func (*NoopTxnStore) RangeDelete ¶
func (store *NoopTxnStore) RangeDelete(uint64, *common.ID, uint32, uint32, handle.DeleteType) (err error)
func (*NoopTxnStore) SoftDeleteBlock ¶
func (store *NoopTxnStore) SoftDeleteBlock(dbId uint64, id *common.ID) (err error)
func (*NoopTxnStore) SoftDeleteSegment ¶
func (store *NoopTxnStore) SoftDeleteSegment(dbId uint64, id *common.ID) (err error)
func (*NoopTxnStore) UnsafeGetDatabase ¶ added in v0.6.0
func (store *NoopTxnStore) UnsafeGetDatabase(id uint64) (db handle.Database, err error)
func (*NoopTxnStore) UnsafeGetRelation ¶ added in v0.6.0
func (store *NoopTxnStore) UnsafeGetRelation(dbId, id uint64) (rel handle.Relation, err error)
func (*NoopTxnStore) UpdateDeltaLoc ¶ added in v0.6.0
func (*NoopTxnStore) UpdateMetaLoc ¶ added in v0.6.0
func (*NoopTxnStore) WaitPrepared ¶ added in v0.6.0
func (store *NoopTxnStore) WaitPrepared() (err error)
type OpTxn ¶
func (*OpTxn) IsTryCommitting ¶ added in v0.6.0
type PointerCmd ¶
func (*PointerCmd) ApplyCommit ¶ added in v0.6.0
func (e *PointerCmd) ApplyCommit()
func (*PointerCmd) ApplyRollback ¶ added in v0.6.0
func (e *PointerCmd) ApplyRollback()
func (*PointerCmd) Desc ¶
func (e *PointerCmd) Desc() string
func (*PointerCmd) GetType ¶
func (e *PointerCmd) GetType() int16
func (*PointerCmd) Marshal ¶
func (e *PointerCmd) Marshal() (buf []byte, err error)
func (*PointerCmd) SetReplayTxn ¶ added in v0.6.0
func (e *PointerCmd) SetReplayTxn(_ txnif.AsyncTxn)
func (*PointerCmd) String ¶
func (e *PointerCmd) String() string
func (*PointerCmd) Unmarshal ¶
func (e *PointerCmd) Unmarshal(buf []byte) error
func (*PointerCmd) VerboseString ¶
func (e *PointerCmd) VerboseString() string
type Txn ¶
type Txn struct { *TxnCtx Mgr *TxnManager Store txnif.TxnStore Err error LSN uint64 TenantID, UserID, RoleID atomic.Uint32 PrepareCommitFn func(txnif.AsyncTxn) error PrepareRollbackFn func(txnif.AsyncTxn) error ApplyCommitFn func(txnif.AsyncTxn) error ApplyRollbackFn func(txnif.AsyncTxn) error // contains filtered or unexported fields }
func NewPersistedTxn ¶ added in v0.6.0
func (*Txn) ApplyCommit ¶
func (*Txn) ApplyRollback ¶
func (*Txn) BindAccessInfo ¶ added in v0.6.0
func (*Txn) Commit ¶
Commit is used to commit a 1PC or 2PC transaction running on Coordinator or running on Participant. Notice that the Commit of a 2PC transaction must be success once the Commit message arrives, since Preparing had already succeeded.
func (*Txn) CommitInRecovery ¶ added in v0.6.0
CommitInRecovery is called during recovery
func (*Txn) Committing ¶ added in v0.6.0
Committing is used to record a "committing" status for coordinator. Notice that txn must commit successfully once committing message arrives, since Preparing had already succeeded.
func (*Txn) CommittingInRecovery ¶ added in v0.6.0
func (*Txn) CreateDatabase ¶
func (*Txn) CreateDatabaseWithID ¶ added in v0.6.0
func (*Txn) CurrentDatabase ¶
func (*Txn) DatabaseNames ¶
func (*Txn) DoneWithErr ¶
func (*Txn) DropDatabase ¶
func (*Txn) DropDatabaseByID ¶ added in v0.6.0
func (*Txn) GetDatabaseByID ¶ added in v0.6.0
func (*Txn) GetTenantID ¶ added in v0.6.0
func (*Txn) GetUserAndRoleID ¶ added in v0.6.0
func (*Txn) LogTxnEntry ¶
func (*Txn) LogTxnState ¶ added in v0.6.0
func (*Txn) MarshalLogObject ¶
func (txn *Txn) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
func (*Txn) MockIncWriteCnt ¶
func (*Txn) PreApplyCommit ¶
func (*Txn) PrePrepare ¶ added in v0.6.0
func (*Txn) Prepare ¶ added in v0.6.0
Prepare is used to pre-commit a 2PC distributed transaction. Notice that once any error happened, we should rollback the txn. TODO:
- How to handle the case in which log service timed out?
- For a 2pc transaction, Rollback message may arrive before Prepare message, should handle this case by TxnStorage?
func (*Txn) PrepareCommit ¶
func (*Txn) PrepareRollback ¶
func (*Txn) Rollback ¶
Rollback is used to roll back a 1PC or 2PC transaction. Notice that there may be a such scenario in which a 2PC distributed transaction in ACTIVE will be rollbacked, since Rollback message may arrive before the Prepare message.
func (*Txn) SetPrepareRollbackFn ¶
func (*Txn) UnsafeGetDatabase ¶ added in v0.6.0
func (*Txn) UnsafeGetRelation ¶ added in v0.6.0
func (*Txn) UseDatabase ¶
func (*Txn) WaitPrepared ¶ added in v0.6.0
type TxnBlock ¶
func (*TxnBlock) BatchDedup ¶
func (blk *TxnBlock) BatchDedup(containers.Vector) (err error)
func (*TxnBlock) Fingerprint ¶
func (*TxnBlock) GetByFilter ¶
func (*TxnBlock) GetSegment ¶
func (*TxnBlock) GetTotalChanges ¶
func (*TxnBlock) IsAppendableBlock ¶
func (*TxnBlock) PushUpdateOp ¶
func (*TxnBlock) RangeDelete ¶
type TxnCmd ¶ added in v0.6.0
type TxnCmd struct { *ComposedCmd *TxnCtx Txn txnif.AsyncTxn }
func NewEmptyTxnCmd ¶ added in v0.6.0
func NewEmptyTxnCmd() *TxnCmd
func (*TxnCmd) ApplyCommit ¶ added in v0.6.0
func (c *TxnCmd) ApplyCommit()
func (*TxnCmd) ApplyRollback ¶ added in v0.6.0
func (c *TxnCmd) ApplyRollback()
func (*TxnCmd) SetReplayTxn ¶ added in v0.6.0
func (*TxnCmd) VerboseString ¶ added in v0.6.0
type TxnCommitListener ¶ added in v0.6.0
type TxnCtx ¶
type TxnCtx struct { sync.RWMutex sync.WaitGroup DoneCond sync.Cond ID string IDCtx []byte StartTS, CommitTS, PrepareTS types.TS Info []byte State txnif.TxnState Participants []uint64 // Memo is not thread-safe // It will be readonly when txn state is not txnif.TxnStateActive Memo *txnif.TxnMemo }
func NewEmptyTxnCtx ¶ added in v0.6.0
func NewEmptyTxnCtx() *TxnCtx
func (*TxnCtx) CommitBefore ¶ added in v0.5.1
func (*TxnCtx) GetCommitTS ¶
func (*TxnCtx) GetParticipants ¶ added in v0.6.0
func (*TxnCtx) GetPrepareTS ¶ added in v0.6.0
func (*TxnCtx) GetStartTS ¶
func (*TxnCtx) GetTxnState ¶ added in v0.6.0
False when atomically get the current txn state
True when the txn state is committing, wait it to be committed or rollbacked. It is used during snapshot reads. If TxnStateActive is currently returned, this value will definitely not be used, because even if it becomes TxnStatePreparing later, the timestamp would be larger than the current read timestamp.
func (*TxnCtx) IsActiveLocked ¶
func (*TxnCtx) SetCommitTS ¶ added in v0.6.0
func (*TxnCtx) SetParticipants ¶ added in v0.6.0
func (*TxnCtx) ToCommittedLocked ¶
func (*TxnCtx) ToCommittingFinished ¶ added in v0.6.0
func (*TxnCtx) ToCommittingFinishedLocked ¶ added in v0.6.0
func (*TxnCtx) ToPrepared ¶ added in v0.6.0
func (*TxnCtx) ToPreparedLocked ¶ added in v0.6.0
func (*TxnCtx) ToPreparingLocked ¶ added in v0.6.0
func (*TxnCtx) ToRollbackedLocked ¶
func (*TxnCtx) ToUnknownLocked ¶
func (ctx *TxnCtx) ToUnknownLocked()
type TxnDatabase ¶
func (*TxnDatabase) Close ¶
func (db *TxnDatabase) Close() error
func (*TxnDatabase) CreateRelation ¶
func (db *TxnDatabase) CreateRelation(def any) (rel handle.Relation, err error)
func (*TxnDatabase) DropRelationByName ¶
func (db *TxnDatabase) DropRelationByName(name string) (rel handle.Relation, err error)
func (*TxnDatabase) GetID ¶
func (db *TxnDatabase) GetID() uint64
func (*TxnDatabase) GetMeta ¶
func (db *TxnDatabase) GetMeta() any
func (*TxnDatabase) GetName ¶
func (db *TxnDatabase) GetName() string
func (*TxnDatabase) GetRelationByName ¶
func (db *TxnDatabase) GetRelationByName(name string) (rel handle.Relation, err error)
func (*TxnDatabase) MakeRelationIt ¶
func (db *TxnDatabase) MakeRelationIt() (it handle.RelationIt)
func (*TxnDatabase) RelationCnt ¶
func (db *TxnDatabase) RelationCnt() int64
func (*TxnDatabase) Relations ¶
func (db *TxnDatabase) Relations() (rels []handle.Relation)
func (*TxnDatabase) String ¶
func (db *TxnDatabase) String() string
func (*TxnDatabase) UnsafeGetRelation ¶ added in v0.6.0
func (db *TxnDatabase) UnsafeGetRelation(id uint64) (rel handle.Relation, err error)
type TxnFactory ¶
type TxnMVCCNode ¶ added in v0.6.0
type TxnMVCCNode struct {
Start, Prepare, End types.TS
Txn txnif.TxnReader
Aborted bool
LogIndex *wal.Index
// contains filtered or unexported fields
}
func NewTxnMVCCNodeWithTS ¶ added in v0.6.0
func NewTxnMVCCNodeWithTS(ts types.TS) *TxnMVCCNode
func NewTxnMVCCNodeWithTxn ¶ added in v0.6.0
func NewTxnMVCCNodeWithTxn(txn txnif.TxnReader) *TxnMVCCNode
func ReadTuple ¶ added in v0.6.0
func ReadTuple(bat *containers.Batch, row int) (un *TxnMVCCNode)
func (*TxnMVCCNode) AppendTuple ¶ added in v0.6.0
func (un *TxnMVCCNode) AppendTuple(bat *containers.Batch)
func (*TxnMVCCNode) ApplyCommit ¶ added in v0.6.0
func (*TxnMVCCNode) ApplyRollback ¶ added in v0.6.0
func (*TxnMVCCNode) CheckConflict ¶ added in v0.6.0
func (un *TxnMVCCNode) CheckConflict(ts types.TS) error
Check w-w confilct
func (*TxnMVCCNode) CloneAll ¶ added in v0.6.0
func (un *TxnMVCCNode) CloneAll() *TxnMVCCNode
func (*TxnMVCCNode) Close ¶ added in v0.7.0
func (un *TxnMVCCNode) Close()
func (*TxnMVCCNode) CommittedIn ¶ added in v0.6.0
func (un *TxnMVCCNode) CommittedIn(minTS, maxTS types.TS) (in, before bool)
in indicates whether this node is committed in between [minTs, maxTs] before indicates whether this node is committed before minTs NeedWaitCommitting should be called before to make sure all prepared active txns in between [minTs, maxTs] be committed or rollbacked
func (*TxnMVCCNode) Compare ¶ added in v0.6.0
func (un *TxnMVCCNode) Compare(o *TxnMVCCNode) int
func (*TxnMVCCNode) Compare2 ¶ added in v0.6.0
func (un *TxnMVCCNode) Compare2(o *TxnMVCCNode) int
func (*TxnMVCCNode) GetEnd ¶ added in v0.6.0
func (un *TxnMVCCNode) GetEnd() types.TS
func (*TxnMVCCNode) GetLogIndex ¶ added in v0.6.0
func (un *TxnMVCCNode) GetLogIndex() *wal.Index
func (*TxnMVCCNode) GetPrepare ¶ added in v0.6.0
func (un *TxnMVCCNode) GetPrepare() types.TS
func (*TxnMVCCNode) GetStart ¶ added in v0.6.0
func (un *TxnMVCCNode) GetStart() types.TS
func (*TxnMVCCNode) GetTxn ¶ added in v0.6.0
func (un *TxnMVCCNode) GetTxn() txnif.TxnReader
func (*TxnMVCCNode) Is1PC ¶ added in v0.6.0
func (un *TxnMVCCNode) Is1PC() bool
func (*TxnMVCCNode) IsAborted ¶ added in v0.6.0
func (un *TxnMVCCNode) IsAborted() bool
func (*TxnMVCCNode) IsActive ¶ added in v0.6.0
func (un *TxnMVCCNode) IsActive() bool
func (*TxnMVCCNode) IsCommitted ¶ added in v0.6.0
func (un *TxnMVCCNode) IsCommitted() bool
func (*TxnMVCCNode) IsCommitting ¶ added in v0.6.0
func (un *TxnMVCCNode) IsCommitting() bool
func (*TxnMVCCNode) IsVisible ¶ added in v0.6.0
func (un *TxnMVCCNode) IsVisible(ts types.TS) (visible bool)
Check whether is mvcc node is visible to ts Make sure all the relevant prepared txns should be committed|rollbacked
func (*TxnMVCCNode) NeedWaitCommitting ¶ added in v0.6.0
Check whether need to wait this mvcc node
func (*TxnMVCCNode) PrepareCommit ¶ added in v0.6.0
func (un *TxnMVCCNode) PrepareCommit() (ts types.TS, err error)
func (*TxnMVCCNode) PrepareRollback ¶ added in v0.6.0
func (un *TxnMVCCNode) PrepareRollback() (err error)
func (*TxnMVCCNode) PreparedIn ¶ added in v0.6.0
func (un *TxnMVCCNode) PreparedIn(minTS, maxTS types.TS) (in, before bool)
func (*TxnMVCCNode) ReadFrom ¶ added in v0.6.0
func (un *TxnMVCCNode) ReadFrom(r io.Reader) (n int64, err error)
func (*TxnMVCCNode) ReadTuple ¶ added in v0.6.0
func (un *TxnMVCCNode) ReadTuple(bat *containers.Batch, offset int)
func (*TxnMVCCNode) Set1PC ¶ added in v0.6.0
func (un *TxnMVCCNode) Set1PC()
func (*TxnMVCCNode) SetLogIndex ¶ added in v0.6.0
func (un *TxnMVCCNode) SetLogIndex(idx *wal.Index)
func (*TxnMVCCNode) String ¶ added in v0.6.0
func (un *TxnMVCCNode) String() string
func (*TxnMVCCNode) Update ¶ added in v0.6.0
func (un *TxnMVCCNode) Update(o *TxnMVCCNode)
type TxnManager ¶
type TxnManager struct { sync.RWMutex common.ClosedState PreparingSM sm.StateMachine IDMap map[string]txnif.AsyncTxn IdAlloc *common.TxnIDAllocator TsAlloc *types.TsAlloctor TxnStoreFactory TxnStoreFactory TxnFactory TxnFactory Exception *atomic.Value CommitListener *batchTxnCommitListener }
func NewTxnManager ¶
func NewTxnManager(txnStoreFactory TxnStoreFactory, txnFactory TxnFactory, clock clock.Clock) *TxnManager
func (*TxnManager) DeleteTxn ¶
func (mgr *TxnManager) DeleteTxn(id string) (err error)
func (*TxnManager) EnqueueFlushing ¶ added in v0.6.0
func (mgr *TxnManager) EnqueueFlushing(op any) (err error)
func (*TxnManager) GetOrCreateTxnWithMeta ¶ added in v0.6.0
func (mgr *TxnManager) GetOrCreateTxnWithMeta( info []byte, id []byte, ts types.TS) (txn txnif.AsyncTxn, err error)
GetOrCreateTxnWithMeta Get or create a txn initiated by CN
func (*TxnManager) GetTxnByCtx ¶
func (mgr *TxnManager) GetTxnByCtx(ctx []byte) txnif.AsyncTxn
func (*TxnManager) MarshalLogObject ¶
func (mgr *TxnManager) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
func (*TxnManager) MinTSForTest ¶ added in v0.7.0
func (mgr *TxnManager) MinTSForTest() types.TS
MinTSForTest is only be used in ut to ensure that files that have been gc will not be used.
func (*TxnManager) OnException ¶
func (mgr *TxnManager) OnException(new error)
func (*TxnManager) OnOpTxn ¶
func (mgr *TxnManager) OnOpTxn(op *OpTxn) (err error)
func (*TxnManager) OnReplayTxn ¶ added in v0.6.0
func (mgr *TxnManager) OnReplayTxn(txn txnif.AsyncTxn) (err error)
Note: Replay should always runs in a single thread
func (*TxnManager) Start ¶ added in v0.6.0
func (mgr *TxnManager) Start()
func (*TxnManager) StartTxn ¶
func (mgr *TxnManager) StartTxn(info []byte) (txn txnif.AsyncTxn, err error)
StartTxn starts a local transaction initiated by DN
func (*TxnManager) StatMaxCommitTS ¶ added in v0.6.0
func (mgr *TxnManager) StatMaxCommitTS() (ts types.TS)
func (*TxnManager) Stop ¶
func (mgr *TxnManager) Stop()
type TxnRelation ¶
func (*TxnRelation) AddBlksWithMetaLoc ¶ added in v0.7.0
func (rel *TxnRelation) AddBlksWithMetaLoc([]containers.Vector, string, []string, int32) error
func (*TxnRelation) Append ¶
func (rel *TxnRelation) Append(data *containers.Batch) error
func (*TxnRelation) BatchDedup ¶
func (rel *TxnRelation) BatchDedup(col containers.Vector) error
func (*TxnRelation) Close ¶
func (rel *TxnRelation) Close() error
func (*TxnRelation) CreateNonAppendableSegment ¶
func (rel *TxnRelation) CreateNonAppendableSegment(bool) (seg handle.Segment, err error)
func (*TxnRelation) CreateSegment ¶
func (rel *TxnRelation) CreateSegment(bool) (seg handle.Segment, err error)
func (*TxnRelation) DeleteByFilter ¶
func (rel *TxnRelation) DeleteByFilter(filter *handle.Filter) (err error)
func (*TxnRelation) DeleteByPhyAddrKey ¶ added in v0.6.0
func (rel *TxnRelation) DeleteByPhyAddrKey(any) (err error)
func (*TxnRelation) DeleteByPhyAddrKeys ¶ added in v0.6.0
func (rel *TxnRelation) DeleteByPhyAddrKeys(containers.Vector) (err error)
func (*TxnRelation) GetByFilter ¶
func (*TxnRelation) GetCardinality ¶
func (rel *TxnRelation) GetCardinality(attr string) int64
func (*TxnRelation) GetMeta ¶
func (rel *TxnRelation) GetMeta() any
func (*TxnRelation) GetSegment ¶
func (rel *TxnRelation) GetSegment(id uint64) (seg handle.Segment, err error)
func (*TxnRelation) GetValueByFilter ¶
func (*TxnRelation) GetValueByPhyAddrKey ¶ added in v0.6.0
func (rel *TxnRelation) GetValueByPhyAddrKey(any, int) (v any, err error)
func (*TxnRelation) ID ¶
func (rel *TxnRelation) ID() uint64
func (*TxnRelation) LogTxnEntry ¶
func (*TxnRelation) MakeBlockIt ¶
func (rel *TxnRelation) MakeBlockIt() handle.BlockIt
func (*TxnRelation) MakeSegmentIt ¶
func (rel *TxnRelation) MakeSegmentIt() handle.SegmentIt
func (*TxnRelation) RangeDelete ¶
func (rel *TxnRelation) RangeDelete(*common.ID, uint32, uint32, handle.DeleteType) (err error)
func (*TxnRelation) Rows ¶
func (rel *TxnRelation) Rows() int64
func (*TxnRelation) Schema ¶
func (rel *TxnRelation) Schema() any
func (*TxnRelation) SimplePPString ¶
func (rel *TxnRelation) SimplePPString(_ common.PPLevel) string
func (*TxnRelation) Size ¶
func (rel *TxnRelation) Size(attr string) int64
func (*TxnRelation) SoftDeleteSegment ¶
func (rel *TxnRelation) SoftDeleteSegment(id uint64) (err error)
func (*TxnRelation) String ¶
func (rel *TxnRelation) String() string
func (*TxnRelation) UpdateByFilter ¶
func (*TxnRelation) UpdateConstraint ¶ added in v0.7.0
func (rel *TxnRelation) UpdateConstraint(cstr []byte) (err error)
type TxnSegment ¶
func (*TxnSegment) BatchDedup ¶
func (seg *TxnSegment) BatchDedup(containers.Vector) (err error)
func (*TxnSegment) Close ¶
func (seg *TxnSegment) Close() error
func (*TxnSegment) CreateBlock ¶
func (seg *TxnSegment) CreateBlock() (blk handle.Block, err error)
func (*TxnSegment) CreateNonAppendableBlock ¶
func (seg *TxnSegment) CreateNonAppendableBlock() (blk handle.Block, err error)
func (*TxnSegment) GetBlock ¶
func (seg *TxnSegment) GetBlock(id uint64) (blk handle.Block, err error)
func (*TxnSegment) GetID ¶
func (seg *TxnSegment) GetID() uint64
func (*TxnSegment) GetMeta ¶
func (seg *TxnSegment) GetMeta() any
func (*TxnSegment) GetRelation ¶
func (seg *TxnSegment) GetRelation() (rel handle.Relation)
func (*TxnSegment) MakeBlockIt ¶
func (seg *TxnSegment) MakeBlockIt() (it handle.BlockIt)
func (*TxnSegment) PushDeleteOp ¶
func (seg *TxnSegment) PushDeleteOp(handle.Filter) (err error)
func (*TxnSegment) PushUpdateOp ¶
func (*TxnSegment) RangeDelete ¶
func (seg *TxnSegment) RangeDelete(uint64, uint32, uint32, handle.DeleteType) (err error)
func (*TxnSegment) SoftDeleteBlock ¶
func (seg *TxnSegment) SoftDeleteBlock(id uint64) (err error)
func (*TxnSegment) String ¶
func (seg *TxnSegment) String() string
type TxnState ¶
type TxnState struct {
// contains filtered or unexported fields
}
func (*TxnState) IsCommitted ¶
func (*TxnState) IsRollbacked ¶
func (*TxnState) IsUncommitted ¶
func (*TxnState) ToCommitted ¶
func (*TxnState) ToCommitting ¶
func (*TxnState) ToRollbacked ¶
func (*TxnState) ToRollbacking ¶
type TxnStateCmd ¶ added in v0.6.0
func NewEmptyTxnStateCmd ¶ added in v0.6.0
func NewEmptyTxnStateCmd() *TxnStateCmd
func NewTxnStateCmd ¶ added in v0.6.0
func (*TxnStateCmd) ApplyCommit ¶ added in v0.6.0
func (c *TxnStateCmd) ApplyCommit()
func (*TxnStateCmd) ApplyRollback ¶ added in v0.6.0
func (c *TxnStateCmd) ApplyRollback()
func (*TxnStateCmd) Close ¶ added in v0.6.0
func (c *TxnStateCmd) Close()
func (*TxnStateCmd) Desc ¶ added in v0.6.0
func (c *TxnStateCmd) Desc() string
func (*TxnStateCmd) GetType ¶ added in v0.6.0
func (c *TxnStateCmd) GetType() int16
func (*TxnStateCmd) Marshal ¶ added in v0.6.0
func (c *TxnStateCmd) Marshal() (buf []byte, err error)
func (*TxnStateCmd) ReadFrom ¶ added in v0.6.0
func (c *TxnStateCmd) ReadFrom(r io.Reader) (n int64, err error)
func (*TxnStateCmd) SetReplayTxn ¶ added in v0.6.0
func (c *TxnStateCmd) SetReplayTxn(_ txnif.AsyncTxn)
func (*TxnStateCmd) String ¶ added in v0.6.0
func (c *TxnStateCmd) String() string
func (*TxnStateCmd) Unmarshal ¶ added in v0.6.0
func (c *TxnStateCmd) Unmarshal(buf []byte) (err error)
func (*TxnStateCmd) VerboseString ¶ added in v0.6.0
func (c *TxnStateCmd) VerboseString() string