snapshot

package
v0.35.0-crescendo-prev... Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigrationSnapshot

type MigrationSnapshot interface {
	snapshot.StorageSnapshot

	Exists(id flow.RegisterID) bool
	ApplyChangesAndGetNewPayloads(
		changes map[flow.RegisterID]flow.RegisterValue,
		expectedChangeAddresses map[flow.Address]struct{},
		logger zerolog.Logger,
	) ([]*ledger.Payload, error)

	Len() int
	PayloadMap() map[flow.RegisterID]*ledger.Payload
}

func NewPayloadSnapshot

func NewPayloadSnapshot(
	log zerolog.Logger,
	payloads []*ledger.Payload,
	snapshotType MigrationSnapshotType,
	nWorkers int,
) (MigrationSnapshot, error)

type MigrationSnapshotError

type MigrationSnapshotError struct {
	Err error
}

func NewMigrationSnapshotError

func NewMigrationSnapshotError(err error) *MigrationSnapshotError

func (*MigrationSnapshotError) Error

func (e *MigrationSnapshotError) Error() string

func (*MigrationSnapshotError) Unwrap

func (e *MigrationSnapshotError) Unwrap() error

type MigrationSnapshotType

type MigrationSnapshotType int
const (
	// LargeChangeSetOrReadonlySnapshot creates a `map[flow.RegisterID]*ledger.Payload` from the payloads
	// It is more efficient when the number of payloads that are going to change is either 0
	// or large compared to the total number of payloads (more than 30% of the current number of payloads).
	LargeChangeSetOrReadonlySnapshot MigrationSnapshotType = iota
	// SmallChangeSetSnapshot creates a map of indexes `map[flow.RegisterID]int` from the payloads array
	// It is more efficient when the number of payloads that are going to change is small
	// compared to the total number of payloads (less than 30% of the current number of payloads).
	SmallChangeSetSnapshot
)

Jump to

Keyboard shortcuts

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