CatapultServer  v0.5.0.1 (Elephant)
HashCheckOptions.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include <stdint.h>
23 
24 namespace catapult { namespace consumers {
25 
28  public:
30  constexpr HashCheckOptions() : HashCheckOptions(0, 0, 0)
31  {}
32 
34  constexpr HashCheckOptions(uint64_t cacheDuration, uint64_t pruneInterval, uint64_t maxCacheSize)
35  : CacheDuration(cacheDuration)
36  , PruneInterval(pruneInterval)
37  , MaxCacheSize(maxCacheSize)
38  {}
39 
40  public:
42  uint64_t CacheDuration;
43 
45  uint64_t PruneInterval;
46 
48  uint64_t MaxCacheSize;
49  };
50 }}
catapult::consumers::HashCheckOptions::CacheDuration
uint64_t CacheDuration
Amount of time a hash should be cached.
Definition: HashCheckOptions.h:42
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::disruptor::TransactionConsumer
DisruptorConsumerT< TransactionElements > TransactionConsumer
A transaction disruptor consumer function.
Definition: DisruptorConsumer.h:44
MerkleHashBuilder.h
catapult::disruptor::ConstBlockConsumer
DisruptorConsumerT< const BlockElements > ConstBlockConsumer
A const block disruptor consumer function.
Definition: DisruptorConsumer.h:41
BlockConsumers.h
catapult::chain::KnownHashPredicate
predicate< Timestamp, const Hash256 & > KnownHashPredicate
Predicate for determining if a hash is known.
Definition: ChainFunctions.h:36
catapult::model::UpdateHashes
void UpdateHashes(const TransactionRegistry &transactionRegistry, const GenerationHash &generationHash, TransactionElement &transactionElement)
Definition: EntityHasher.cpp:95
ConsumerResultFactory.h
catapult::consumers::HashCheckOptions::HashCheckOptions
constexpr HashCheckOptions()
Creates default options.
Definition: HashCheckOptions.h:30
catapult::consumers::CreateBlockHashCalculatorConsumer
disruptor::BlockConsumer CreateBlockHashCalculatorConsumer(const GenerationHash &generationHash, const model::TransactionRegistry &transactionRegistry)
Definition: HashCalculatorConsumer.cpp:72
Hashes.h
catapult::disruptor::ConsumerResultSeverity::Neutral
Neutral result.
catapult::consumers::CreateBlockHashCheckConsumer
disruptor::ConstBlockConsumer CreateBlockHashCheckConsumer(const chain::TimeSupplier &timeSupplier, const HashCheckOptions &options)
Definition: HashCheckConsumer.cpp:56
RecentHashCache.h
catapult::model::CalculateHash
Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer &data)
Calculates hashAlgorithm hash of data.
Definition: LockHashUtils.cpp:46
m_transactionRegistry
const model::TransactionRegistry & m_transactionRegistry
Definition: HashCalculatorConsumer.cpp:68
catapult::disruptor::BlockConsumer
DisruptorConsumerT< BlockElements > BlockConsumer
A block disruptor consumer function.
Definition: DisruptorConsumer.h:38
catapult::consumers::CreateTransactionHashCalculatorConsumer
disruptor::TransactionConsumer CreateTransactionHashCalculatorConsumer(const GenerationHash &generationHash, const model::TransactionRegistry &transactionRegistry)
Definition: HashCalculatorConsumer.cpp:103
catapult::consumers::Abort
constexpr disruptor::ConsumerResult Abort(validators::ValidationResult validationResult)
Creates an aborted consumer result around validationResult.
Definition: ConsumerResultFactory.h:34
catapult::disruptor::TransactionElements
std::vector< FreeTransactionElement > TransactionElements
A container of FreeTransactionElement.
Definition: DisruptorTypes.h:135
catapult::consumers::CreateTransactionHashCheckConsumer
disruptor::TransactionConsumer CreateTransactionHashCheckConsumer(const chain::TimeSupplier &timeSupplier, const HashCheckOptions &options, const chain::KnownHashPredicate &knownHashPredicate)
Definition: HashCheckConsumer.cpp:107
catapult::disruptor::BlockElements
std::vector< model::BlockElement > BlockElements
A container of BlockElement.
Definition: DisruptorTypes.h:132
catapult::consumers::HashCheckOptions::PruneInterval
uint64_t PruneInterval
Minimum amount of time between cache pruning.
Definition: HashCheckOptions.h:45
catapult::chain::TimeSupplier
supplier< Timestamp > TimeSupplier
Supplies a timestamp.
Definition: ChainFunctions.h:39
catapult::consumers::HashCheckOptions::MaxCacheSize
uint64_t MaxCacheSize
Maximum size of the cache.
Definition: HashCheckOptions.h:48
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::GenerationHash
utils::ByteArray< Hash256_Size, GenerationHash_tag > GenerationHash
Definition: src/catapult/types.h:53
Hashers.h
catapult::model::TransactionRegistry
A registry of transaction plugins.
Definition: TransactionPlugin.h:98
catapult::consumers::HashCheckOptions
Options for configuring the hash check consumer.
Definition: HashCheckOptions.h:27
EntityHasher.h
m_generationHash
GenerationHash m_generationHash
Definition: HashCalculatorConsumer.cpp:67
catapult::consumers::HashCheckOptions::HashCheckOptions
constexpr HashCheckOptions(uint64_t cacheDuration, uint64_t pruneInterval, uint64_t maxCacheSize)
Creates options with custom cacheDuration, pruneInterval and maxCacheSize.
Definition: HashCheckOptions.h:34
catapult::utils::ByteArray
Base class for wrappers of byte array types, to provide some type-safety.
Definition: ByteArray.h:29
m_recentHashCache
RecentHashCache m_recentHashCache
Definition: HashCheckConsumer.cpp:52
catapult::consumers::Continue
constexpr disruptor::ConsumerResult Continue()
Creates a continuation consumer result.
Definition: ConsumerResultFactory.h:29
m_knownHashPredicate
chain::KnownHashPredicate m_knownHashPredicate
Definition: HashCheckConsumer.cpp:103
TransactionConsumers.h