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 ¶
func DropApplicationDBs(config *ledger.CouchDBConfig) error
DropApplicationDBs drops all application databases.
Types ¶
type CacheValue ¶
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 ¶
func (*CacheValue) Descriptor() ([]byte, []int)
func (*CacheValue) GetAdditionalInfo ¶
func (m *CacheValue) GetAdditionalInfo() []byte
func (*CacheValue) GetMetadata ¶
func (m *CacheValue) GetMetadata() []byte
func (*CacheValue) GetValue ¶
func (m *CacheValue) GetValue() []byte
func (*CacheValue) GetVersion ¶
func (m *CacheValue) GetVersion() []byte
func (*CacheValue) ProtoMessage ¶
func (*CacheValue) ProtoMessage()
func (*CacheValue) Reset ¶
func (m *CacheValue) Reset()
func (*CacheValue) String ¶
func (m *CacheValue) String() string
func (*CacheValue) XXX_DiscardUnknown ¶
func (m *CacheValue) XXX_DiscardUnknown()
func (*CacheValue) XXX_Marshal ¶
func (m *CacheValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CacheValue) XXX_Merge ¶
func (m *CacheValue) XXX_Merge(src proto.Message)
func (*CacheValue) XXX_Size ¶
func (m *CacheValue) XXX_Size() int
func (*CacheValue) XXX_Unmarshal ¶
func (m *CacheValue) XXX_Unmarshal(b []byte) error
type ValueVersionMetadata ¶
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 ¶
func (*ValueVersionMetadata) Descriptor() ([]byte, []int)
func (*ValueVersionMetadata) GetValue ¶
func (m *ValueVersionMetadata) GetValue() []byte
func (*ValueVersionMetadata) GetVersionAndMetadata ¶
func (m *ValueVersionMetadata) GetVersionAndMetadata() []byte
func (*ValueVersionMetadata) ProtoMessage ¶
func (*ValueVersionMetadata) ProtoMessage()
func (*ValueVersionMetadata) Reset ¶
func (m *ValueVersionMetadata) Reset()
func (*ValueVersionMetadata) String ¶
func (m *ValueVersionMetadata) String() string
func (*ValueVersionMetadata) XXX_DiscardUnknown ¶
func (m *ValueVersionMetadata) XXX_DiscardUnknown()
func (*ValueVersionMetadata) XXX_Marshal ¶
func (m *ValueVersionMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValueVersionMetadata) XXX_Merge ¶
func (m *ValueVersionMetadata) XXX_Merge(src proto.Message)
func (*ValueVersionMetadata) XXX_Size ¶
func (m *ValueVersionMetadata) XXX_Size() int
func (*ValueVersionMetadata) XXX_Unmarshal ¶
func (m *ValueVersionMetadata) XXX_Unmarshal(b []byte) error
type VersionAndMetadata ¶
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 ¶
func (*VersionAndMetadata) Descriptor() ([]byte, []int)
func (*VersionAndMetadata) GetMetadata ¶
func (m *VersionAndMetadata) GetMetadata() []byte
func (*VersionAndMetadata) GetVersion ¶
func (m *VersionAndMetadata) GetVersion() []byte
func (*VersionAndMetadata) ProtoMessage ¶
func (*VersionAndMetadata) ProtoMessage()
func (*VersionAndMetadata) Reset ¶
func (m *VersionAndMetadata) Reset()
func (*VersionAndMetadata) String ¶
func (m *VersionAndMetadata) String() string
func (*VersionAndMetadata) XXX_DiscardUnknown ¶
func (m *VersionAndMetadata) XXX_DiscardUnknown()
func (*VersionAndMetadata) XXX_Marshal ¶
func (m *VersionAndMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VersionAndMetadata) XXX_Merge ¶
func (m *VersionAndMetadata) XXX_Merge(src proto.Message)
func (*VersionAndMetadata) XXX_Size ¶
func (m *VersionAndMetadata) XXX_Size() int
func (*VersionAndMetadata) XXX_Unmarshal ¶
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 ¶
func (vdb *VersionedDB) BytesKeySupported() bool
BytesKeySupported implements method in VersionvdbedDB interface
func (*VersionedDB) ClearCachedVersions ¶
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 ¶
func (vdb *VersionedDB) ExecuteQueryWithPagination(namespace, query, bookmark string, pageSize int32) (statedb.QueryResultsIterator, error)
ExecuteQueryWithPagination implements method in VersionedDB interface
func (*VersionedDB) GetCachedVersion ¶
GetCachedVersion returns version from cache. `LoadCommittedVersions` function populates the cache
func (*VersionedDB) GetDBType ¶
func (vdb *VersionedDB) GetDBType() string
GetDBType returns the hosted stateDB
func (*VersionedDB) GetFullScanIterator ¶
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 ¶
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 ¶
GetVersion implements method in VersionedDB interface
func (*VersionedDB) LoadCommittedVersions ¶
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 ¶
func (vdb *VersionedDB) ProcessIndexesForChaincodeDeploy(namespace string, indexFilesData map[string][]byte) error
ProcessIndexesForChaincodeDeploy creates indexes for a specified namespace
func (*VersionedDB) ValidateKeyValue ¶
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 ¶
func (provider *VersionedDBProvider) HealthCheck(ctx context.Context) error
HealthCheck checks to see if the couch instance of the peer is healthy