transientstore

package
v0.0.0-...-9b7ba46 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrStoreEmpty is used to indicate that there are no entries in transient store
	ErrStoreEmpty = errors.New("Transient store is empty")
)

Functions

func Drop

func Drop(providerPath, ledgerID string) error

Drop removes a transient storage associated with an input channel/ledger. This function must be invoked while the peer is shut down. To recover from partial deletion due to a crash, the storage will be marked with an UNDER_DELETION status in the a system namespace db. At the next peer startup, transient storage marked with UNDER_DELETION will be scrubbed from the system.

Types

type EndorserPvtSimulationResults

type EndorserPvtSimulationResults struct {
	ReceivedAtBlockHeight          uint64
	PvtSimulationResultsWithConfig *transientstore.TxPvtReadWriteSetWithConfigInfo
}

EndorserPvtSimulationResults captures the details of the simulation results specific to an endorser

type PendingDeleteStorageList

type PendingDeleteStorageList struct {
	List                 []string `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PendingDeleteStorageList) Descriptor

func (*PendingDeleteStorageList) Descriptor() ([]byte, []int)

func (*PendingDeleteStorageList) GetList

func (m *PendingDeleteStorageList) GetList() []string

func (*PendingDeleteStorageList) ProtoMessage

func (*PendingDeleteStorageList) ProtoMessage()

func (*PendingDeleteStorageList) Reset

func (m *PendingDeleteStorageList) Reset()

func (*PendingDeleteStorageList) String

func (m *PendingDeleteStorageList) String() string

func (*PendingDeleteStorageList) XXX_DiscardUnknown

func (m *PendingDeleteStorageList) XXX_DiscardUnknown()

func (*PendingDeleteStorageList) XXX_Marshal

func (m *PendingDeleteStorageList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PendingDeleteStorageList) XXX_Merge

func (m *PendingDeleteStorageList) XXX_Merge(src proto.Message)

func (*PendingDeleteStorageList) XXX_Size

func (m *PendingDeleteStorageList) XXX_Size() int

func (*PendingDeleteStorageList) XXX_Unmarshal

func (m *PendingDeleteStorageList) XXX_Unmarshal(b []byte) error

type RWSetScanner

type RWSetScanner interface {
	// Next returns the next EndorserPvtSimulationResults from the RWSetScanner.
	// It may return nil, nil when it has no further data, and also may return an error
	// on failure
	Next() (*EndorserPvtSimulationResults, error)
	// Close frees the resources associated with this RWSetScanner
	Close()
}

RWSetScanner provides an iterator for EndorserPvtSimulationResults

type RwsetScanner

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

RwsetScanner helps iterating over results

func (*RwsetScanner) Close

func (scanner *RwsetScanner) Close()

Close releases resource held by the iterator

func (*RwsetScanner) Next

func (scanner *RwsetScanner) Next() (*EndorserPvtSimulationResults, error)

Next moves the iterator to the next key/value pair. It returns <nil, nil> when the iterator is exhausted.

type Store

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

store holds an instance of a levelDB.

func (*Store) GetMinTransientBlkHt

func (s *Store) GetMinTransientBlkHt() (uint64, error)

GetMinTransientBlkHt returns the lowest block height remaining in transient store

func (*Store) GetTxPvtRWSetByTxid

func (s *Store) GetTxPvtRWSetByTxid(txid string, filter ledger.PvtNsCollFilter) (RWSetScanner, error)

GetTxPvtRWSetByTxid returns an iterator due to the fact that the txid may have multiple private write sets persisted from different endorsers.

func (*Store) Persist

func (s *Store) Persist(txid string, blockHeight uint64,
	privateSimulationResultsWithConfig *transientstore.TxPvtReadWriteSetWithConfigInfo) error

Persist stores the private write set of a transaction along with the collection config in the transient store based on txid and the block height the private data was received at

func (*Store) PurgeBelowHeight

func (s *Store) PurgeBelowHeight(maxBlockNumToRetain uint64) error

PurgeBelowHeight removes private write sets at block height lesser than a given maxBlockNumToRetain. In other words, Purge only retains private write sets that were persisted at block height of maxBlockNumToRetain or higher. Though the private write sets stored in transient store is removed by coordinator using PurgebyTxids() after successful block commit, PurgeBelowHeight() is still required to remove orphan entries (as transaction that gets endorsed may not be submitted by the client for commit)

func (*Store) PurgeByTxids

func (s *Store) PurgeByTxids(txids []string) error

PurgeByTxids removes private write sets of a given set of transactions from the transient store. PurgeByTxids() is expected to be called by coordinator after committing a block to ledger.

func (*Store) Shutdown

func (s *Store) Shutdown()

type StoreProvider

type StoreProvider interface {
	OpenStore(ledgerID string) (*Store, error)
	Close()
}

StoreProvider provides an instance of a TransientStore

func NewStoreProvider

func NewStoreProvider(path string) (StoreProvider, error)

NewStoreProvider instantiates TransientStoreProvider

Jump to

Keyboard shortcuts

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