transientstore

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 12 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

This section is empty.

Types

type EndorserPvtSimulationResults

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

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

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