storage

package
v0.30.8 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SerialTransaction

type SerialTransaction struct {
	state.NestedTransaction
	derived.DerivedTransactionCommitter
}

TODO(patrick): implement proper transaction.

type SnapshotTree

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

SnapshotTree is a simple LSM tree representation of the key/value storage at a given point in time.

func NewSnapshotTree

func NewSnapshotTree(base state.StorageSnapshot) SnapshotTree

NewSnapshotTree returns a tree with keys/values initialized to the base storage snapshot.

func (SnapshotTree) Append

func (tree SnapshotTree) Append(
	update *state.ExecutionSnapshot,
) SnapshotTree

Append returns a new tree with updates from the execution snapshot "applied" to the original original tree.

func (SnapshotTree) Get

Get returns the register id's value.

type Transaction

type Transaction interface {
	state.NestedTransaction
	derived.DerivedTransaction
}

type TransactionComitter

type TransactionComitter interface {
	Transaction

	// 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() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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