transact

package
v0.5.403 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

type Coordinator interface {
	Statement
	// Begin a new transaction.
	Begin() (Coordinator, error)
	// Commit the current transaction.
	Commit() acid_dto.CommitCoDomain
	// Rollback the current transaction.
	Rollback() acid_dto.CommitCoDomain
	// Enqueue a transaction operation.
	// This method will return an error
	// in the case that the transaction
	// context disallows a particular
	// operation or type of operation.
	Enqueue(Statement) error
	// Get the depth of transaction nesting.
	Depth() int
	// Get the parent transaction manager.
	GetParent() (Coordinator, bool)
	//
	IsRoot() bool
}

The transaction coordinator ensures that undo and redo logs are kept and that 2PC is performed.

func NewCoordinator added in v0.5.403

func NewCoordinator(handlerCtx handler.HandlerContext, maxTxnDepth int) Coordinator

type Orchestrator added in v0.5.403

type Orchestrator interface {
	ProcessQueryOrQueries(
		handlerCtx handler.HandlerContext,
	) ([]internaldto.ExecutorOutput, bool)
}

type Provider

type Provider interface {
	// Create a new transaction manager.
	GetOrchestrator(handler.HandlerContext) (Orchestrator, error)
}

The transaction provider is singleton that orchestrates transaction managers.

type Statement

type Statement interface {
	Prepare() error
	Execute() internaldto.ExecutorOutput
	GetAST() (sqlparser.Statement, bool)
	GetPrimitiveGraphHolder() (primitivegraph.PrimitiveGraphHolder, bool)
	GetUndoLog() (binlog.LogEntry, bool)
	GetRedoLog() (binlog.LogEntry, bool)
	IsReadOnly() bool
	IsBegin() bool
	IsCommit() bool
	IsExecuted() bool
	IsRollback() bool
	GetQuery() string
}

func NewStatement

func NewStatement(
	query string,
	handlerCtx handler.HandlerContext,
	transactionContext txn_context.ITransactionContext,
) Statement

Jump to

Keyboard shortcuts

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