Documentation
¶
Index ¶
- Variables
- func RegisterCmdFactory(cmdType int16, factory CmdFactory)
- func TxnStrState(state TxnState) string
- type AppendNode
- type AsyncTxn
- type CmdFactory
- type CmdType
- type DeleteChain
- type DeleteNode
- type MVCCNode
- type Txn2PC
- type TxnAsyncer
- type TxnChanger
- type TxnCmd
- type TxnEntry
- type TxnEntryType
- type TxnHandle
- type TxnMemo
- func (memo *TxnMemo) AddCatalogChange()
- func (memo *TxnMemo) GetDirty() *common.Tree
- func (memo *TxnMemo) GetDirtyTableByID(id uint64) *common.TableTree
- func (memo *TxnMemo) HasAnyTableDataChanges() bool
- func (memo *TxnMemo) HasCatalogChanges() bool
- func (memo *TxnMemo) HasTableDataChanges(id uint64) bool
- func (memo *TxnMemo) ReadFrom(r io.Reader) (n int64, err error)
- func (memo *TxnMemo) WriteTo(w io.Writer) (n int64, err error)
- type TxnReader
- type TxnState
- type TxnStatus
- type TxnStore
- type TxnTest
- type TxnUnsafe
- type TxnWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTxnWWConflict = moerr.NewTxnWWConflictNoCtx()
)
View Source
var UncommitTS types.TS
Functions ¶
func RegisterCmdFactory ¶
func RegisterCmdFactory(cmdType int16, factory CmdFactory)
func TxnStrState ¶
Types ¶
type AppendNode ¶
type AsyncTxn ¶
type AsyncTxn interface { TxnUnsafe TxnTest Txn2PC TxnHandle TxnAsyncer TxnReader TxnWriter TxnChanger }
type CmdFactory ¶
func GetCmdFactory ¶
func GetCmdFactory(cmdType int16) (factory CmdFactory)
type DeleteChain ¶
type DeleteChain interface { sync.Locker RLock() RUnlock() RemoveNodeLocked(DeleteNode) AddNodeLocked(txn AsyncTxn, deleteType handle.DeleteType) DeleteNode AddMergeNode() DeleteNode PrepareRangeDelete(start, end uint32, ts types.TS) error DepthLocked() int CollectDeletesLocked(ts types.TS, collectIndex bool, rwlocker *sync.RWMutex) (DeleteNode, error) }
type DeleteNode ¶
type MVCCNode ¶ added in v0.6.0
type MVCCNode interface { String() string IsVisible(ts types.TS) (visible bool) CheckConflict(ts types.TS) error Update(o MVCCNode) PreparedIn(minTS, maxTS types.TS) (in, before bool) CommittedIn(minTS, maxTS types.TS) (in, before bool) NeedWaitCommitting(ts types.TS) (bool, TxnReader) IsSameTxn(ts types.TS) bool IsActive() bool IsCommitting() bool IsCommitted() bool IsAborted() bool Set1PC() Is1PC() bool GetEnd() types.TS GetStart() types.TS GetPrepare() types.TS GetTxn() TxnReader SetLogIndex(idx *wal.Index) GetLogIndex() *wal.Index ApplyCommit(index *wal.Index) (err error) ApplyRollback(index *wal.Index) (err error) PrepareCommit() (err error) PrepareRollback() (err error) WriteTo(w io.Writer) (n int64, err error) ReadFrom(r io.Reader) (n int64, err error) CloneData() MVCCNode CloneAll() MVCCNode Close() }
type TxnChanger ¶
type TxnChanger interface { sync.Locker RLock() RUnlock() ToCommittedLocked() error ToPreparingLocked(ts types.TS) error ToPrepared() error ToPreparedLocked() error ToRollbackedLocked() error ToRollbacking(ts types.TS) error ToRollbackingLocked(ts types.TS) error ToUnknownLocked() Prepare() (types.TS, error) Committing() error Commit() error Rollback() error SetCommitTS(cts types.TS) error SetParticipants(ids []uint64) error SetError(error) CommittingInRecovery() error CommitInRecovery() error }
type TxnEntryType ¶
type TxnEntryType int16
type TxnHandle ¶
type TxnHandle interface { BindAccessInfo(tenantID, userID, roleID uint32) GetTenantID() uint32 GetUserAndRoleID() (uint32, uint32) CreateDatabase(name, createSql string) (handle.Database, error) CreateDatabaseWithID(name, createSql string, id uint64) (handle.Database, error) DropDatabase(name string) (handle.Database, error) DropDatabaseByID(id uint64) (handle.Database, error) GetDatabase(name string) (handle.Database, error) GetDatabaseByID(id uint64) (handle.Database, error) DatabaseNames() []string }
type TxnMemo ¶ added in v0.6.0
func NewTxnMemo ¶ added in v0.6.0
func NewTxnMemo() *TxnMemo
func (*TxnMemo) AddCatalogChange ¶ added in v0.6.0
func (memo *TxnMemo) AddCatalogChange()
func (*TxnMemo) GetDirtyTableByID ¶ added in v0.6.0
func (*TxnMemo) HasAnyTableDataChanges ¶ added in v0.6.0
func (*TxnMemo) HasCatalogChanges ¶ added in v0.6.0
func (*TxnMemo) HasTableDataChanges ¶ added in v0.6.0
type TxnReader ¶
type TxnReader interface { RLock() RUnlock() IsReplay() bool Is2PC() bool GetID() string GetCtx() []byte GetStartTS() types.TS GetCommitTS() types.TS GetPrepareTS() types.TS GetParticipants() []uint64 GetInfo() []byte IsVisible(o TxnReader) bool GetTxnState(waitIfcommitting bool) TxnState GetError() error GetStore() TxnStore String() string Repr() string GetLSN() uint64 GetMemo() *TxnMemo SameTxn(startTs types.TS) bool CommitBefore(startTs types.TS) bool CommitAfter(startTs types.TS) bool }
type TxnState ¶
type TxnState int32
const ( TxnStateActive TxnState = iota TxnStatePreparing //TxnStatePrepared only for 2PC TxnStatePrepared //TxnStateCommittingFinished only for 2PC txn runs on coordinator TxnStateCommittingFinished TxnStateRollbacking //TxnStateCommitted , TxnStateRollbacked, and TxnStateUnknown are final states. TxnStateCommitted TxnStateRollbacked TxnStateUnknown )
type TxnStore ¶
type TxnStore interface { io.Closer Txn2PC TxnUnsafe WaitPrepared() error BindTxn(AsyncTxn) GetLSN() uint64 BatchDedup(dbId, id uint64, pk containers.Vector) error LogSegmentID(dbId, tid, sid uint64) LogBlockID(dbId, tid, bid uint64) Append(dbId, id uint64, data *containers.Batch) error AddBlksWithMetaLoc(dbId, id uint64, pkVecs []containers.Vector, file string, metaLocs []string, flag int32) error RangeDelete(dbId uint64, id *common.ID, start, end uint32, dt handle.DeleteType) error GetByFilter(dbId uint64, id uint64, filter *handle.Filter) (*common.ID, uint32, error) GetValue(dbId uint64, id *common.ID, row uint32, col uint16) (any, error) CreateRelation(dbId uint64, def any) (handle.Relation, error) CreateRelationWithTableId(dbId uint64, tableId uint64, def any) (handle.Relation, error) DropRelationByName(dbId uint64, name string) (handle.Relation, error) DropRelationByID(dbId uint64, tid uint64) (handle.Relation, error) GetRelationByName(dbId uint64, name string) (handle.Relation, error) GetRelationByID(dbId uint64, tid uint64) (handle.Relation, error) CreateDatabase(name, createSql string) (handle.Database, error) CreateDatabaseWithID(name, createSql string, id uint64) (handle.Database, error) GetDatabase(name string) (handle.Database, error) GetDatabaseByID(id uint64) (handle.Database, error) DropDatabase(name string) (handle.Database, error) DropDatabaseByID(id uint64) (handle.Database, error) DatabaseNames() []string GetSegment(dbId uint64, id *common.ID) (handle.Segment, error) CreateSegment(dbId, tid uint64, is1PC bool) (handle.Segment, error) CreateNonAppendableSegment(dbId, tid uint64, is1PC bool) (handle.Segment, error) CreateBlock(dbId, tid, sid uint64, is1PC bool) (handle.Block, error) GetBlock(dbId uint64, id *common.ID) (handle.Block, error) CreateNonAppendableBlock(dbId uint64, id *common.ID) (handle.Block, error) CreateNonAppendableBlockWithMeta(dbId uint64, id *common.ID, metaLoc string, deltaLoc string) (handle.Block, error) SoftDeleteSegment(dbId uint64, id *common.ID) error SoftDeleteBlock(dbId uint64, id *common.ID) error UpdateMetaLoc(dbId uint64, id *common.ID, metaLoc string) (err error) UpdateDeltaLoc(dbId uint64, id *common.ID, deltaLoc string) (err error) AddTxnEntry(TxnEntryType, TxnEntry) LogTxnEntry(dbId, tableId uint64, entry TxnEntry, readed []*common.ID) error LogTxnState(sync bool) (entry.Entry, error) IsReadonly() bool IncreateWriteCnt() int }
Click to show internal directories.
Click to hide internal directories.