Documentation ¶
Index ¶
- func CleanupDB(t testing.TB, dbProvider statedb.VersionedDBProvider)
- type TestVDBEnv
- 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 ¶
Types ¶
type TestVDBEnv ¶
type TestVDBEnv struct { DBProvider statedb.VersionedDBProvider // contains filtered or unexported fields }
testvdbenv提供了一个基于coach-db的版本数据库用于测试
func NewTestVDBEnv ¶
func NewTestVDBEnv(t testing.TB) *TestVDBEnv
newtestvdbenv实例化和新的coach db支持的testvdb
func (*TestVDBEnv) Cleanup ¶
func (env *TestVDBEnv) Cleanup()
Cleanup drops the test couch databases and closes the db provider
type VersionedDB ¶
type VersionedDB struct {
// contains filtered or unexported fields
}
版本数据库实现版本数据库接口
func (*VersionedDB) ApplyUpdates ¶
func (vdb *VersionedDB) ApplyUpdates(updates *statedb.UpdateBatch, height *version.Height) error
ApplyUpdates在VersionedDB接口中实现方法
func (*VersionedDB) BytesKeySupported ¶
func (vdb *VersionedDB) BytesKeySupported() bool
BytesKeySupported在VersionedDB接口中实现方法
func (*VersionedDB) ClearCachedVersions ¶
func (vdb *VersionedDB) ClearCachedVersions()
ClearCachedVersions清除委员会版本和修订号
func (*VersionedDB) ExecuteQuery ¶
func (vdb *VersionedDB) ExecuteQuery(namespace, query string) (statedb.ResultsIterator, error)
ExecuteQuery在VersionedDB接口中实现方法
func (*VersionedDB) ExecuteQueryWithMetadata ¶
func (vdb *VersionedDB) ExecuteQueryWithMetadata(namespace, query string, metadata map[string]interface{}) (statedb.QueryResultsIterator, error)
ExecuteEqueryWithMetadata在VersionedDB接口中实现方法
func (*VersionedDB) GetCachedVersion ¶
getcachedversion从缓存返回版本。`loadcommittedversions`函数填充缓存
func (*VersionedDB) GetLatestSavePoint ¶
func (vdb *VersionedDB) GetLatestSavePoint() (*version.Height, error)
GetLatestSavePoint在VersionedDB接口中实现方法
func (*VersionedDB) GetState ¶
func (vdb *VersionedDB) GetState(namespace string, key string) (*statedb.VersionedValue, error)
GetState在VersionedDB接口中实现方法
func (*VersionedDB) GetStateMultipleKeys ¶
func (vdb *VersionedDB) GetStateMultipleKeys(namespace string, keys []string) ([]*statedb.VersionedValue, error)
GetStateMultipleKeys在VersionedDB接口中实现方法
func (*VersionedDB) GetStateRangeScanIterator ¶
func (vdb *VersionedDB) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (statedb.ResultsIterator, error)
GetStateRangeScanIterator在VersionedDB接口中实现方法 startkey包含在内 endkey是独占的
func (*VersionedDB) GetStateRangeScanIteratorWithMetadata ¶
func (vdb *VersionedDB) GetStateRangeScanIteratorWithMetadata(namespace string, startKey string, endKey string, metadata map[string]interface{}) (statedb.QueryResultsIterator, error)
GetStateRangeScanIteratorWithMetadata在VersionedDB接口中实现方法 startkey包含在内 endkey是独占的 元数据包含其他查询选项的映射
func (*VersionedDB) GetVersion ¶
GetVersion在VersionedDB接口中实现方法
func (*VersionedDB) LoadCommittedVersions ¶
func (vdb *VersionedDB) LoadCommittedVersions(keys []*statedb.CompositeKey) error
加载委托版本将提交的版本和修订号填充到缓存中。 从couchdb进行大容量检索用于填充缓存。 CommittedVersions缓存将用于读取集的状态验证 RevisionNumbers缓存将在提交阶段用于CouchDB批量更新
func (*VersionedDB) ProcessIndexesForChaincodeDeploy ¶
func (vdb *VersionedDB) ProcessIndexesForChaincodeDeploy(namespace string, fileEntries []*ccprovider.TarFileEntry) error
processindexesforchaincodedeploy为指定的命名空间创建索引
func (*VersionedDB) ValidateKeyValue ¶
func (vdb *VersionedDB) ValidateKeyValue(key string, value []byte) error
validateKeyValue在versionedDB接口中实现方法
type VersionedDBProvider ¶
type VersionedDBProvider struct {
// contains filtered or unexported fields
}
versioneddbprovider实现接口versioneddbprovider
func NewVersionedDBProvider ¶
func NewVersionedDBProvider(metricsProvider metrics.Provider) (*VersionedDBProvider, error)
NewVersionedDBProvider实例化VersionedDBProvider
func (*VersionedDBProvider) GetDBHandle ¶
func (provider *VersionedDBProvider) GetDBHandle(dbName string) (statedb.VersionedDB, error)
getdbhandle获取命名数据库的句柄
func (*VersionedDBProvider) HealthCheck ¶
func (provider *VersionedDBProvider) HealthCheck(ctx context.Context) error
健康检查检查同伴的沙发实例是否健康