Documentation
¶
Index ¶
- Constants
- Variables
- func BuildCommandFrom(r io.Reader) (cmd txnif.TxnCmd, n int64, err error)
- func IDCtxToID(buf []byte) uint64
- 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) 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) 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 (e *ComposedCmd) Close()
- func (cc *ComposedCmd) Desc() string
- func (e *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) 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) 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) 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 KeyT
- type Node
- type NodeState
- type NodeType
- type NoopTxnStore
- func (store *NoopTxnStore) AddTxnEntry(t txnif.TxnEntryType, entry txnif.TxnEntry)
- func (store *NoopTxnStore) Append(dbId, id uint64, data *containers.Batch) 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) (blk handle.Block, err error)
- func (store *NoopTxnStore) CreateDatabase(name string) (db handle.Database, err error)
- func (store *NoopTxnStore) CreateNonAppendableBlock(dbId uint64, id *common.ID) (blk handle.Block, err error)
- func (store *NoopTxnStore) CreateNonAppendableSegment(dbId, tid uint64) (seg handle.Segment, err error)
- func (store *NoopTxnStore) CreateRelation(dbId uint64, def any) (rel handle.Relation, err error)
- func (store *NoopTxnStore) CreateSegment(dbId, tid uint64) (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) 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) GetLSN() uint64
- 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) 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) PreApplyCommit() error
- func (store *NoopTxnStore) PreCommit() 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) Update(uint64, *common.ID, uint32, uint16, any) (err error)
- type OpTxn
- type OpType
- type PointerCmd
- 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) 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) Commit() (err error)
- func (txn *Txn) CreateDatabase(name string) (db handle.Database, err error)
- func (txn *Txn) CurrentDatabase() (db handle.Database)
- func (txn *Txn) DatabaseNames() (names []string)
- func (txn *Txn) DoneWithErr(err error)
- func (txn *Txn) DropDatabase(name string) (db handle.Database, err error)
- func (txn *Txn) GetDatabase(name string) (db handle.Database, err error)
- func (txn *Txn) GetError() error
- func (txn *Txn) GetLSN() uint64
- func (txn *Txn) GetStore() txnif.TxnStore
- func (txn *Txn) GetTxnState(waitIfcommitting bool) txnif.TxnState
- func (txn *Txn) IsTerminated(waitIfcommitting bool) bool
- func (txn *Txn) LogTxnEntry(dbId, tableId uint64, entry txnif.TxnEntry, readed []*common.ID) (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) PreCommit() 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) UseDatabase(name string) (err error)
- func (txn *Txn) WaitDone(err error) 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 TxnCtx
- func (ctx *TxnCtx) GetCommitTS() uint64
- func (txn *TxnCtx) GetCtx() []byte
- func (ctx *TxnCtx) GetID() uint64
- func (ctx *TxnCtx) GetInfo() []byte
- func (ctx *TxnCtx) GetStartTS() uint64
- func (ctx *TxnCtx) IsActiveLocked() bool
- func (ctx *TxnCtx) IsVisible(o txnif.TxnReader) bool
- func (ctx *TxnCtx) MockSetCommitTSLocked(ts uint64)
- func (ctx *TxnCtx) Repr() string
- func (ctx *TxnCtx) String() string
- func (ctx *TxnCtx) ToCommittedLocked() error
- func (ctx *TxnCtx) ToCommittingLocked(ts uint64) error
- func (ctx *TxnCtx) ToRollbackedLocked() error
- func (ctx *TxnCtx) ToRollbackingLocked(ts uint64) 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
- type TxnFactory
- type TxnManager
- func (mgr *TxnManager) DeleteTxn(id uint64)
- func (mgr *TxnManager) GetTxn(id uint64) txnif.AsyncTxn
- func (mgr *TxnManager) GetTxnByCtx(ctx []byte) txnif.AsyncTxn
- func (mgr *TxnManager) Init(prevTxnId uint64, prevTs uint64) error
- func (mgr *TxnManager) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (mgr *TxnManager) OnException(new error)
- func (mgr *TxnManager) OnOpTxn(op *OpTxn) (err error)
- func (mgr *TxnManager) StartTxn(info []byte) (txn txnif.AsyncTxn, err error)
- func (mgr *TxnManager) StatActiveTxnCnt() int
- func (mgr *TxnManager) StatSafeTS() (ts uint64)
- func (mgr *TxnManager) Stop()
- type TxnRelation
- func (rel *TxnRelation) Append(data *containers.Batch) error
- func (rel *TxnRelation) BatchDedup(cols ...containers.Vector) error
- func (rel *TxnRelation) Close() error
- func (rel *TxnRelation) CreateNonAppendableSegment() (seg handle.Segment, err error)
- func (rel *TxnRelation) CreateSegment() (seg handle.Segment, err error)
- func (rel *TxnRelation) DeleteByFilter(filter *handle.Filter) (err error)
- func (rel *TxnRelation) DeleteByHiddenKey(any) (err error)
- func (rel *TxnRelation) DeleteByHiddenKeys(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) GetValueByHiddenKey(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) UpdateByHiddenKey(any, int, any) (err error)
- type TxnSegment
- func (blk *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 TxnStoreFactory
Constants ¶
View Source
const ( CmdPointer int16 = iota CmdDeleteBitmap CmdBatch CmdAppend CmdUpdate CmdDelete CmdComposed CmdCustomized )
View Source
const ( TSUncommitted int32 = iota TSCommitting TSCommitted TSRollbacking TSRollbacked )
View Source
const ( OpCommit = iota OpRollback )
View Source
const (
IDSize = 8 + 8 + 8 + 4 + 2 + 1
)
View Source
const (
MaxNodeRows uint32 = 10000
)
Variables ¶
View Source
var ( ErrTxnAlreadyCommitted = errors.New("tae: txn already committed") ErrTxnNotCommitting = errors.New("tae: txn not committing") ErrTxnNotRollbacking = errors.New("tae: txn not rollbacking") ErrTxnNotActive = errors.New("tae: txn not active") ErrTxnCannotRollback = errors.New("tae: txn cannot txn rollback") ErrDDLDropCreated = errors.New("tae: DDL cannot drop created in a txn") )
View Source
var DefaultTxnFactory = func(mgr *TxnManager, store txnif.TxnStore, id, startTS uint64, info []byte) txnif.AsyncTxn { return NewTxn(mgr, store, id, startTS, info) }
View Source
var (
ErrTransferTransactionState = errors.New("tae: transfer transaction state eror")
)
View Source
var KeyEncoder = keyEncoder{}
View Source
var NoopStoreFactory = func() txnif.TxnStore { return new(NoopTxnStore) }
Functions ¶
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) VerboseString ¶
type ComposedCmd ¶
func NewComposedCmd ¶
func NewComposedCmd() *ComposedCmd
func (*ComposedCmd) AddCmd ¶
func (cc *ComposedCmd) AddCmd(cmd txnif.TxnCmd)
func (*ComposedCmd) Close ¶
func (e *ComposedCmd) Close()
func (*ComposedCmd) Desc ¶
func (cc *ComposedCmd) Desc() string
func (*ComposedCmd) GetType ¶
func (e *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) 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) 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) 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 NoopTxnStore ¶
type NoopTxnStore struct{}
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) 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 string) (db handle.Database, err error)
func (*NoopTxnStore) CreateNonAppendableBlock ¶
func (*NoopTxnStore) CreateNonAppendableSegment ¶
func (store *NoopTxnStore) CreateNonAppendableSegment(dbId, tid uint64) (seg handle.Segment, err error)
func (*NoopTxnStore) CreateRelation ¶
func (*NoopTxnStore) CreateSegment ¶
func (store *NoopTxnStore) CreateSegment(dbId, tid uint64) (seg handle.Segment, err error)
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) DropRelationByName ¶
func (*NoopTxnStore) GetByFilter ¶
func (*NoopTxnStore) GetDatabase ¶
func (store *NoopTxnStore) GetDatabase(name string) (db handle.Database, err error)
func (*NoopTxnStore) GetLSN ¶
func (store *NoopTxnStore) GetLSN() uint64
func (*NoopTxnStore) GetRelationByName ¶
func (*NoopTxnStore) GetSegment ¶
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) PreApplyCommit ¶
func (store *NoopTxnStore) PreApplyCommit() error
func (*NoopTxnStore) PreCommit ¶
func (store *NoopTxnStore) PreCommit() 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)
type PointerCmd ¶
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) 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 {
sync.RWMutex
sync.WaitGroup
*TxnCtx
Mgr *TxnManager
Store txnif.TxnStore
Err error
DoneCond sync.Cond
LSN uint64
PrepareCommitFn func(txnif.AsyncTxn) error
PrepareRollbackFn func(txnif.AsyncTxn) error
ApplyCommitFn func(txnif.AsyncTxn) error
ApplyRollbackFn func(txnif.AsyncTxn) error
}
func (*Txn) ApplyCommit ¶
func (*Txn) ApplyRollback ¶
func (*Txn) CreateDatabase ¶
func (*Txn) CurrentDatabase ¶
func (*Txn) DatabaseNames ¶
func (*Txn) DoneWithErr ¶
func (*Txn) DropDatabase ¶
func (*Txn) IsTerminated ¶
func (*Txn) LogTxnEntry ¶
func (*Txn) MarshalLogObject ¶
func (txn *Txn) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
func (*Txn) MockIncWriteCnt ¶
func (*Txn) PreApplyCommit ¶
func (*Txn) PrepareCommit ¶
func (*Txn) PrepareRollback ¶
func (*Txn) SetPrepareRollbackFn ¶
func (*Txn) UseDatabase ¶
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 (blk *TxnBlock) IsAppendable() bool { return true }
func (*TxnBlock) IsAppendableBlock ¶
func (*TxnBlock) PushUpdateOp ¶
func (*TxnBlock) RangeDelete ¶
type TxnCtx ¶
type TxnCtx struct {
*sync.RWMutex
ID uint64
IDCtx []byte
StartTS, CommitTS uint64
Info []byte
State txnif.TxnState
}
func (*TxnCtx) GetCommitTS ¶
func (*TxnCtx) GetStartTS ¶
func (*TxnCtx) IsActiveLocked ¶
func (*TxnCtx) MockSetCommitTSLocked ¶
For testing
func (*TxnCtx) ToCommittedLocked ¶
func (*TxnCtx) ToCommittingLocked ¶
func (*TxnCtx) ToRollbackedLocked ¶
func (*TxnCtx) ToRollbackingLocked ¶
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
type TxnFactory ¶
type TxnManager ¶
type TxnManager struct {
sync.RWMutex
common.ClosedState
sm.StateMachine
Active map[uint64]txnif.AsyncTxn
IdAlloc, TsAlloc *common.IdAlloctor
TxnStoreFactory TxnStoreFactory
TxnFactory TxnFactory
ActiveMask *roaring64.Bitmap
Exception *atomic.Value
}
func NewTxnManager ¶
func NewTxnManager(txnStoreFactory TxnStoreFactory, txnFactory TxnFactory) *TxnManager
func (*TxnManager) DeleteTxn ¶
func (mgr *TxnManager) DeleteTxn(id uint64)
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) OnException ¶
func (mgr *TxnManager) OnException(new error)
func (*TxnManager) OnOpTxn ¶
func (mgr *TxnManager) OnOpTxn(op *OpTxn) (err error)
func (*TxnManager) StartTxn ¶
func (mgr *TxnManager) StartTxn(info []byte) (txn txnif.AsyncTxn, err error)
func (*TxnManager) StatActiveTxnCnt ¶
func (mgr *TxnManager) StatActiveTxnCnt() int
func (*TxnManager) StatSafeTS ¶
func (mgr *TxnManager) StatSafeTS() (ts uint64)
func (*TxnManager) Stop ¶
func (mgr *TxnManager) Stop()
type TxnRelation ¶
func (*TxnRelation) Append ¶
func (rel *TxnRelation) Append(data *containers.Batch) error
func (*TxnRelation) BatchDedup ¶
func (rel *TxnRelation) BatchDedup(cols ...containers.Vector) error
func (*TxnRelation) Close ¶
func (rel *TxnRelation) Close() error
func (*TxnRelation) CreateNonAppendableSegment ¶
func (rel *TxnRelation) CreateNonAppendableSegment() (seg handle.Segment, err error)
func (*TxnRelation) CreateSegment ¶
func (rel *TxnRelation) CreateSegment() (seg handle.Segment, err error)
func (*TxnRelation) DeleteByFilter ¶
func (rel *TxnRelation) DeleteByFilter(filter *handle.Filter) (err error)
func (*TxnRelation) DeleteByHiddenKey ¶
func (rel *TxnRelation) DeleteByHiddenKey(any) (err error)
func (*TxnRelation) DeleteByHiddenKeys ¶
func (rel *TxnRelation) DeleteByHiddenKeys(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) GetValueByHiddenKey ¶
func (rel *TxnRelation) GetValueByHiddenKey(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) UpdateByHiddenKey ¶
func (rel *TxnRelation) UpdateByHiddenKey(any, int, any) (err error)
type TxnSegment ¶
func (*TxnSegment) BatchDedup ¶
func (blk *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 TxnStoreFactory ¶
Click to show internal directories.
Click to hide internal directories.