CatapultServer  v0.5.0.1 (Elephant)
AccountStateCacheSubCachePlugin.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "AccountStateCache.h"
25 
26 namespace catapult { namespace cache {
27 
29  class AccountStateCacheSummaryCacheStorage : public SummaryCacheStorage<AccountStateCache> {
30  public:
32 
33  public:
34  void saveAll(const CatapultCacheView& cacheView, io::OutputStream& output) const override;
35 
36  void saveSummary(const CatapultCacheDelta& cacheDelta, io::OutputStream& output) const override;
37 
38  void loadAll(io::InputStream& input, size_t) override;
39  };
40 
43 
46  public:
49  };
50 }}
catapult::io::OutputStream::flush
virtual void flush()=0
catapult::model::AddressSet
std::unordered_set< Address, utils::ArrayHasher< Address > > AddressSet
Unordered set of addresses.
Definition: ContainerTypes.h:41
catapult::cache::CatapultCacheDelta::sub
const TCache::CacheDeltaType & sub() const
Gets a specific sub cache delta view.
Definition: CatapultCacheDelta.h:47
AccountStateCacheSubCachePlugin.h
catapult::cache::CatapultCacheDelta
Delta on top of a catapult cache.
Definition: CatapultCacheDelta.h:31
catapult::cache::SummaryCacheStorage
CacheStorage implementation for saving and loading summary cache data.
Definition: SummaryAwareSubCachePluginAdapter.h:28
catapult::io::OutputStream::write
virtual void write(const RawBuffer &buffer)=0
catapult::cache::AccountStateCacheTypes::Options
Custom sub view options.
Definition: AccountStateCacheTypes.h:79
catapult::cache::SummaryCacheStorage< AccountStateCache >::cache
const AccountStateCache & cache() const
Gets a typed const reference to the underlying cache.
Definition: SummaryAwareSubCachePluginAdapter.h:43
catapult::io::InputStream
Reader interface.
Definition: Stream.h:27
catapult::cache::AccountStateCacheSubCachePlugin::AccountStateCacheSubCachePlugin
AccountStateCacheSubCachePlugin(const CacheConfiguration &config, const AccountStateCacheTypes::Options &options)
Creates a plugin around config and options.
Definition: AccountStateCacheSubCachePlugin.cpp:52
catapult::io::Write64
void Write64(TIo &output, uint64_t value)
Writes value into output.
Definition: PodIoUtils.h:36
catapult::cache::AccountStateCacheSubCachePlugin
Specialized account state cache sub cache plugin.
Definition: AccountStateCacheSubCachePlugin.h:45
catapult::cache::CatapultCacheView
Locked view on top of the catapult cache.
Definition: CatapultCacheView.h:36
AccountStateCache.h
catapult::cache::AccountStateCache
Synchronized cache composed of stateful account information.
Definition: AccountStateCache.h:72
catapult::cache::AccountStateCacheSummaryCacheStorage::loadAll
void loadAll(io::InputStream &input, size_t) override
Loads cache data from input in batches of batchSize.
Definition: AccountStateCacheSubCachePlugin.cpp:39
catapult::cache::AccountStateCacheSummaryCacheStorage
CacheStorage implementation for saving and loading summary account state cache data.
Definition: AccountStateCacheSubCachePlugin.h:29
catapult::cache::CacheConfiguration
Cache configuration.
Definition: CacheConfiguration.h:37
catapult::io::InputStream::read
virtual void read(const MutableRawBuffer &buffer)=0
CATAPULT_THROW_INVALID_ARGUMENT
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
SummaryAwareSubCachePluginAdapter.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::io::Read64
auto Read64(TIo &input)
Reads value from input.
Definition: PodIoUtils.h:66
AccountStateCacheStorage.h
catapult::cache::AccountStateCacheSummaryCacheStorage::saveSummary
void saveSummary(const CatapultCacheDelta &cacheDelta, io::OutputStream &output) const override
Saves cache (summary) data from cacheDelta to output.
Definition: AccountStateCacheSubCachePlugin.cpp:29
catapult::utils::ByteArray< Address_Decoded_Size, Address_tag >
catapult::cache::AccountStateCacheSummaryCacheStorage::saveAll
void saveAll(const CatapultCacheView &cacheView, io::OutputStream &output) const override
Saves cache data from cacheView to output.
Definition: AccountStateCacheSubCachePlugin.cpp:25
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::cache::SummaryAwareSubCachePluginAdapter
Specialized sub cache plugin adapter that provides proper handling of summary cache state.
Definition: SummaryAwareSubCachePluginAdapter.h:59
catapult::cache::SynchronizedCacheWithInit::init
void init(TArgs &&... args)
Initializes the underlying cache with args.
Definition: SynchronizedCache.h:288