tx

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnID

type ConnID = int64

ConnID as type int64

type DTID

type DTID = string

DTID as type string

type DistributedTx

type DistributedTx struct {
	Dtid         string
	State        string
	Created      time.Time
	Participants []querypb.Target
}

DistributedTx is similar to querypb.TransactionMetadata, but is display friendly.

type EngineStateMachine

type EngineStateMachine interface {
	Init() error
	AcceptReadWrite() error
	AcceptReadOnly() error
	StopGently()
}

EngineStateMachine is used to control the state the transactional engine - whether new connections and/or transactions are allowed or not.

type PreparedTx

type PreparedTx struct {
	Dtid    string
	Queries []string
	Time    time.Time
}

PreparedTx represents a displayable version of a prepared transaction.

type Properties

type Properties struct {
	EffectiveCaller *vtrpcpb.CallerID
	ImmediateCaller *querypb.VTGateCallerID
	StartTime       time.Time
	EndTime         time.Time
	Queries         []string
	Autocommit      bool
	Conclusion      string
	LogToFile       bool

	Stats *servenv.TimingsWrapper
}

Properties contains all information that is related to the currently running transaction on the connection

func (*Properties) InTransaction

func (p *Properties) InTransaction() bool

InTransaction returns true as soon as this struct is not nil

func (*Properties) RecordQuery

func (p *Properties) RecordQuery(query string)

RecordQuery records the query against this transaction.

func (*Properties) String

func (p *Properties) String(sanitize bool) string

String returns a printable version of the transaction

type ReleaseReason

type ReleaseReason int

ReleaseReason as type int

const (
	// TxClose - connection released on close.
	TxClose ReleaseReason = iota

	// TxCommit - connection released on commit.
	TxCommit

	// TxRollback - connection released on rollback.
	TxRollback

	// TxKill - connection released on tx kill.
	TxKill

	// ConnInitFail - connection released on failed to start tx.
	ConnInitFail

	// ConnRelease - connection closed.
	ConnRelease

	// ConnRenewFail - reserve connection renew failed.
	ConnRenewFail
)

func (ReleaseReason) Name

func (r ReleaseReason) Name() string

Name return the name of enum.

func (ReleaseReason) String

func (r ReleaseReason) String() string

Jump to

Keyboard shortcuts

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