txnimpl

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IOET_WALTxnCommand_Append uint16 = 3008

	IOET_WALTxnCommand_Append_CurrVer = ioet_WALTxnCommand_Append_V3

	// MaxAppendCmdBufSize is the maximum capacity of marshalBuf in AppendCmd.
	// Buffers exceeding this size will be discarded to prevent large objects from staying in memory.
	MaxAppendCmdBufSize = 1 << 20 // 1MB
)
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
View Source
const (
	MaxWalSize = 70 * mpool.MB
)
View Source
const (
	TransferSinkerMemorySizeThreshold = common.Const1MBytes * 50
)

Variables

View Source
var ErrDebugReplay = moerr.NewInternalErrorNoCtx("debug")
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.Store,
	rt *dbutils.Runtime,
) txnbase.TxnStoreFactory {
	return func() txnif.TxnStore {
		isOffline := false
		return newStore(ctx, catalog, driver, rt, isOffline)
	}
}

Functions

func DedupOp

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

func DisableDebugSkipFreezePhaseTransfer

func DisableDebugSkipFreezePhaseTransfer()

func EnableDebugSkipFreezePhaseTransfer

func EnableDebugSkipFreezePhaseTransfer()

func EncodeAppendInfo added in v0.8.0

func EncodeAppendInfo(info *appendInfo) []byte

func FillColumnRow added in v0.6.0

func FillColumnRow(table *catalog.TableEntry, schema *catalog.Schema, 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, schema *catalog.Schema, 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,
) *txnbase.Txn

func NewANode added in v0.7.0

func NewANode(
	tbl *txnTable,
	meta *catalog.ObjectEntry,
	isTombstone bool,
) *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        *anode
	IsTombstone bool
}

func NewAppendCmd

func NewAppendCmd(id uint32, node *anode, data *containers.Batch, isTombstone bool) *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) ApproxSize

func (c *AppendCmd) ApproxSize() int64

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

func (c *AppendCmd) MarshalBinaryWithBuffer(buf *bytes.Buffer) error

MarshalBinaryWithBuffer serializes AppendCmd directly to the provided bytes.Buffer, avoiding buffer copying and allocations.

func (*AppendCmd) ReadFrom

func (c *AppendCmd) ReadFrom(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) VerboseString

func (c *AppendCmd) VerboseString() string

func (*AppendCmd) WriteTo

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

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