txnimpl

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IOET_WALTxnCommand_Append uint16 = 3008

	IOET_WALTxnCommand_Append_V1 uint16 = 1
	IOET_WALTxnCommand_Append_V2 uint16 = 2

	IOET_WALTxnCommand_Append_CurrVer = IOET_WALTxnCommand_Append_V2
)
View Source
const (
	IOET_WALEntry_TxnRecord = entry.IOET_WALEntry_CustomizedStart + iota
	IOET_WALEntry_TxnState
)
View Source
const (
	AppendInfoSize int64 = int64(unsafe.Sizeof(appendInfo{}))
)
View Source
const MaxNodeRows = 10000

Variables

View Source
var (
	ErrDuplicateNode = moerr.NewInternalErrorNoCtx("tae: duplicate node")
)
View Source
var ErrRWConflict = moerr.NewTxnRWConflictNoCtx()
View Source
var TxnFactory = func(catalog *catalog.Catalog) txnbase.TxnFactory {
	return func(mgr *txnbase.TxnManager, store txnif.TxnStore, txnId []byte,
		start, snapshot types.TS) txnif.AsyncTxn {
		return newTxnImpl(catalog, mgr, store, txnId, start, snapshot)
	}
}
View Source
var TxnStoreFactory = func(
	ctx context.Context,
	catalog *catalog.Catalog,
	driver wal.Driver,
	rt *dbutils.Runtime,
	dataFactory *tables.DataFactory,
	maxMessageSize uint64) txnbase.TxnStoreFactory {
	return func() txnif.TxnStore {
		return newStore(ctx, catalog, driver, rt, dataFactory, maxMessageSize)
	}
}

Functions

func DedupOp

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

func EncodeAppendInfo added in v0.8.0

func EncodeAppendInfo(info *appendInfo) []byte

func FillColumnRow added in v0.6.0

func FillColumnRow(table *catalog.TableEntry, node *catalog.MVCCNode[*catalog.TableMVCCNode], attr string, colData containers.Vector)

func FillDBRow added in v0.6.0

func FillDBRow(db *catalog.DBEntry, _ *catalog.MVCCNode[*catalog.EmptyMVCCNode], attr string, colData containers.Vector)

func FillTableRow added in v0.6.0

func FillTableRow(table *catalog.TableEntry, node *catalog.MVCCNode[*catalog.TableMVCCNode], attr string, colData containers.Vector)

func InsertOp

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

func MakeReplayTxn added in v0.6.0

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

func NewANode added in v0.7.0

func NewANode(
	tbl *txnTable,
	meta *catalog.ObjectEntry,
) *anode

NewANode creates a InsertNode with data in memory.

func NewSimpleTableIndex

func NewSimpleTableIndex() *simpleTableIndex

Types

type AppendCmd

type AppendCmd struct {
	*txnbase.BaseCustomizedCmd
	Data  *containers.Batch
	Infos []*appendInfo
	Ts    types.TS
	Node  InsertNode
}

func NewAppendCmd

func NewAppendCmd(id uint32, node InsertNode, data *containers.Batch) *AppendCmd

func NewEmptyAppendCmd

func NewEmptyAppendCmd() *AppendCmd

func (*AppendCmd) ApplyCommit added in v0.8.0

func (c *AppendCmd) ApplyCommit()

func (*AppendCmd) ApplyRollback added in v0.8.0

func (c *AppendCmd) ApplyRollback()

func (*AppendCmd) Close

func (c *AppendCmd) Close()

func (*AppendCmd) Desc

func (c *AppendCmd) Desc() string

func (*AppendCmd) GetType

func (c *AppendCmd) GetType() uint16

func (*AppendCmd) MarshalBinary added in v0.8.0

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

func (*AppendCmd) ReadFrom

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

func (*AppendCmd) ReadFromV1 added in v0.8.0

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

func (*AppendCmd) SetReplayTxn added in v0.8.0

func (c *AppendCmd) SetReplayTxn(_ txnif.AsyncTxn)

func (*AppendCmd) String

func (c *AppendCmd) String() string

func (*AppendCmd) UnmarshalBinary added in v0.8.0

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

func (*AppendCmd) UnmarshalBinaryV1 added in v0.8.0

func (c *AppendCmd) UnmarshalBinaryV1(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 {
	Close() error
	Append(data *containers.Batch, offset uint32) (appended uint32, err error)
	RangeDelete(start, end uint32) error
	IsRowDeleted(row uint32) bool
	IsPersisted() bool
	PrintDeletes() string
	GetColumnDataByIds([]int, *mpool.MPool) (*containers.BlockView, error)
	GetColumnDataById(context.Context, int, *mpool.MPool) (*containers.ColumnView, error)
	Prefetch(idxes []uint16) error
	FillBlockView(view *containers.BlockView, colIdxes []int, mp *mpool.MPool) (err error)
	FillColumnView(*containers.ColumnView, *mpool.MPool) error
	Window(start, end uint32) (*containers.Batch, error)
	WindowColumn(start, end uint32, pos int) (containers.Vector, error)
	Rows() uint32
	GetValue(col int, row uint32) (any, bool, error)
	MakeCommand(uint32) (txnif.TxnCmd, error)
	AddApplyInfo(srcOff, srcLen, destOff, destLen uint32, dest *common.ID) *appendInfo
	GetAppends() []*appendInfo
	GetTxn() txnif.AsyncTxn
}

type ObjectIt added in v1.1.0

type ObjectIt struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ObjectIt) Close added in v1.1.0

func (it *ObjectIt) Close() error

func (*ObjectIt) GetError added in v1.1.0

func (it *ObjectIt) GetError() error

func (*ObjectIt) GetObject added in v1.1.0

func (it *ObjectIt) GetObject() handle.Object

func (*ObjectIt) Next added in v1.1.0

func (it *ObjectIt) Next()

func (*ObjectIt) Valid added in v1.1.0

func (it *ObjectIt) Valid() bool

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
	KeyToVectors(types.Type) []containers.Vector
}

Jump to

Keyboard shortcuts

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