Documentation ¶
Index ¶
- func CleanupDB(t testing.TB, dbProvider statedb.VersionedDBProvider)
- type VersionedDB
- func (vdb *VersionedDB) ApplyUpdates(updates *statedb.UpdateBatch, height *version.Height) error
- func (vdb *VersionedDB) BytesKeySupported() bool
- func (vdb *VersionedDB) ClearCachedVersions()
- func (vdb *VersionedDB) Close()
- func (vdb *VersionedDB) ExecuteQuery(namespace, query string) (statedb.ResultsIterator, error)
- func (vdb *VersionedDB) ExecuteQueryWithMetadata(namespace, query string, metadata map[string]interface{}) (statedb.QueryResultsIterator, error)
- func (vdb *VersionedDB) GetCachedVersion(namespace string, key string) (*version.Height, bool)
- func (vdb *VersionedDB) GetDBType() string
- func (vdb *VersionedDB) GetLatestSavePoint() (*version.Height, error)
- func (vdb *VersionedDB) GetState(namespace string, key string) (*statedb.VersionedValue, error)
- func (vdb *VersionedDB) GetStateMultipleKeys(namespace string, keys []string) ([]*statedb.VersionedValue, error)
- func (vdb *VersionedDB) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (statedb.ResultsIterator, error)
- func (vdb *VersionedDB) GetStateRangeScanIteratorWithMetadata(namespace string, startKey string, endKey string, ...) (statedb.QueryResultsIterator, error)
- func (vdb *VersionedDB) GetVersion(namespace string, key string) (*version.Height, error)
- func (vdb *VersionedDB) LoadCommittedVersions(keys []*statedb.CompositeKey) error
- func (vdb *VersionedDB) Open() error
- func (vdb *VersionedDB) ProcessIndexesForChaincodeDeploy(namespace string, fileEntries []*ccprovider.TarFileEntry) error
- func (vdb *VersionedDB) ValidateKeyValue(key string, value []byte) error
- type VersionedDBProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupDB ¶ added in v1.1.0
func CleanupDB(t testing.TB, dbProvider statedb.VersionedDBProvider)
CleanupDB deletes all the databases other than fabric internal database
Types ¶
type VersionedDB ¶
type VersionedDB struct {
// contains filtered or unexported fields
}
VersionedDB implements VersionedDB interface
func (*VersionedDB) ApplyUpdates ¶
func (vdb *VersionedDB) ApplyUpdates(updates *statedb.UpdateBatch, height *version.Height) error
ApplyUpdates implements method in VersionedDB interface
func (*VersionedDB) BytesKeySupported ¶ added in v1.4.0
func (vdb *VersionedDB) BytesKeySupported() bool
BytesKeySupported implements method in VersionvdbedDB interface
func (*VersionedDB) ClearCachedVersions ¶ added in v1.1.0
func (vdb *VersionedDB) ClearCachedVersions()
ClearCachedVersions clears committedVersions and revisionNumbers
func (*VersionedDB) Close ¶
func (vdb *VersionedDB) Close()
Close implements method in VersionedDB interface
func (*VersionedDB) ExecuteQuery ¶
func (vdb *VersionedDB) ExecuteQuery(namespace, query string) (statedb.ResultsIterator, error)
ExecuteQuery implements method in VersionedDB interface
func (*VersionedDB) ExecuteQueryWithMetadata ¶ added in v1.3.0
func (vdb *VersionedDB) ExecuteQueryWithMetadata(namespace, query string, metadata map[string]interface{}) (statedb.QueryResultsIterator, error)
ExecuteQueryWithMetadata implements method in VersionedDB interface
func (*VersionedDB) GetCachedVersion ¶ added in v1.1.0
GetCachedVersion returns version from cache. `LoadCommittedVersions` function populates the cache
func (*VersionedDB) GetDBType ¶ added in v1.2.0
func (vdb *VersionedDB) GetDBType() string
GetDBType returns the hosted stateDB
func (*VersionedDB) GetLatestSavePoint ¶
func (vdb *VersionedDB) GetLatestSavePoint() (*version.Height, error)
GetLatestSavePoint implements method in VersionedDB interface
func (*VersionedDB) GetState ¶
func (vdb *VersionedDB) GetState(namespace string, key string) (*statedb.VersionedValue, error)
GetState implements method in VersionedDB interface
func (*VersionedDB) GetStateMultipleKeys ¶
func (vdb *VersionedDB) GetStateMultipleKeys(namespace string, keys []string) ([]*statedb.VersionedValue, error)
GetStateMultipleKeys implements method in VersionedDB interface
func (*VersionedDB) GetStateRangeScanIterator ¶
func (vdb *VersionedDB) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (statedb.ResultsIterator, error)
GetStateRangeScanIterator implements method in VersionedDB interface startKey is inclusive endKey is exclusive
func (*VersionedDB) GetStateRangeScanIteratorWithMetadata ¶ added in v1.3.0
func (vdb *VersionedDB) GetStateRangeScanIteratorWithMetadata(namespace string, startKey string, endKey string, metadata map[string]interface{}) (statedb.QueryResultsIterator, error)
GetStateRangeScanIteratorWithMetadata implements method in VersionedDB interface startKey is inclusive endKey is exclusive metadata contains a map of additional query options
func (*VersionedDB) GetVersion ¶ added in v1.1.0
GetVersion implements method in VersionedDB interface
func (*VersionedDB) LoadCommittedVersions ¶ added in v1.1.0
func (vdb *VersionedDB) LoadCommittedVersions(keys []*statedb.CompositeKey) error
LoadCommittedVersions populates committedVersions and revisionNumbers into cache. A bulk retrieve from couchdb is used to populate the cache. committedVersions cache will be used for state validation of readsets revisionNumbers cache will be used during commit phase for couchdb bulk updates
func (*VersionedDB) Open ¶
func (vdb *VersionedDB) Open() error
Open implements method in VersionedDB interface
func (*VersionedDB) ProcessIndexesForChaincodeDeploy ¶ added in v1.2.0
func (vdb *VersionedDB) ProcessIndexesForChaincodeDeploy(namespace string, fileEntries []*ccprovider.TarFileEntry) error
ProcessIndexesForChaincodeDeploy creates indexes for a specified namespace
func (*VersionedDB) ValidateKeyValue ¶ added in v1.1.0
func (vdb *VersionedDB) ValidateKeyValue(key string, value []byte) error
ValidateKeyValue implements method in VersionedDB interface
type VersionedDBProvider ¶
type VersionedDBProvider struct {
// contains filtered or unexported fields
}
VersionedDBProvider implements interface VersionedDBProvider
func NewVersionedDBProvider ¶
func NewVersionedDBProvider(config *couchdb.Config, metricsProvider metrics.Provider, cache *statedb.Cache) (*VersionedDBProvider, error)
NewVersionedDBProvider instantiates VersionedDBProvider
func (*VersionedDBProvider) Close ¶
func (provider *VersionedDBProvider) Close()
Close closes the underlying db instance
func (*VersionedDBProvider) GetDBHandle ¶
func (provider *VersionedDBProvider) GetDBHandle(dbName string) (statedb.VersionedDB, error)
GetDBHandle gets the handle to a named database
func (*VersionedDBProvider) HealthCheck ¶ added in v1.4.1
func (provider *VersionedDBProvider) HealthCheck(ctx context.Context) error
HealthCheck checks to see if the couch instance of the peer is healthy