txnimpl

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: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxnEntryCreateDatabase txnif.TxnEntryType = iota
	TxnEntryDropDatabase
	TxnEntryCretaeTable
	TxnEntryDropTable
)
View Source
const (
	ETInsertNode = entry.ETCustomizedStart + 1 + iota
	ETTxnRecord
)
View Source
const (
	NTInsert txnbase.NodeType = iota
	NTUpdate
	NTDelete
	NTCreateTable
	NTDropTable
	NTCreateDB
	NTDropDB
)
View Source
const (
	CmdAppend int16 = txnbase.CmdCustomized + iota
)
View Source
const (
	// Note: Do not edit this id!!!
	LocalSegmentStartID uint64 = 1 << 47
)

Variables

View Source
var (
	ErrDuplicateNode = errors.New("tae: duplicate node")
)
View Source
var TxnFactory = func(catalog *catalog.Catalog) txnbase.TxnFactory {
	return func(mgr *txnbase.TxnManager, store txnif.TxnStore, txnId, start uint64, info []byte) txnif.AsyncTxn {
		return newTxnImpl(catalog, mgr, store, txnId, start, info)
	}
}
View Source
var TxnStoreFactory = func(catalog *catalog.Catalog, driver wal.Driver, txnBufMgr base.INodeManager, dataFactory *tables.DataFactory) txnbase.TxnStoreFactory {
	return func() txnif.TxnStore {
		return newStore(catalog, driver, txnBufMgr, dataFactory)
	}
}

Functions

func DedupOp

func DedupOp[T comparable](vs any, tree map[any]uint32) (err error)

func InsertOp

func InsertOp[T comparable](input any, start, count int, fromRow uint32, dedupInput bool, tree map[any]uint32) (err error)

func NewInsertNode

func NewInsertNode(tbl *txnTable, mgr base.INodeManager, id *common.ID, driver wal.Driver) *insertNode

func NewSimpleTableIndex

func NewSimpleTableIndex() *simpleTableIndex

Types

type AppendCmd

type AppendCmd struct {
	*txnbase.BaseCustomizedCmd
	*txnbase.ComposedCmd
	Infos []*appendInfo
	Ts    uint64
	Node  InsertNode
}

func NewAppendCmd

func NewAppendCmd(id uint32, node InsertNode) *AppendCmd

func NewEmptyAppendCmd

func NewEmptyAppendCmd() *AppendCmd

func (*AppendCmd) Close

func (e *AppendCmd) Close()

func (*AppendCmd) Desc

func (c *AppendCmd) Desc() string

func (*AppendCmd) GetType

func (e *AppendCmd) GetType() int16

func (*AppendCmd) Marshal

func (c *AppendCmd) Marshal() (buf []byte, err error)

func (*AppendCmd) ReadFrom

func (c *AppendCmd) ReadFrom(r io.Reader) (n int64, err error)

func (*AppendCmd) String

func (c *AppendCmd) String() string

func (*AppendCmd) Unmarshal

func (c *AppendCmd) Unmarshal(buf []byte) error

func (*AppendCmd) VerboseString

func (c *AppendCmd) VerboseString() string

func (*AppendCmd) WriteTo

func (c *AppendCmd) WriteTo(w io.Writer) (n int64, err error)

type InsertNode

type InsertNode interface {
	base.INode
	PrepareAppend(data *containers.Batch, offset uint32) (toAppend uint32)
	Append(data *containers.Batch, offset uint32) (appended uint32, err error)
	RangeDelete(start, end uint32) error
	IsRowDeleted(row uint32) bool
	PrintDeletes() string
	FillColumnView(*model.ColumnView, *bytes.Buffer) error
	Window(start, end uint32) (*containers.Batch, error)
	GetSpace() uint32
	Rows() uint32
	GetValue(col int, row uint32) any
	MakeCommand(uint32, bool) (txnif.TxnCmd, wal.LogEntry, error)
	ToTransient()
	AddApplyInfo(srcOff, srcLen, destOff, destLen uint32, dbid uint64, dest *common.ID) *appendInfo
	RowsWithoutDeletes() uint32
	LengthWithDeletes(appended, toAppend uint32) uint32
	OffsetWithDeletes(count uint32) uint32
	GetAppends() []*appendInfo
	GetTxn() txnif.AsyncTxn
}

type TableIndex

type TableIndex interface {
	io.Closer
	BatchDedup(containers.Vector) error
	BatchInsert(containers.Vector, int, int, uint32, bool) error
	Insert(any, uint32) error
	Delete(any) error
	Search(any) (uint32, error)
	Name() string
	Count() int
	KeyToVector(types.Type) containers.Vector
}

Jump to

Keyboard shortcuts

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