statecouchdb

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

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.

func IsEmpty added in v1.5.6

func IsEmpty(t testing.TB, config *ledger.CouchDBConfig) bool

IsEmpty returns whether or not the couchdb is empty

func StartCouchDB added in v1.5.6

func StartCouchDB(t *testing.T, binds []string) (addr string, stopCouchDBFunc func())

StartCouchDB starts the CouchDB if it is not running already

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

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

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

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

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

Jump to

Keyboard shortcuts

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