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 test_exports.go

Variables

var ErrStoreEmpty = errors.New("Transient store is empty")

ErrStoreEmpty is used to indicate that there are no entries in transient store

func GetTransientStorePath Uses

func GetTransientStorePath() string

GetTransientStorePath returns the filesystem path for temporarily storing the private rwset

type EndorserPvtSimulationResults Uses

type EndorserPvtSimulationResults struct {
    ReceivedAtBlockHeight uint64
    PvtSimulationResults  *rwset.TxPvtReadWriteSet
}

EndorserPvtSimulationResults captures the details of the simulation results specific to an endorser TODO: Once the related gossip changes are made as per FAB-5096, remove this struct

type EndorserPvtSimulationResultsWithConfig Uses

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

EndorserPvtSimulationResultsWithConfig 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)
    // NextWithConfig returns the next EndorserPvtSimulationResultsWithConfig from the RWSetScanner.
    // It may return nil, nil when it has no further data, and also may return an error
    // on failure
    // TODO: Once the related gossip changes are made as per FAB-5096, remove the above function
    // and rename the below function to Next form NextWithConfig.
    NextWithConfig() (*EndorserPvtSimulationResultsWithConfig, 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
}

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 whether the iterator is exhausted. TODO: Once the related gossip changes are made as per FAB-5096, remove this function

func (*RwsetScanner) NextWithConfig Uses

func (scanner *RwsetScanner) NextWithConfig() (*EndorserPvtSimulationResultsWithConfig, error)

Next moves the iterator to the next key/value pair. It returns whether the iterator is exhausted. TODO: Once the related gossip changes are made as per FAB-5096, rename this function to Next

type Store Uses

type Store interface {
    // Persist stores the private write set of a transaction in the transient store
    // based on txid and the block height the private data was received at
    Persist(txid string, blockHeight uint64, privateSimulationResults *rwset.TxPvtReadWriteSet) error
    // TODO: Once the related gossip changes are made as per FAB-5096, remove the above function
    // and rename the below function to Persist form PersistWithConfig.
    // PersistWithConfig 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
    PersistWithConfig(txid string, blockHeight uint64, privateSimulationResultsWithConfig *transientstore.TxPvtReadWriteSetWithConfigInfo) error
    // GetTxPvtRWSetByTxid returns an iterator due to the fact that the txid may have multiple private
    // write sets persisted from different endorsers (via Gossip)
    GetTxPvtRWSetByTxid(txid string, filter ledger.PvtNsCollFilter) (RWSetScanner, error)
    // PurgeByTxids removes private write sets of a given set of transactions from the
    // transient store
    PurgeByTxids(txids []string) error
    // PurgeByHeight 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, PurgeByHeight() is still required to remove orphan entries (as
    // transaction that gets endorsed may not be submitted by the client for commit)
    PurgeByHeight(maxBlockNumToRetain uint64) error
    // GetMinTransientBlkHt returns the lowest block height remaining in transient store
    GetMinTransientBlkHt() (uint64, error)
    Shutdown()
}

Store manages the storage of private write sets for a ledgerId. Ideally, a ledger can remove the data from this storage when it is committed to the permanent storage or the pruning of some data items is enforced by the policy

type StoreEnv Uses

type StoreEnv struct {
    TestStoreProvider StoreProvider
    TestStore         Store
    // contains filtered or unexported fields
}

StoreEnv provides the store env for testing

func NewTestStoreEnv Uses

func NewTestStoreEnv(t *testing.T) *StoreEnv

NewTestStoreEnv construct a StoreEnv for testing

func (*StoreEnv) Cleanup Uses

func (env *StoreEnv) Cleanup()

Cleanup cleansup the store env after testing

type StoreProvider Uses

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

StoreProvider provides an instance of a TransientStore

func NewStoreProvider Uses

func NewStoreProvider() StoreProvider

NewStoreProvider instantiates TransientStoreProvider

Package transientstore imports 17 packages (graph) and is imported by 7 packages. Updated 2019-07-22. Refresh now. Tools for package owners.