txnbase

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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 BuildCommandFrom

func BuildCommandFrom(r io.Reader) (cmd txnif.TxnCmd, n int64, err error)

func IDCtxToID

func IDCtxToID(buf []byte) uint64

func IDToIDCtx

func IDToIDCtx(id uint64) []byte

func IsCustomizedCmd

func IsCustomizedCmd(cmd txnif.TxnCmd) bool

func MarshalID

func MarshalID(id *common.ID) []byte

func TxnField

func TxnField(txn txnif.AsyncTxn) zap.Field

func TxnMgrField

func TxnMgrField(mgr *TxnManager) zap.Field

func UnmarshalID

func UnmarshalID(buf []byte) *common.ID

Types

type BaseCmd

type BaseCmd struct{}

func (*BaseCmd) Close

func (base *BaseCmd) Close()

type BaseCustomizedCmd

type BaseCustomizedCmd struct {
	BaseCmd
	ID   uint32
	Impl txnif.TxnCmd
}

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) Close

func (e *BatchCmd) Close()

func (*BatchCmd) Desc

func (e *BatchCmd) Desc() string

func (*BatchCmd) GetType

func (e *BatchCmd) GetType() int16

func (*BatchCmd) Marshal

func (e *BatchCmd) Marshal() (buf []byte, err error)

func (*BatchCmd) ReadFrom

func (e *BatchCmd) ReadFrom(r io.Reader) (n int64, err error)

func (*BatchCmd) String

func (e *BatchCmd) String() string

func (*BatchCmd) Unmarshal

func (e *BatchCmd) Unmarshal(buf []byte) error

func (*BatchCmd) VerboseString

func (e *BatchCmd) VerboseString() string

func (*BatchCmd) WriteTo

func (e *BatchCmd) WriteTo(w io.Writer) (n int64, err error)

type ComposedCmd

type ComposedCmd struct {
	BaseCmd
	Cmds    []txnif.TxnCmd
	CmdSize uint32
}

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) ReadFrom

func (cc *ComposedCmd) ReadFrom(r io.Reader) (n int64, 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

func (*ComposedCmd) WriteTo

func (cc *ComposedCmd) WriteTo(w io.Writer) (n int64, err error)

type CustomizedCmd

type CustomizedCmd interface {
	GetID() uint32
}

type DeleteBitmapCmd

type DeleteBitmapCmd struct {
	BaseCmd
	Bitmap *roaring.Bitmap
}

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

func (*DeleteBitmapCmd) WriteTo

func (e *DeleteBitmapCmd) WriteTo(w io.Writer) (n int64, err error)

type KeyT

type KeyT = byte
const (
	KeyT_DBEntry KeyT = iota
	KeyT_TableEntry
	KeyT_SegmentEntry
	KeyT_BlockEntry

	KeyT_DataRow
)

type Node

type Node interface {
	base.INode
	Type() NodeType
	ToTransient()
	Close() error
}

type NodeState

type NodeState = int32
const (
	TransientNode NodeState = iota
	PersistNode
)

type NodeType

type NodeType int8

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 (store *NoopTxnStore) CreateBlock(uint64, uint64, uint64) (blk handle.Block, err error)

func (*NoopTxnStore) CreateDatabase

func (store *NoopTxnStore) CreateDatabase(name string) (db handle.Database, err error)

func (*NoopTxnStore) CreateNonAppendableBlock

func (store *NoopTxnStore) CreateNonAppendableBlock(dbId uint64, id *common.ID) (blk handle.Block, err error)

func (*NoopTxnStore) CreateNonAppendableSegment

func (store *NoopTxnStore) CreateNonAppendableSegment(dbId, tid uint64) (seg handle.Segment, err error)

func (*NoopTxnStore) CreateRelation

func (store *NoopTxnStore) CreateRelation(dbId uint64, def any) (rel handle.Relation, err error)

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 (store *NoopTxnStore) DropRelationByName(dbId uint64, name string) (rel handle.Relation, err error)

func (*NoopTxnStore) GetBlock

func (store *NoopTxnStore) GetBlock(dbId uint64, id *common.ID) (blk handle.Block, err error)

func (*NoopTxnStore) GetByFilter

func (store *NoopTxnStore) GetByFilter(uint64, uint64, *handle.Filter) (id *common.ID, offset uint32, err error)

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 (store *NoopTxnStore) GetRelationByName(dbId uint64, name string) (rel handle.Relation, err error)

func (*NoopTxnStore) GetSegment

func (store *NoopTxnStore) GetSegment(dbId uint64, id *common.ID) (seg handle.Segment, err error)

func (*NoopTxnStore) GetValue

func (store *NoopTxnStore) GetValue(uint64, *common.ID, uint32, uint16) (v any, err error)

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 (store *NoopTxnStore) LogTxnEntry(dbId, tableId uint64, entry txnif.TxnEntry, readed []*common.ID) (err error)

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)

func (*NoopTxnStore) Update

func (store *NoopTxnStore) Update(uint64, *common.ID, uint32, uint16, any) (err error)

type OpTxn

type OpTxn struct {
	Txn txnif.AsyncTxn
	Op  OpType
}

func (*OpTxn) Repr

func (txn *OpTxn) Repr() string

type OpType

type OpType int8

type PointerCmd

type PointerCmd struct {
	BaseCmd
	Group uint32
	Lsn   uint64
}

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) ReadFrom

func (e *PointerCmd) ReadFrom(r io.Reader) (n int64, 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

func (*PointerCmd) WriteTo

func (e *PointerCmd) WriteTo(w io.Writer) (n int64, err error)

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 NewTxn

func NewTxn(mgr *TxnManager, store txnif.TxnStore, txnId uint64, start uint64, info []byte) *Txn

func (*Txn) ApplyCommit

func (txn *Txn) ApplyCommit() (err error)

func (*Txn) ApplyRollback

func (txn *Txn) ApplyRollback() (err error)

func (*Txn) Commit

func (txn *Txn) Commit() (err error)

func (*Txn) CreateDatabase

func (txn *Txn) CreateDatabase(name string) (db handle.Database, err error)

func (*Txn) CurrentDatabase

func (txn *Txn) CurrentDatabase() (db handle.Database)

func (*Txn) DatabaseNames

func (txn *Txn) DatabaseNames() (names []string)

func (*Txn) DoneWithErr

func (txn *Txn) DoneWithErr(err error)

func (*Txn) DropDatabase

func (txn *Txn) DropDatabase(name string) (db handle.Database, err error)

func (*Txn) GetDatabase

func (txn *Txn) GetDatabase(name string) (db handle.Database, err error)

func (*Txn) GetError

func (txn *Txn) GetError() error

func (*Txn) GetLSN

func (txn *Txn) GetLSN() uint64

func (*Txn) GetStore

func (txn *Txn) GetStore() txnif.TxnStore

func (*Txn) GetTxnState

func (txn *Txn) GetTxnState(waitIfcommitting bool) txnif.TxnState

func (*Txn) IsTerminated

func (txn *Txn) IsTerminated(waitIfcommitting bool) bool

func (*Txn) LogTxnEntry

func (txn *Txn) LogTxnEntry(dbId, tableId uint64, entry txnif.TxnEntry, readed []*common.ID) (err error)

func (*Txn) MarshalLogObject

func (txn *Txn) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

func (*Txn) MockIncWriteCnt

func (txn *Txn) MockIncWriteCnt() int

func (*Txn) PreApplyCommit

func (txn *Txn) PreApplyCommit() (err error)

func (*Txn) PreCommit

func (txn *Txn) PreCommit() error

func (*Txn) PrepareCommit

func (txn *Txn) PrepareCommit() (err error)

func (*Txn) PrepareRollback

func (txn *Txn) PrepareRollback() (err error)

func (*Txn) Rollback

func (txn *Txn) Rollback() (err error)

func (*Txn) SetApplyCommitFn

func (txn *Txn) SetApplyCommitFn(fn func(txnif.AsyncTxn) error)

func (*Txn) SetApplyRollbackFn

func (txn *Txn) SetApplyRollbackFn(fn func(txnif.AsyncTxn) error)

func (*Txn) SetError

func (txn *Txn) SetError(err error)

func (*Txn) SetPrepareCommitFn

func (txn *Txn) SetPrepareCommitFn(fn func(txnif.AsyncTxn) error)

func (*Txn) SetPrepareRollbackFn

func (txn *Txn) SetPrepareRollbackFn(fn func(txnif.AsyncTxn) error)

func (*Txn) String

func (txn *Txn) String() string

func (*Txn) UseDatabase

func (txn *Txn) UseDatabase(name string) (err error)

func (*Txn) WaitDone

func (txn *Txn) WaitDone(err error) error

type TxnBlock

type TxnBlock struct {
	Txn txnif.AsyncTxn
	Seg handle.Segment
}

func (*TxnBlock) Append

func (blk *TxnBlock) Append(*containers.Batch, uint32) (n uint32, err error)

func (*TxnBlock) BatchDedup

func (blk *TxnBlock) BatchDedup(containers.Vector) (err error)

func (*TxnBlock) Close

func (blk *TxnBlock) Close() error

func (*TxnBlock) Fingerprint

func (blk *TxnBlock) Fingerprint() *common.ID

func (*TxnBlock) GetByFilter

func (blk *TxnBlock) GetByFilter(*handle.Filter) (offset uint32, err error)

func (*TxnBlock) GetMeta

func (blk *TxnBlock) GetMeta() any

func (*TxnBlock) GetSegment

func (blk *TxnBlock) GetSegment() (seg handle.Segment)

func (*TxnBlock) GetTotalChanges

func (blk *TxnBlock) GetTotalChanges() int

func (blk *TxnBlock) IsAppendable() bool { return true }

func (*TxnBlock) ID

func (blk *TxnBlock) ID() uint64

func (*TxnBlock) IsAppendableBlock

func (blk *TxnBlock) IsAppendableBlock() bool

func (*TxnBlock) PushDeleteOp

func (blk *TxnBlock) PushDeleteOp(handle.Filter) (err error)

func (*TxnBlock) PushUpdateOp

func (blk *TxnBlock) PushUpdateOp(handle.Filter, string, any) (err error)

func (*TxnBlock) RangeDelete

func (blk *TxnBlock) RangeDelete(uint32, uint32, handle.DeleteType) (err error)

func (*TxnBlock) Rows

func (blk *TxnBlock) Rows() int

func (*TxnBlock) String

func (blk *TxnBlock) String() string

func (*TxnBlock) Update

func (blk *TxnBlock) Update(uint32, uint16, any) (err error)

type TxnCtx

type TxnCtx struct {
	*sync.RWMutex
	ID                uint64
	IDCtx             []byte
	StartTS, CommitTS uint64
	Info              []byte
	State             txnif.TxnState
}

func NewTxnCtx

func NewTxnCtx(rwlocker *sync.RWMutex, id, start uint64, info []byte) *TxnCtx

func (*TxnCtx) GetCommitTS

func (ctx *TxnCtx) GetCommitTS() uint64

func (*TxnCtx) GetCtx

func (txn *TxnCtx) GetCtx() []byte

func (*TxnCtx) GetID

func (ctx *TxnCtx) GetID() uint64

func (*TxnCtx) GetInfo

func (ctx *TxnCtx) GetInfo() []byte

func (*TxnCtx) GetStartTS

func (ctx *TxnCtx) GetStartTS() uint64

func (*TxnCtx) IsActiveLocked

func (ctx *TxnCtx) IsActiveLocked() bool

func (*TxnCtx) IsVisible

func (ctx *TxnCtx) IsVisible(o txnif.TxnReader) bool

func (*TxnCtx) MockSetCommitTSLocked

func (ctx *TxnCtx) MockSetCommitTSLocked(ts uint64)

For testing

func (*TxnCtx) Repr

func (ctx *TxnCtx) Repr() string

func (*TxnCtx) String

func (ctx *TxnCtx) String() string

func (*TxnCtx) ToCommittedLocked

func (ctx *TxnCtx) ToCommittedLocked() error

func (*TxnCtx) ToCommittingLocked

func (ctx *TxnCtx) ToCommittingLocked(ts uint64) error

func (*TxnCtx) ToRollbackedLocked

func (ctx *TxnCtx) ToRollbackedLocked() error

func (*TxnCtx) ToRollbackingLocked

func (ctx *TxnCtx) ToRollbackingLocked(ts uint64) error

func (*TxnCtx) ToUnknownLocked

func (ctx *TxnCtx) ToUnknownLocked()

type TxnDatabase

type TxnDatabase struct {
	Txn txnif.AsyncTxn
}

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 TxnFactory = func(*TxnManager, txnif.TxnStore, uint64, uint64, []byte) txnif.AsyncTxn

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) GetTxn

func (mgr *TxnManager) GetTxn(id uint64) txnif.AsyncTxn

func (*TxnManager) GetTxnByCtx

func (mgr *TxnManager) GetTxnByCtx(ctx []byte) txnif.AsyncTxn

func (*TxnManager) Init

func (mgr *TxnManager) Init(prevTxnId uint64, prevTs uint64) error

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

type TxnRelation struct {
	Txn txnif.AsyncTxn
	DB  handle.Database
}

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 (rel *TxnRelation) GetByFilter(*handle.Filter) (id *common.ID, offset uint32, err error)

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) GetValue

func (rel *TxnRelation) GetValue(*common.ID, uint32, uint16) (v any, err error)

func (*TxnRelation) GetValueByFilter

func (rel *TxnRelation) GetValueByFilter(filter *handle.Filter, col int) (v any, err error)

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 (rel *TxnRelation) LogTxnEntry(entry txnif.TxnEntry, readed []*common.ID) (err error)

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) Update

func (rel *TxnRelation) Update(*common.ID, uint32, uint16, any) (err error)

func (*TxnRelation) UpdateByFilter

func (rel *TxnRelation) UpdateByFilter(filter *handle.Filter, col uint16, v any) (err error)

func (*TxnRelation) UpdateByHiddenKey

func (rel *TxnRelation) UpdateByHiddenKey(any, int, any) (err error)

type TxnSegment

type TxnSegment struct {
	Txn txnif.AsyncTxn
	Rel handle.Relation
}

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 (seg *TxnSegment) PushUpdateOp(handle.Filter, string, any) (err error)

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

func (*TxnSegment) Update

func (seg *TxnSegment) Update(uint64, uint32, uint16, any) (err error)

type TxnState

type TxnState struct {
	// contains filtered or unexported fields
}

func (*TxnState) IsCommitted

func (ts *TxnState) IsCommitted() bool

func (*TxnState) IsRollbacked

func (ts *TxnState) IsRollbacked() bool

func (*TxnState) IsUncommitted

func (ts *TxnState) IsUncommitted() bool

func (*TxnState) ToCommitted

func (ts *TxnState) ToCommitted() error

func (*TxnState) ToCommitting

func (ts *TxnState) ToCommitting() error

func (*TxnState) ToRollbacked

func (ts *TxnState) ToRollbacked() error

func (*TxnState) ToRollbacking

func (ts *TxnState) ToRollbacking() error

type TxnStoreFactory

type TxnStoreFactory = func() txnif.TxnStore

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL