CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
29 class CacheChangesStorage;
34 namespace model {
struct BlockChainConfiguration; }
37 namespace catapult {
namespace cache {
43 explicit CatapultCache(std::vector<std::unique_ptr<SubCachePlugin>>&& subCaches);
55 template<
typename TCache>
56 const TCache&
sub()
const {
77 std::vector<std::unique_ptr<const CacheStorage>>
storages()
const;
80 std::vector<std::unique_ptr<CacheStorage>>
storages();
83 std::vector<std::unique_ptr<const CacheChangesStorage>>
changesStorages()
const;
std::unique_ptr< const CacheHeightView > m_pCacheHeightView
Definition: CatapultCacheDetachableDelta.h:54
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
~CatapultCacheDetachableDelta()
Destroys the detachable cache delta.
void Sha3_256(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates the 256-bit SHA3 hash of dataBuffer into hash.
Definition: Hashes.cpp:81
CatapultCacheDetachableDelta createDetachableDelta() const
Definition: CatapultCache.cpp:260
Delta on top of a catapult cache.
Definition: CatapultCacheDelta.h:31
#define CATAPULT_THROW_INVALID_ARGUMENT_2(MESSAGE, PARAM1, PARAM2)
Macro used to throw a catapult invalid argument with two parameters.
Definition: exceptions.h:187
CatapultCacheDetachedDelta m_detachedDelta
Definition: CatapultCacheDetachableDelta.h:55
Height height() const
Gets the cache height associated with the read lock.
Definition: CatapultCache.cpp:108
CatapultCache & operator=(CatapultCache &&)
CatapultCache(std::vector< std::unique_ptr< SubCachePlugin >> &&subCaches)
Creates a catapult cache around subCaches.
Definition: CatapultCache.cpp:235
std::vector< std::unique_ptr< const CacheStorage > > storages() const
Gets cache storages for all sub caches.
Definition: CatapultCache.cpp:282
NamespaceId Id
Definition: RootNamespaceHistorySerializer.cpp:100
std::unique_ptr< CatapultCacheDelta > tryLock()
Definition: CatapultCache.cpp:197
Information about a cache state hash.
Definition: StateHashInfo.h:28
~CatapultCacheDelta()
Destroys the delta.
Height height() const
Gets the cache height associated with this delta.
Definition: CatapultCache.cpp:175
ReadOnlyCatapultCache toReadOnly() const
Creates a read-only view of this view.
Definition: CatapultCache.cpp:112
~CatapultCacheDetachedDelta()
Destroys the delta.
CatapultCacheDetachedDelta m_detachedDelta
Definition: RelockableDetachedCatapultCache.cpp:42
std::vector< std::unique_ptr< const SubCacheView > > m_subViews
Definition: CatapultCacheView.h:69
CatapultCacheDetachedDelta(std::vector< std::unique_ptr< DetachedSubCacheView >> &&detachedSubViews)
Creates a detached cache delta from detachedSubViews.
Definition: CatapultCache.cpp:187
CatapultCacheDetachableDelta(CacheHeightView &&cacheHeightView, std::vector< std::unique_ptr< DetachedSubCacheView >> &&detachedSubViews)
Creates a detachable cache delta from a cache height view (cacheHeightView) and detachedSubViews.
Definition: CatapultCache.cpp:163
Central cache holding all sub caches.
Definition: CatapultCache.h:40
std::unique_ptr< CacheHeightView > m_pCacheHeight
Definition: CatapultCacheView.h:68
std::vector< std::unique_ptr< const CacheChangesStorage > > changesStorages() const
Gets cache changes storages for all sub caches.
Definition: CatapultCache.cpp:296
CatapultCacheDelta & operator=(CatapultCacheDelta &&)
StateHashInfo calculateStateHash(Height height) const
Calculates the cache state hash given height.
Definition: CatapultCache.cpp:130
void commit(Height height)
Commits all pending changes to the underlying storage and sets the cache height to height.
Definition: CatapultCache.cpp:269
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
std::unique_ptr< CacheHeight > m_pCacheHeight
Definition: CatapultCache.h:86
ReadOnlyCatapultCache toReadOnly() const
Creates a read-only view of this delta.
Definition: CatapultCache.cpp:155
Locked view on top of the catapult cache.
Definition: CatapultCacheView.h:36
CatapultCacheView createView() const
Returns a locked cache view based on this cache.
Definition: CatapultCache.cpp:246
CatapultCacheDetachedDelta & operator=(CatapultCacheDetachedDelta &&)
CatapultCacheDetachedDelta detach()
Detaches the detached delta from this delta.
Definition: CatapultCache.cpp:179
Detached delta of the catapult cache.
Definition: CatapultCacheDetachedDelta.h:30
CatapultCacheDelta createDelta()
Returns a locked cache delta based on this cache.
Definition: CatapultCache.cpp:253
std::vector< std::unique_ptr< SubCacheView > > m_subViews
Definition: CatapultCacheDelta.h:69
const TCache & sub() const
Gets a specific sub cache.
Definition: CatapultCache.h:56
Definition: AddressExtractionExtension.cpp:28
constexpr size_t Hash256_Size
Definition: src/catapult/types.h:34
CatapultCacheView(CacheHeightView &&cacheHeightView, std::vector< std::unique_ptr< const SubCacheView >> &&subViews)
Creates a locked catapult cache view from a cache height view (cacheHeightView) and subViews.
Definition: CatapultCache.cpp:93
~CatapultCache()
Destroys the cache.
Definition: CatapultCacheDetachableDelta.h:32
A read only view on top of a cache height.
Definition: CacheHeight.h:28
A synchronized height associated with a catapult cache.
Definition: CacheHeight.h:70
CatapultCacheView & operator=(CatapultCacheView &&)
std::vector< std::unique_ptr< SubCachePlugin > > m_subCaches
Definition: CatapultCache.h:87
~CatapultCacheView()
Releases the read lock.
CatapultCacheDelta(std::vector< std::unique_ptr< SubCacheView >> &&subViews)
Creates a locked catapult cache delta from subViews.
Definition: CatapultCache.cpp:120
void setSubCacheMerkleRoots(const std::vector< Hash256 > &subCacheMerkleRoots)
Sets the merkle roots for all sub caches (subCacheMerkleRoots).
Definition: CatapultCache.cpp:134
A read-only overlay on top of a catapult cache.
Definition: ReadOnlyCatapultCache.h:27
Level for logging warning events.
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
std::vector< std::unique_ptr< DetachedSubCacheView > > m_detachedSubViews
Definition: CatapultCacheDetachedDelta.h:49
StateHashInfo calculateStateHash() const
Calculates the cache state hash.
Definition: CatapultCache.cpp:104