Versions in this module Expand all Collapse all v1 v1.1.66 Jun 17, 2021 v1.1.65 Jun 17, 2021 Changes in this version + var ErrBootstrapDataNotFoundInStorage = errors.New("didn't find any bootstrap data in storage") + var ErrCacheCapacityInvalid = errors.New("cache capacity is less than 1") + var ErrCacheSizeInvalid = errors.New("cache size is less than 1") + var ErrCacheSizeIsLowerThanBatchSize = errors.New("cache size is lower than batch size") + var ErrClosingPersisters = errors.New("cannot close all the persisters") + var ErrDestroyingUnit = errors.New("destroy unit didn't remove all the persisters") + var ErrEmptyKey = errors.New("key is empty") + var ErrEmptyPruningPathTemplate = errors.New("empty path template for pruning storers") + var ErrEmptyStaticPathTemplate = errors.New("empty path template for static storers") + var ErrFailedCacheEviction = errors.New("failed eviction within cache") + var ErrImmuneItemsCapacityReached = errors.New("capacity reached for immune items") + var ErrInvalidBatch = errors.New("batch is invalid") + var ErrInvalidConfig = errors.New("invalid config") + var ErrInvalidNumOpenFiles = errors.New("maxOpenFiles is invalid") + var ErrInvalidNumberOfActivePersisters = errors.New("invalid number of active persisters") + var ErrInvalidNumberOfEpochsToSave = errors.New("invalid number of epochs to save") + var ErrInvalidNumberOfPersisters = errors.New("invalid number of active persisters") + var ErrInvalidPruningPathTemplate = errors.New("invalid path template for pruning storers") + var ErrInvalidStaticPathTemplate = errors.New("invalid path template for static storers") + var ErrItemAlreadyInCache = errors.New("item already in cache") + var ErrKeyNotFound = errors.New("key not found") + var ErrLRUCacheInvalidSize = errors.New("wrong size in bytes value for LRU cache") + var ErrLRUCacheWithProvidedSize = errors.New("LRU cache does not support size in bytes") + var ErrNegativeSizeInBytes = errors.New("negative size in bytes") + var ErrNilBloomFilter = errors.New("expected not nil bloom filter") + var ErrNilCacher = errors.New("expected not nil cacher") + var ErrNilConfig = errors.New("nil config") + var ErrNilEpochStartNotifier = errors.New("nil epoch start notifier") + var ErrNilMarshalizer = errors.New("nil marshalizer") + var ErrNilPathManager = errors.New("nil path manager") + var ErrNilPersister = errors.New("expected not nil persister") + var ErrNilPersisterFactory = errors.New("nil persister factory") + var ErrNilShardCoordinator = errors.New("nil shard coordinator") + var ErrNilTimeCache = errors.New("nil time cache") + var ErrNilTxGasHandler = errors.New("nil tx gas handler") + var ErrNotSupportedCacheType = errors.New("not supported cache type") + var ErrNotSupportedDBType = errors.New("not supported db type") + var ErrNotSupportedHashType = errors.New("hash type not supported") + var ErrSerialDBIsClosed = errors.New("serialDB is closed") + var ErrWrongTypeAssertion = errors.New("wrong type assertion") + func MonitorNewCache(tag string, sizeInBytes uint64) + type Batcher interface + Delete func(key []byte) error + Get func(key []byte) []byte + IsInterfaceNil func() bool + Put func(key []byte, val []byte) error + Reset func() + type BloomFilter interface + Add func([]byte) + Clear func() + IsInterfaceNil func() bool + MayContain func([]byte) bool + type Cacher interface + Clear func() + Get func(key []byte) (value interface{}, ok bool) + Has func(key []byte) bool + HasOrAdd func(key []byte, value interface{}, sizeInBytes int) (has, added bool) + IsInterfaceNil func() bool + Keys func() [][]byte + Len func() int + MaxSize func() int + Peek func(key []byte) (value interface{}, ok bool) + Put func(key []byte, value interface{}, sizeInBytes int) (evicted bool) + RegisterHandler func(handler func(key []byte, value interface{}), id string) + Remove func(key []byte) + SizeInBytesContained func() uint64 + UnRegisterHandler func(id string) + type DirectoryReaderHandler interface + IsInterfaceNil func() bool + ListAllAsString func(directoryPath string) ([]string, error) + ListDirectoriesAsString func(directoryPath string) ([]string, error) + ListFilesAsString func(directoryPath string) ([]string, error) + type EpochStartNotifier interface + IsInterfaceNil func() bool + RegisterHandler func(handler epochStart.ActionHandler) + type ForEachItem func(key []byte, value interface{}) + type LRUCacheHandler interface + Add func(key, value interface{}) bool + Contains func(key interface{}) (ok bool) + ContainsOrAdd func(key, value interface{}) (ok, evicted bool) + Get func(key interface{}) (value interface{}, ok bool) + Keys func() []interface{} + Len func() int + Peek func(key interface{}) (value interface{}, ok bool) + Purge func() + Remove func(key interface{}) bool + type LatestDataFromStorage struct + Epoch uint32 + EpochStartRound uint64 + LastRound int64 + ShardID uint32 + type LatestStorageDataProviderHandler interface + Get func() (LatestDataFromStorage, error) + GetParentDirAndLastEpoch func() (string, uint32, error) + GetShardsFromDirectory func(path string) ([]string, error) + IsInterfaceNil func() bool + type PathManagerHandler interface + IsInterfaceNil func() bool + PathForEpoch func(shardId string, epoch uint32, identifier string) string + PathForStatic func(shardId string, identifier string) string + type Persister interface + Close func() error + Destroy func() error + DestroyClosed func() error + Get func(key []byte) ([]byte, error) + Has func(key []byte) error + Init func() error + IsInterfaceNil func() bool + Put func(key, val []byte) error + RangeKeys func(handler func(key []byte, val []byte) bool) + Remove func(key []byte) error + type PersisterFactory interface + Create func(path string) (Persister, error) + IsInterfaceNil func() bool + type ShardCoordinator interface + CommunicationIdentifier func(destShardID uint32) string + ComputeId func(address []byte) uint32 + IsInterfaceNil func() bool + NumberOfShards func() uint32 + SameShard func(firstAddress, secondAddress []byte) bool + SelfId func() uint32 + type SizedLRUCacheHandler interface + AddSized func(key, value interface{}, sizeInBytes int64) bool + AddSizedIfMissing func(key, value interface{}, sizeInBytes int64) (ok, evicted bool) + Contains func(key interface{}) (ok bool) + Get func(key interface{}) (value interface{}, ok bool) + Keys func() []interface{} + Len func() int + Peek func(key interface{}) (value interface{}, ok bool) + Purge func() + Remove func(key interface{}) bool + SizeInBytesContained func() uint64 + type Storer interface + ClearCache func() + Close func() error + DestroyUnit func() error + Get func(key []byte) ([]byte, error) + GetBulkFromEpoch func(keys [][]byte, epoch uint32) (map[string][]byte, error) + GetFromEpoch func(key []byte, epoch uint32) ([]byte, error) + Has func(key []byte) error + HasInEpoch func(key []byte, epoch uint32) error + IsInterfaceNil func() bool + Put func(key, data []byte) error + PutInEpoch func(key, data []byte, epoch uint32) error + RangeKeys func(handler func(key []byte, val []byte) bool) + Remove func(key []byte) error + SearchFirst func(key []byte) ([]byte, error) + type StorerWithPutInEpoch interface + SetEpochForPutOperation func(epoch uint32) + type TimeCacher interface + Has func(key string) bool + IsInterfaceNil func() bool + Sweep func() + Upsert func(key string, span time.Duration) error + type UnitOpenerHandler interface + GetMostRecentBootstrapStorageUnit func() (Storer, error) + IsInterfaceNil func() bool