txnimpl

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 29 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TxnEntryCreateDatabase txnif.TxnEntryType = iota
	TxnEntryDropDatabase
	TxnEntryCretaeTable
	TxnEntryDropTable
)
View Source
const (
	ETInsertNode = entry.ETCustomizedStart + 1 + iota
	ETTxnRecord
	ETTxnState
)
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 = moerr.NewInternalError("tae: duplicate node")
)
View Source
var TxnFactory = func(catalog *catalog.Catalog) txnbase.TxnFactory {
	return func(mgr *txnbase.TxnManager, store txnif.TxnStore, txnId []byte,
		start types.TS, info []byte) txnif.AsyncTxn {
		return newTxnImpl(catalog, mgr, store, txnId, start, info)
	}
}
View Source
var TxnStoreFactory = func(
	catalog *catalog.Catalog,
	driver wal.Driver,
	transferTable *model.HashPageTable,
	txnBufMgr base.INodeManager,
	dataFactory *tables.DataFactory) txnbase.TxnStoreFactory {
	return func() txnif.TxnStore {
		return newStore(catalog, driver, transferTable, txnBufMgr, dataFactory)
	}
}

Functions

func DedupOp

func DedupOp[T comparable](
	t types.Type,
	attr string,
	vs any,
	tree map[any]uint32) (err error)

func FillColumnRow added in v0.6.0

func FillColumnRow(table *catalog.TableEntry, attr string, colData containers.Vector)

func FillDBRow added in v0.6.0

func FillDBRow(db *catalog.DBEntry, attr string, colData containers.Vector)

func FillTableRow added in v0.6.0

func FillTableRow(table *catalog.TableEntry, attr string, colData containers.Vector)

func InsertOp

func InsertOp[T comparable](
	t types.Type,
	attr string,
	input any,
	start, count int,
	fromRow uint32,
	dedupInput bool,
	tree map[any]uint32) (err error)

func MakeReplayTxn added in v0.6.0

func MakeReplayTxn(
	mgr *txnbase.TxnManager,
	ctx *txnbase.TxnCtx,
	lsn uint64,
	cmd *txnbase.TxnCmd,
	observer wal.ReplayObserver,
	catalog *catalog.Catalog,
	dataFactory *tables.DataFactory,
	wal wal.Driver) *txnbase.Txn

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    types.TS
	Node  InsertNode
}

func NewAppendCmd

func NewAppendCmd(id uint32, node InsertNode) *AppendCmd

func NewEmptyAppendCmd

func NewEmptyAppendCmd() *AppendCmd

func (*AppendCmd) Close

func (c *AppendCmd) Close()

func (*AppendCmd) Desc

func (c *AppendCmd) Desc() string

func (*AppendCmd) GetType

func (c *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(string, containers.Vector) error
	BatchInsert(string, 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