storage

package
v0.30.3-archive-node Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: AGPL-3.0 Imports: 3 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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