transactions

package
v0.0.0-rc14 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SinkYtState = "sink_yt_state"
)

Functions

This section is empty.

Types

type MainTxClient

type MainTxClient struct {
	// contains filtered or unexported fields
}

func NewMainTxClient

func NewMainTxClient(transferID string, cp coordinator.Coordinator, client yt.Client, logger log.Logger) *MainTxClient

func (*MainTxClient) BeginSubTx

func (c *MainTxClient) BeginSubTx() (yt.Tx, error)

BeginSubTx creates a child transaction from the main transaction.

func (*MainTxClient) BeginTx

func (c *MainTxClient) BeginTx() error

BeginTx starts a new main transaction and saves it to the transfer state. Also, previous saved transaction will be aborted and removed from state.

func (*MainTxClient) Close

func (c *MainTxClient) Close()

func (*MainTxClient) Commit

func (c *MainTxClient) Commit() error

Commit commits the main transaction or abort it if an error occurs. Anyway, the client will be closed.

func (*MainTxClient) ExecOrAbort

func (c *MainTxClient) ExecOrAbort(fn func(mainTxID yt.TxID) error) error

ExecOrAbort performs a function using the main transaction. In case of an error, aborts the main transaction and closes the client.

Jump to

Keyboard shortcuts

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