Documentation
¶
Index ¶
- Variables
- func Drop(providerPath, ledgerID string) error
- type EndorserPvtSimulationResults
- type KVStore
- func (s *KVStore) AddDbCallsMetrics(f float64)
- func (s *KVStore) DbCallDurationMetric(t time.Duration, lables []string)
- func (s *KVStore) GetMinHeight() (string, float64, error)
- func (s *KVStore) GetTxPvtRWSetByTxidV2(rwsetKeysMap map[string][]ledger.PvtNsCollFilter) (map[string]map[string][]*EndorserPvtSimulationResults, error)
- func (s *KVStore) Persist(txid string, blockHeight uint64, ...) error
- func (s *KVStore) PrivateDataHGetAllBatch(keys map[string]string) (map[string]map[string]string, error)
- func (s *KVStore) ProcessPrivateData(dbKey []byte, dbVal []byte, filter ledger.PvtNsCollFilter) (*EndorserPvtSimulationResults, error)
- func (s *KVStore) PurgeBelowHeight(thresholdHeight uint64) error
- func (s *KVStore) PurgeByTxids(txIds []string) error
- func (s *KVStore) PurgeTxIdsByHeight(height uint64) error
- type KVStoreBatcher
- type KeyValue
- type PendingDeleteStorageList
- func (*PendingDeleteStorageList) Descriptor() ([]byte, []int)
- func (m *PendingDeleteStorageList) GetList() []string
- func (*PendingDeleteStorageList) ProtoMessage()
- func (m *PendingDeleteStorageList) Reset()
- func (m *PendingDeleteStorageList) String() string
- func (m *PendingDeleteStorageList) XXX_DiscardUnknown()
- func (m *PendingDeleteStorageList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PendingDeleteStorageList) XXX_Merge(src proto.Message)
- func (m *PendingDeleteStorageList) XXX_Size() int
- func (m *PendingDeleteStorageList) XXX_Unmarshal(b []byte) error
- type RWSetScanner
- type RwsetScanner
- type Store
- func (s *Store) GetMinTransientBlkHt() (uint64, error)
- func (s *Store) GetTxPvtRWSetByTxid(txid string, filter ledger.PvtNsCollFilter) (RWSetScanner, error)
- func (s *Store) Persist(txid string, blockHeight uint64, ...) error
- func (s *Store) PurgeBelowHeight(maxBlockNumToRetain uint64) error
- func (s *Store) PurgeByTxids(txids []string) error
- func (s *Store) Shutdown()
- type StoreProvider
- type TransientStoreMetrics
Constants ¶
This section is empty.
Variables ¶
var ( // ErrStoreEmpty is used to indicate that there are no entries in transient store ErrStoreEmpty = errors.New("Transient store is empty") )
Functions ¶
func Drop ¶
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 KVStore ¶
type KVStore struct {
// contains filtered or unexported fields
}
store holds an instance of a levelDB.
func (*KVStore) AddDbCallsMetrics ¶
DRUNIX :
"AddDbCallsMetrics": added metrics to record #of db calls made to transient store
func (*KVStore) DbCallDurationMetric ¶
DRUNIX :
"DbCallDurationMetric": added metrics to record the duration of each DB call made to transient store
func (*KVStore) GetMinHeight ¶
DRUNIX Fetch the min block height of the existing CPs
func (*KVStore) GetTxPvtRWSetByTxidV2 ¶
func (s *KVStore) GetTxPvtRWSetByTxidV2(rwsetKeysMap map[string][]ledger.PvtNsCollFilter) (map[string]map[string][]*EndorserPvtSimulationResults, error)
DRUNIX :
"GetTxPvtRWSetByTxidV2": retrives the private data from transient DB.
func (*KVStore) Persist ¶
func (s *KVStore) 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 (*KVStore) PrivateDataHGetAllBatch ¶
func (*KVStore) ProcessPrivateData ¶
func (s *KVStore) ProcessPrivateData(dbKey []byte, dbVal []byte, filter ledger.PvtNsCollFilter) (*EndorserPvtSimulationResults, error)
func (*KVStore) PurgeBelowHeight ¶
DRUNIX To purge the pvt data based on the ledger height after the pvt data max block retention It will be purged by the CP with lowest block height This will cause an edge case if a CP was part of the network and later removed, the minHeight of the CP will be of the removed and txns won't be purged. this can be handled by removing the height of the removed peerId from transient store
func (*KVStore) PurgeByTxids ¶
func (*KVStore) PurgeTxIdsByHeight ¶
DRUNIX :
"PurgeTxIdsByHeight": purge all the transactions pvt data of older blocks from the transient store..
type KVStoreBatcher ¶
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 {
KVStore *KVStore
LitePeerEnabled bool
// contains filtered or unexported fields
}
store holds an instance of a levelDB.
func (*Store) GetMinTransientBlkHt ¶
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 ¶
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 ¶
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.
type StoreProvider ¶
StoreProvider provides an instance of a TransientStore
func NewKVStoreProvider ¶
func NewKVStoreProvider(metrics metrics.Provider) (StoreProvider, error)
NewStoreProvider instantiates TransientStoreProvider
func NewStoreProvider ¶
func NewStoreProvider(path string) (StoreProvider, error)
NewStoreProvider instantiates TransientStoreProvider