fabric: github.com/hyperledger/fabric/core/transientstore Index | Files

package transientstore

import "github.com/hyperledger/fabric/core/transientstore"

Index

Package Files

store.go store_helper.go

Variables

var (

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

type EndorserPvtSimulationResults Uses

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

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

type RWSetScanner Uses

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 Uses

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

RwsetScanner helps iterating over results

func (*RwsetScanner) Close Uses

func (scanner *RwsetScanner) Close()

Close releases resource held by the iterator

func (*RwsetScanner) Next Uses

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 Uses

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

store holds an instance of a levelDB.

func (*Store) GetMinTransientBlkHt Uses

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

GetMinTransientBlkHt returns the lowest block height remaining in transient store

func (*Store) GetTxPvtRWSetByTxid Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (s *Store) Shutdown()

type StoreProvider Uses

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

StoreProvider provides an instance of a TransientStore

func NewStoreProvider Uses

func NewStoreProvider(path string) (StoreProvider, error)

NewStoreProvider instantiates TransientStoreProvider

Package transientstore imports 12 packages (graph) and is imported by 15 packages. Updated 2019-11-23. Refresh now. Tools for package owners.