snapshotmulti

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(cms storetypes.CacheMultiStore, keys map[string]*storetypes.KVStoreKey) *Store

NewStore creates a new Store objectwith CacheMultiStore and KVStoreKeys

func NewStoreWithKVStores

func NewStoreWithKVStores(stores map[*storetypes.KVStoreKey]storetypes.CacheWrap) *Store

NewStore creates a new Store object with KVStores

func (*Store) CacheMultiStore

func (s *Store) CacheMultiStore() storetypes.CacheMultiStore

CacheMultiStore snapshots store and return current store.

func (*Store) CacheMultiStoreWithVersion

func (s *Store) CacheMultiStoreWithVersion(_ int64) (storetypes.CacheMultiStore, error)

CacheMultiStoreWithVersion load stores at a snapshot version.

NOTE: CacheMultiStoreWithVersion is no-op function.

func (*Store) CacheWrap

func (s *Store) CacheWrap() storetypes.CacheWrap

Implements CacheWrapper.

func (*Store) CacheWrapWithTrace

func (s *Store) CacheWrapWithTrace(_ io.Writer, _ storetypes.TraceContext) storetypes.CacheWrap

CacheWrapWithTrace implements the CacheWrapper interface.

NOTE: CacheWrapWithTrace is a method that enables a Store to satisfy the CacheWrapper interface. Although it accepts an io.Writer and tracingContext as inputs, these are not used in the implementation. Instead, it simply adds an additional cache layer on top of the existing KVStores. As a result, while the return value differs, the behavior is effectively the same as the Snapshot() method.

func (*Store) GetKVStore

func (s *Store) GetKVStore(key storetypes.StoreKey) storetypes.KVStore

GetKVStore returns an underlying KVStore by key.

func (*Store) GetStore

func (s *Store) GetStore(key storetypes.StoreKey) storetypes.Store

GetStore returns an underlying Store by key.

func (*Store) GetStoreType

func (s *Store) GetStoreType() storetypes.StoreType

GetStoreType returns the type of the store.

func (*Store) LatestVersion

func (s *Store) LatestVersion() int64

LatestVersion returns the branch version of the store

func (*Store) RevertToSnapshot

func (s *Store) RevertToSnapshot(target int)

RevertToSnapshot pops all the cached stores whose index is greator than or equal to target. The target should be snapshot index returned by `Snapshot`. This function panics if the index is out of bounds.

func (*Store) SetTracer

func (s *Store) SetTracer(_ io.Writer) storetypes.MultiStore

SetTracer sets the tracer for the MultiStore that the underlying stores will utilize to trace operations. A MultiStore is returned.

NOTE: SetTracer no-op function.

func (*Store) SetTracingContext

func (s *Store) SetTracingContext(_ storetypes.TraceContext) storetypes.MultiStore

SetTracingContext updates the tracing context for the MultiStore by merging the given context with the existing context by key. Any existing keys will be overwritten. It is implied that the caller should update the context when necessary between tracing operations. It returns a modified MultiStore.

NOTE: SetTracingContext no-op function

func (*Store) Snapshot

func (s *Store) Snapshot() int

Snapshot pushes a new cached context to the stack, and returns the index of it.

func (*Store) TracingEnabled

func (s *Store) TracingEnabled() bool

TracingEnabled returns if tracing is enabled for the MultiStore.

func (*Store) Write

func (s *Store) Write()

Write calls Write on each underlying store.

Jump to

Keyboard shortcuts

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