Documentation ¶
Index ¶
- func NewMetaDataPool(metaBlocks storage.Cacher, ...) (*metaDataPool, error)
- func NewNonceSyncMapCacher(cacher storage.Cacher, nonceConverter typeConverters.Uint64ByteSliceConverter) (*nonceSyncMapCacher, error)
- func NewShardedDataPool(transactions dataRetriever.ShardedDataCacherNotifier, ...) (*shardedDataPool, error)
- type ShardIdHashSyncMap
- func (sihsm *ShardIdHashSyncMap) Delete(shardId uint32)
- func (sihsm *ShardIdHashSyncMap) IsInterfaceNil() bool
- func (sihsm *ShardIdHashSyncMap) Load(shardId uint32) ([]byte, bool)
- func (sihsm *ShardIdHashSyncMap) Range(f func(shardId uint32, hash []byte) bool)
- func (sihsm *ShardIdHashSyncMap) Store(shardId uint32, hash []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetaDataPool ¶ added in v1.0.3
func NewMetaDataPool( metaBlocks storage.Cacher, miniBlockHashes dataRetriever.ShardedDataCacherNotifier, shardHeaders storage.Cacher, headersNonces dataRetriever.Uint64SyncMapCacher, ) (*metaDataPool, error)
NewMetaDataPool creates a data pools holder object
func NewNonceSyncMapCacher ¶ added in v1.0.11
func NewNonceSyncMapCacher( cacher storage.Cacher, nonceConverter typeConverters.Uint64ByteSliceConverter, ) (*nonceSyncMapCacher, error)
NewNonceSyncMapCacher returns a new instance of nonceSyncMapCacher
func NewShardedDataPool ¶ added in v1.0.3
func NewShardedDataPool( transactions dataRetriever.ShardedDataCacherNotifier, unsignedTransactions dataRetriever.ShardedDataCacherNotifier, headers storage.Cacher, headersNonces dataRetriever.Uint64SyncMapCacher, miniBlocks storage.Cacher, peerChangesBlocks storage.Cacher, metaBlocks storage.Cacher, ) (*shardedDataPool, error)
NewShardedDataPool creates a data pools holder object
Types ¶
type ShardIdHashSyncMap ¶ added in v1.0.11
type ShardIdHashSyncMap struct {
// contains filtered or unexported fields
}
ShardIdHashSyncMap is a simple wrapper over a sync map that has specialized methods for load, store, range and so on
func (*ShardIdHashSyncMap) Delete ¶ added in v1.0.11
func (sihsm *ShardIdHashSyncMap) Delete(shardId uint32)
Delete deletes the value for a key.
func (*ShardIdHashSyncMap) IsInterfaceNil ¶ added in v1.0.16
func (sihsm *ShardIdHashSyncMap) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardIdHashSyncMap) Load ¶ added in v1.0.11
func (sihsm *ShardIdHashSyncMap) Load(shardId uint32) ([]byte, bool)
Load returns the hash stored in the map for a shardId, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*ShardIdHashSyncMap) Range ¶ added in v1.0.11
func (sihsm *ShardIdHashSyncMap) Range(f func(shardId uint32, hash []byte) bool)
Range calls f sequentially for each shardId and hash present in the map. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.
func (*ShardIdHashSyncMap) Store ¶ added in v1.0.11
func (sihsm *ShardIdHashSyncMap) Store(shardId uint32, hash []byte)
Store sets the hash for a shardId.