storage

package
v0.31.16-num-compactors Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: AGPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDatabase added in v0.31.0

type BlockDatabase struct {
	*primary.BlockData
	*derived.DerivedBlockData
}

BlockDatabase packages the primary index (BlockData) and secondary indices (DerivedBlockData) into a single database via 2PC.

func NewBlockDatabase added in v0.31.0

func NewBlockDatabase(
	storageSnapshot snapshot.StorageSnapshot,
	snapshotTime logical.Time,
	cachedDerivedBlockData *derived.DerivedBlockData,
) *BlockDatabase

NOTE: storageSnapshot must be thread safe.

func (*BlockDatabase) NewSnapshotReadTransaction added in v0.31.0

func (database *BlockDatabase) NewSnapshotReadTransaction(
	parameters state.StateParameters,
) Transaction

func (*BlockDatabase) NewTransaction added in v0.31.0

func (database *BlockDatabase) NewTransaction(
	executionTime logical.Time,
	parameters state.StateParameters,
) (
	Transaction,
	error,
)

type SerialTransaction

type SerialTransaction struct {
	state.NestedTransactionPreparer
	*derived.DerivedTransactionData
}

TODO(patrick): implement proper transaction.

type Transaction

type Transaction interface {
	TransactionPreparer

	// SnapshotTime returns the transaction's current snapshot time.
	SnapshotTime() logical.Time

	// Finalize convert transaction preparer's intermediate state into
	// committable state.
	Finalize() error

	// Validate returns nil if the transaction does not conflict with
	// previously committed transactions.  It returns an error otherwise.
	Validate() error

	// Commit commits the transaction.  If the transaction conflict with
	// previously committed transactions, an error is returned and the
	// transaction is not committed.
	Commit() (*snapshot.ExecutionSnapshot, error)
}

type TransactionPreparer added in v0.31.0

type TransactionPreparer interface {
	state.NestedTransactionPreparer
	derived.DerivedTransactionPreparer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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