statecouchdb

package
v0.0.0-...-523a819 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupDB

func CleanupDB(t testing.TB, dbProvider statedb.VersionedDBProvider)

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) Close

func (vdb *VersionedDB) Close()

Close在VersionedDB接口中实现方法

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

func (vdb *VersionedDB) GetCachedVersion(namespace string, key string) (*version.Height, bool)

getcachedversion从缓存返回版本。`loadcommittedversions`函数填充缓存

func (*VersionedDB) GetDBType

func (vdb *VersionedDB) GetDBType() string

GetDBType返回托管的StateDB

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

func (vdb *VersionedDB) GetVersion(namespace string, key string) (*version.Height, error)

GetVersion在VersionedDB接口中实现方法

func (*VersionedDB) LoadCommittedVersions

func (vdb *VersionedDB) LoadCommittedVersions(keys []*statedb.CompositeKey) error

加载委托版本将提交的版本和修订号填充到缓存中。 从couchdb进行大容量检索用于填充缓存。 CommittedVersions缓存将用于读取集的状态验证 RevisionNumbers缓存将在提交阶段用于CouchDB批量更新

func (*VersionedDB) Open

func (vdb *VersionedDB) Open() error

在版本数据库接口中打开实现方法

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) Close

func (provider *VersionedDBProvider) Close()

关闭关闭基础数据库实例

func (*VersionedDBProvider) GetDBHandle

func (provider *VersionedDBProvider) GetDBHandle(dbName string) (statedb.VersionedDB, error)

getdbhandle获取命名数据库的句柄

func (*VersionedDBProvider) HealthCheck

func (provider *VersionedDBProvider) HealthCheck(ctx context.Context) error

健康检查检查同伴的沙发实例是否健康

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL