Documentation ¶
Index ¶
- Constants
- type PartialSnapshotIterator
- func (partialItr *PartialSnapshotIterator) GetMetaData() *protos.SyncMetadata
- func (partialItr *PartialSnapshotIterator) GetRawKeyValue() ([]byte, []byte)
- func (partialItr *PartialSnapshotIterator) Next() bool
- func (partialItr *PartialSnapshotIterator) Seek(offset *protos.SyncOffset) error
- func (config PartialSnapshotIterator) Verify(level, startBucket, endBucket int) error
- type RangeScanIterator
- type StateImpl
- func (stateImpl *StateImpl) AddChangesForPersistence(writeBatch *db.DBWriteBatch) error
- func (stateImpl *StateImpl) ApplyPartialSync(syncData *pb.SyncStateChunk) error
- func (stateImpl *StateImpl) ClearWorkingSet(changesPersisted bool)
- func (stateImpl *StateImpl) ComputeCryptoHash() ([]byte, error)
- func (stateImpl *StateImpl) Get(chaincodeID string, key string) ([]byte, error)
- func (stateImpl *StateImpl) GetPartialRangeIterator(snapshot *db.DBSnapshot) (statemgmt.PartialRangeIterator, error)
- func (stateImpl *StateImpl) GetRangeScanIterator(chaincodeID string, startKey string, endKey string) (statemgmt.RangeScanIterator, error)
- func (stateImpl *StateImpl) GetSafe(sn *db.DBSnapshot, chaincodeID string, key string) ([]byte, error)
- func (stateImpl *StateImpl) GetStateSnapshotIterator(snapshot *db.DBSnapshot) (statemgmt.StateSnapshotIterator, error)
- func (stateImpl *StateImpl) InitPartialSync(statehash []byte)
- func (stateImpl *StateImpl) Initialize(configs map[string]interface{}) error
- func (stateImpl *StateImpl) IsCompleted() bool
- func (stateImpl *StateImpl) NewSnapshotState() statemgmt.SnapshotState
- func (stateImpl *StateImpl) PerfHintKeyChanged(chaincodeID string, key string)
- func (stateImpl *StateImpl) PrepareWorkingSet(stateDelta *statemgmt.StateDelta) error
- func (stateImpl *StateImpl) RequiredParts() ([]*pb.SyncOffset, error)
- func (stateImpl *StateImpl) SyncTarget() []byte
- type StateSnapshotIterator
Constants ¶
const ConfigBucketCacheMaxSize = "bucketcachesize"
const ConfigHashFunction = "hashfunction"
ConfigHashFunction - config name 'hashFunction'. This is not exposed in yaml file. This configuration is used for testing with custom hash-function
const ConfigMaxGroupingAtEachLevel = "maxgroupingateachlevel"
ConfigMaxGroupingAtEachLevel - config name 'maxGroupingAtEachLevel' as it appears in yaml file
const ConfigNumBuckets = "numbuckets"
ConfigNumBuckets - config name 'numBuckets' as it appears in yaml file
const ConfigPartialDelta = "syncdelta"
const DefaultMaxGroupingAtEachLevel = 10
DefaultMaxGroupingAtEachLevel - Number of max buckets to group at each level. Grouping is started from left. The last group may have less buckets
const DefaultNumBuckets = 10009
DefaultNumBuckets - total buckets
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PartialSnapshotIterator ¶
type PartialSnapshotIterator struct { StateSnapshotIterator // contains filtered or unexported fields }
func (*PartialSnapshotIterator) GetMetaData ¶
func (partialItr *PartialSnapshotIterator) GetMetaData() *protos.SyncMetadata
func (*PartialSnapshotIterator) GetRawKeyValue ¶
func (partialItr *PartialSnapshotIterator) GetRawKeyValue() ([]byte, []byte)
func (*PartialSnapshotIterator) Next ¶
func (partialItr *PartialSnapshotIterator) Next() bool
overwrite the original GetRawKeyValue and Next
func (*PartialSnapshotIterator) Seek ¶
func (partialItr *PartialSnapshotIterator) Seek(offset *protos.SyncOffset) error
type RangeScanIterator ¶
type RangeScanIterator struct {
// contains filtered or unexported fields
}
RangeScanIterator implements the interface 'statemgmt.RangeScanIterator'
func (*RangeScanIterator) Close ¶
func (itr *RangeScanIterator) Close()
Close - see interface 'statemgmt.RangeScanIterator' for details
func (*RangeScanIterator) GetKeyValue ¶
func (itr *RangeScanIterator) GetKeyValue() (string, []byte)
GetKeyValue - see interface 'statemgmt.RangeScanIterator' for details
func (*RangeScanIterator) Next ¶
func (itr *RangeScanIterator) Next() bool
Next - see interface 'statemgmt.RangeScanIterator' for details
type StateImpl ¶
type StateImpl struct { *db.OpenchainDB // contains filtered or unexported fields }
StateImpl - implements the interface - 'statemgmt.HashableState'
func NewStateImpl ¶
func NewStateImpl(db *db.OpenchainDB) *StateImpl
NewStateImpl constructs a new StateImpl
func (*StateImpl) AddChangesForPersistence ¶
func (stateImpl *StateImpl) AddChangesForPersistence(writeBatch *db.DBWriteBatch) error
AddChangesForPersistence - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) ApplyPartialSync ¶
func (stateImpl *StateImpl) ApplyPartialSync(syncData *pb.SyncStateChunk) error
An PrepareWorkingSet must have been called before, we do this like a calling of ClearWorkingSet(true), verify the delta
func (*StateImpl) ClearWorkingSet ¶
ClearWorkingSet - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) ComputeCryptoHash ¶
ComputeCryptoHash - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) GetPartialRangeIterator ¶
func (stateImpl *StateImpl) GetPartialRangeIterator(snapshot *db.DBSnapshot) (statemgmt.PartialRangeIterator, error)
func (*StateImpl) GetRangeScanIterator ¶
func (stateImpl *StateImpl) GetRangeScanIterator(chaincodeID string, startKey string, endKey string) (statemgmt.RangeScanIterator, error)
GetRangeScanIterator - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) GetStateSnapshotIterator ¶
func (stateImpl *StateImpl) GetStateSnapshotIterator(snapshot *db.DBSnapshot) (statemgmt.StateSnapshotIterator, error)
GetStateSnapshotIterator - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) InitPartialSync ¶
func (*StateImpl) Initialize ¶
Initialize - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) IsCompleted ¶
func (*StateImpl) NewSnapshotState ¶
func (stateImpl *StateImpl) NewSnapshotState() statemgmt.SnapshotState
notice the general snapshotstate is not related to a stateimpl object it just make use of the config in stateimpl for creating
func (*StateImpl) PerfHintKeyChanged ¶
PerfHintKeyChanged - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) PrepareWorkingSet ¶
func (stateImpl *StateImpl) PrepareWorkingSet(stateDelta *statemgmt.StateDelta) error
PrepareWorkingSet - method implementation for interface 'statemgmt.HashableState'
func (*StateImpl) RequiredParts ¶
func (stateImpl *StateImpl) RequiredParts() ([]*pb.SyncOffset, error)
func (*StateImpl) SyncTarget ¶
type StateSnapshotIterator ¶
type StateSnapshotIterator struct {
// contains filtered or unexported fields
}
StateSnapshotIterator implements the interface 'statemgmt.StateSnapshotIterator'
func (*StateSnapshotIterator) Close ¶
func (snapshotItr *StateSnapshotIterator) Close()
Close - see interface 'statemgmt.StateSnapshotIterator' for details
func (*StateSnapshotIterator) GetRawKeyValue ¶
func (snapshotItr *StateSnapshotIterator) GetRawKeyValue() ([]byte, []byte)
GetRawKeyValue - see interface 'statemgmt.StateSnapshotIterator' for details
func (*StateSnapshotIterator) Next ¶
func (snapshotItr *StateSnapshotIterator) Next() bool
Next - see interface 'statemgmt.StateSnapshotIterator' for details
func (*StateSnapshotIterator) Valid ¶
func (snapshotItr *StateSnapshotIterator) Valid() bool