Documentation ¶
Index ¶
- type EmptyStorageSnapshot
- type ExecutionSnapshot
- func (snapshot *ExecutionSnapshot) AllRegisterIDs() []flow.RegisterID
- func (snapshot *ExecutionSnapshot) ReadRegisterIDs() []flow.RegisterID
- func (snapshot *ExecutionSnapshot) UpdatedRegisterIDs() []flow.RegisterID
- func (snapshot *ExecutionSnapshot) UpdatedRegisterSet() map[flow.RegisterID]flow.RegisterValue
- func (snapshot *ExecutionSnapshot) UpdatedRegisters() flow.RegisterEntries
- type MapStorageSnapshot
- type Peeker
- type ReadFuncStorageSnapshot
- type SnapshotTree
- type StorageSnapshot
- type UpdateLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyStorageSnapshot ¶
type EmptyStorageSnapshot struct{}
func (EmptyStorageSnapshot) Get ¶
func (EmptyStorageSnapshot) Get( id flow.RegisterID, ) ( flow.RegisterValue, error, )
type ExecutionSnapshot ¶
type ExecutionSnapshot struct { // Note that the ReadSet only include reads from the storage snapshot. // Reads from the WriteSet are excluded from the ReadSet. ReadSet map[flow.RegisterID]struct{} WriteSet map[flow.RegisterID]flow.RegisterValue // Note that the spock secret may be nil if the view does not support spock. SpockSecret []byte // Note that the meter may be nil if the view does not support metering. *meter.Meter }
func (*ExecutionSnapshot) AllRegisterIDs ¶
func (snapshot *ExecutionSnapshot) AllRegisterIDs() []flow.RegisterID
AllRegisterIDs returns all register ids that were read / write by this view. The returned ids are unsorted.
func (*ExecutionSnapshot) ReadRegisterIDs ¶
func (snapshot *ExecutionSnapshot) ReadRegisterIDs() []flow.RegisterID
ReadRegisterIDs returns a list of register ids that were read. The returned ids are unsorted
func (*ExecutionSnapshot) UpdatedRegisterIDs ¶
func (snapshot *ExecutionSnapshot) UpdatedRegisterIDs() []flow.RegisterID
UpdatedRegisterIDs returns all register ids that were updated by this view. The returned ids are unsorted.
func (*ExecutionSnapshot) UpdatedRegisterSet ¶ added in v0.33.1
func (snapshot *ExecutionSnapshot) UpdatedRegisterSet() map[flow.RegisterID]flow.RegisterValue
UpdatedRegisterSet returns all registers that were updated by this view.
func (*ExecutionSnapshot) UpdatedRegisters ¶
func (snapshot *ExecutionSnapshot) UpdatedRegisters() flow.RegisterEntries
UpdatedRegisters returns all registers that were updated by this view. The returned entries are sorted by ids.
type MapStorageSnapshot ¶
type MapStorageSnapshot map[flow.RegisterID]flow.RegisterValue
func (MapStorageSnapshot) Get ¶
func (storage MapStorageSnapshot) Get( id flow.RegisterID, ) ( flow.RegisterValue, error, )
type Peeker ¶
type Peeker interface {
Peek(id flow.RegisterID) (flow.RegisterValue, error)
}
type ReadFuncStorageSnapshot ¶
type ReadFuncStorageSnapshot struct {
ReadFunc func(flow.RegisterID) (flow.RegisterValue, error)
}
func (ReadFuncStorageSnapshot) Get ¶
func (storage ReadFuncStorageSnapshot) Get( id flow.RegisterID, ) ( flow.RegisterValue, error, )
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 StorageSnapshot) SnapshotTree
NewSnapshotTree returns a tree with keys/values initialized to the base storage snapshot.
func (SnapshotTree) Append ¶
func (tree SnapshotTree) Append( update *ExecutionSnapshot, ) SnapshotTree
Append returns a new tree with updates from the execution snapshot "applied" to the original original tree.
func (SnapshotTree) Get ¶
func (tree SnapshotTree) Get(id flow.RegisterID) (flow.RegisterValue, error)
Get returns the register id's value.
type StorageSnapshot ¶
type StorageSnapshot interface { // Get returns the register id's value, or an empty RegisterValue if the id // is not found. Get should be idempotent (i.e., the same value is returned // for the same id). Get(id flow.RegisterID) (flow.RegisterValue, error) }
Note: StorageSnapshot must be thread safe (or immutable).
func NewPeekerStorageSnapshot ¶
func NewPeekerStorageSnapshot(peeker Peeker) StorageSnapshot
func NewReadFuncStorageSnapshot ¶
func NewReadFuncStorageSnapshot( readFunc func(flow.RegisterID) (flow.RegisterValue, error), ) StorageSnapshot
type UpdateLog ¶
type UpdateLog []map[flow.RegisterID]flow.RegisterValue