Documentation
¶
Index ¶
- func DropApplicationDBs(config *ledger.CouchDBConfig) error
- func IsEmpty(t testing.TB, config *ledger.CouchDBConfig) bool
- func StartCouchDB(t *testing.T, binds []string) (addr string, stopCouchDBFunc func())
- type CacheValue
- func (*CacheValue) Descriptor() ([]byte, []int)
- func (m *CacheValue) GetAdditionalInfo() []byte
- func (m *CacheValue) GetMetadata() []byte
- func (m *CacheValue) GetValue() []byte
- func (m *CacheValue) GetVersion() []byte
- func (*CacheValue) ProtoMessage()
- func (m *CacheValue) Reset()
- func (m *CacheValue) String() string
- func (m *CacheValue) XXX_DiscardUnknown()
- func (m *CacheValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CacheValue) XXX_Merge(src proto.Message)
- func (m *CacheValue) XXX_Size() int
- func (m *CacheValue) XXX_Unmarshal(b []byte) error
- type ValueVersionMetadata
- func (*ValueVersionMetadata) Descriptor() ([]byte, []int)
- func (m *ValueVersionMetadata) GetValue() []byte
- func (m *ValueVersionMetadata) GetVersionAndMetadata() []byte
- func (*ValueVersionMetadata) ProtoMessage()
- func (m *ValueVersionMetadata) Reset()
- func (m *ValueVersionMetadata) String() string
- func (m *ValueVersionMetadata) XXX_DiscardUnknown()
- func (m *ValueVersionMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValueVersionMetadata) XXX_Merge(src proto.Message)
- func (m *ValueVersionMetadata) XXX_Size() int
- func (m *ValueVersionMetadata) XXX_Unmarshal(b []byte) error
- type VersionAndMetadata
- func (*VersionAndMetadata) Descriptor() ([]byte, []int)
- func (m *VersionAndMetadata) GetMetadata() []byte
- func (m *VersionAndMetadata) GetVersion() []byte
- func (*VersionAndMetadata) ProtoMessage()
- func (m *VersionAndMetadata) Reset()
- func (m *VersionAndMetadata) String() string
- func (m *VersionAndMetadata) XXX_DiscardUnknown()
- func (m *VersionAndMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VersionAndMetadata) XXX_Merge(src proto.Message)
- func (m *VersionAndMetadata) XXX_Size() int
- func (m *VersionAndMetadata) XXX_Unmarshal(b []byte) error
- 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) ExecuteQueryWithPagination(namespace, query, bookmark string, pageSize int32) (statedb.QueryResultsIterator, error)
- func (vdb *VersionedDB) GetCachedVersion(namespace string, key string) (*version.Height, bool)
- func (vdb *VersionedDB) GetDBType() string
- func (vdb *VersionedDB) GetFullScanIterator(skipNamespace func(string) bool) (statedb.FullScanIterator, byte, error)
- 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) GetStateRangeScanIteratorWithPagination(namespace string, startKey string, endKey string, pageSize int32) (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, indexFilesData map[string][]byte) error
- func (vdb *VersionedDB) ValidateKeyValue(key string, value []byte) error
- type VersionedDBProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropApplicationDBs ¶ added in v1.5.6
func DropApplicationDBs(config *ledger.CouchDBConfig) error
DropApplicationDBs drops all application databases.
Types ¶
type CacheValue ¶ added in v1.5.6
type CacheValue struct { Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` AdditionalInfo []byte `protobuf:"bytes,4,opt,name=additional_info,json=additionalInfo,proto3" json:"additional_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CacheValue) Descriptor ¶ added in v1.5.6
func (*CacheValue) Descriptor() ([]byte, []int)
func (*CacheValue) GetAdditionalInfo ¶ added in v1.5.6
func (m *CacheValue) GetAdditionalInfo() []byte
func (*CacheValue) GetMetadata ¶ added in v1.5.6
func (m *CacheValue) GetMetadata() []byte
func (*CacheValue) GetValue ¶ added in v1.5.6
func (m *CacheValue) GetValue() []byte
func (*CacheValue) GetVersion ¶ added in v1.5.6
func (m *CacheValue) GetVersion() []byte
func (*CacheValue) ProtoMessage ¶ added in v1.5.6
func (*CacheValue) ProtoMessage()
func (*CacheValue) Reset ¶ added in v1.5.6
func (m *CacheValue) Reset()
func (*CacheValue) String ¶ added in v1.5.6
func (m *CacheValue) String() string
func (*CacheValue) XXX_DiscardUnknown ¶ added in v1.5.6
func (m *CacheValue) XXX_DiscardUnknown()
func (*CacheValue) XXX_Marshal ¶ added in v1.5.6
func (m *CacheValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CacheValue) XXX_Merge ¶ added in v1.5.6
func (m *CacheValue) XXX_Merge(src proto.Message)
func (*CacheValue) XXX_Size ¶ added in v1.5.6
func (m *CacheValue) XXX_Size() int
func (*CacheValue) XXX_Unmarshal ¶ added in v1.5.6
func (m *CacheValue) XXX_Unmarshal(b []byte) error
type ValueVersionMetadata ¶ added in v1.5.6
type ValueVersionMetadata struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` VersionAndMetadata []byte `protobuf:"bytes,2,opt,name=version_and_metadata,json=versionAndMetadata,proto3" json:"version_and_metadata,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ValueVersionMetadata) Descriptor ¶ added in v1.5.6
func (*ValueVersionMetadata) Descriptor() ([]byte, []int)
func (*ValueVersionMetadata) GetValue ¶ added in v1.5.6
func (m *ValueVersionMetadata) GetValue() []byte
func (*ValueVersionMetadata) GetVersionAndMetadata ¶ added in v1.5.6
func (m *ValueVersionMetadata) GetVersionAndMetadata() []byte
func (*ValueVersionMetadata) ProtoMessage ¶ added in v1.5.6
func (*ValueVersionMetadata) ProtoMessage()
func (*ValueVersionMetadata) Reset ¶ added in v1.5.6
func (m *ValueVersionMetadata) Reset()
func (*ValueVersionMetadata) String ¶ added in v1.5.6
func (m *ValueVersionMetadata) String() string
func (*ValueVersionMetadata) XXX_DiscardUnknown ¶ added in v1.5.6
func (m *ValueVersionMetadata) XXX_DiscardUnknown()
func (*ValueVersionMetadata) XXX_Marshal ¶ added in v1.5.6
func (m *ValueVersionMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValueVersionMetadata) XXX_Merge ¶ added in v1.5.6
func (m *ValueVersionMetadata) XXX_Merge(src proto.Message)
func (*ValueVersionMetadata) XXX_Size ¶ added in v1.5.6
func (m *ValueVersionMetadata) XXX_Size() int
func (*ValueVersionMetadata) XXX_Unmarshal ¶ added in v1.5.6
func (m *ValueVersionMetadata) XXX_Unmarshal(b []byte) error
type VersionAndMetadata ¶ added in v1.5.6
type VersionAndMetadata struct { Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*VersionAndMetadata) Descriptor ¶ added in v1.5.6
func (*VersionAndMetadata) Descriptor() ([]byte, []int)
func (*VersionAndMetadata) GetMetadata ¶ added in v1.5.6
func (m *VersionAndMetadata) GetMetadata() []byte
func (*VersionAndMetadata) GetVersion ¶ added in v1.5.6
func (m *VersionAndMetadata) GetVersion() []byte
func (*VersionAndMetadata) ProtoMessage ¶ added in v1.5.6
func (*VersionAndMetadata) ProtoMessage()
func (*VersionAndMetadata) Reset ¶ added in v1.5.6
func (m *VersionAndMetadata) Reset()
func (*VersionAndMetadata) String ¶ added in v1.5.6
func (m *VersionAndMetadata) String() string
func (*VersionAndMetadata) XXX_DiscardUnknown ¶ added in v1.5.6
func (m *VersionAndMetadata) XXX_DiscardUnknown()
func (*VersionAndMetadata) XXX_Marshal ¶ added in v1.5.6
func (m *VersionAndMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VersionAndMetadata) XXX_Merge ¶ added in v1.5.6
func (m *VersionAndMetadata) XXX_Merge(src proto.Message)
func (*VersionAndMetadata) XXX_Size ¶ added in v1.5.6
func (m *VersionAndMetadata) XXX_Size() int
func (*VersionAndMetadata) XXX_Unmarshal ¶ added in v1.5.6
func (m *VersionAndMetadata) XXX_Unmarshal(b []byte) error
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) ExecuteQueryWithPagination ¶ added in v1.5.6
func (vdb *VersionedDB) ExecuteQueryWithPagination(namespace, query, bookmark string, pageSize int32) (statedb.QueryResultsIterator, error)
ExecuteQueryWithPagination 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) GetFullScanIterator ¶ added in v1.5.6
func (vdb *VersionedDB) GetFullScanIterator(skipNamespace func(string) bool) (statedb.FullScanIterator, byte, error)
GetFullScanIterator implements method in VersionedDB interface. This function returns a FullScanIterator that can be used to iterate over entire data in the statedb for a channel. `skipNamespace` parameter can be used to control if the consumer wants the FullScanIterator to skip one or more namespaces from the returned results.
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) GetStateRangeScanIteratorWithPagination ¶ added in v1.5.6
func (vdb *VersionedDB) GetStateRangeScanIteratorWithPagination(namespace string, startKey string, endKey string, pageSize int32) (statedb.QueryResultsIterator, error)
GetStateRangeScanIteratorWithPagination implements method in VersionedDB interface startKey is inclusive endKey is exclusive pageSize limits the number of results returned
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, indexFilesData map[string][]byte) 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 *ledger.CouchDBConfig, metricsProvider metrics.Provider, sysNamespaces []string) (*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, nsProvider statedb.NamespaceProvider) (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