CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 #include <unordered_map>
29 namespace catapult {
namespace disruptor {
32 template<
typename TAnnotatedEntityRange>
65 m_rangesMap[{ range.SourcePublicKey, source }].push_back(std::move(range.Range));
77 for (
auto& pair : rangesMap) {
78 auto mergedRange = EntityRange::MergeRanges(std::move(pair.second));
utils::SpinLock m_lock
Definition: BatchRangeDispatcher.h:93
InputSource
Possible consumer input sources.
Definition: InputSource.h:42
std::unordered_map< RangeGroupKey, std::vector< EntityRange >, RangeGroupKeyHasher > GroupedRangesMap
Definition: BatchRangeDispatcher.h:54
GroupedRangesMap m_rangesMap
Definition: BatchRangeDispatcher.h:92
Dispatcher for disruptor consumers.
Definition: ConsumerDispatcher.h:35
Definition: BatchRangeDispatcher.h:37
Batches entity ranges for processing by a ConsumerDispatcher.
Definition: BatchRangeDispatcher.h:33
Definition: SpinLock.h:31
size_t operator()(const RangeGroupKey &key) const
Definition: BatchRangeDispatcher.h:49
ConsumerDispatcher & m_dispatcher
Definition: BatchRangeDispatcher.h:91
void queue(TAnnotatedEntityRange &&range, InputSource source)
Queues processing of range from source.
Definition: BatchRangeDispatcher.h:63
decltype(TAnnotatedEntityRange::Range) EntityRange
Definition: BatchRangeDispatcher.h:35
DisruptorElementId processElement(ConsumerInput &&input, const ProcessingCompleteFunc &processingComplete)
Definition: ConsumerDispatcher.cpp:163
Key SourcePublicKey
Definition: BatchRangeDispatcher.h:39
void dispatch()
Dispatches all queued elements to the underlying dispatcher.
Definition: BatchRangeDispatcher.h:69
Definition: AddressExtractionExtension.cpp:28
InputSource Source
Definition: BatchRangeDispatcher.h:40
bool empty() const
Returns true if no ranges are currently queued.
Definition: BatchRangeDispatcher.h:85
std::lock_guard< SpinLock > SpinLockGuard
A spin lock guard.
Definition: SpinLock.h:60
friend bool operator==(const RangeGroupKey &lhs, const RangeGroupKey &rhs)
Definition: BatchRangeDispatcher.h:43
BatchRangeDispatcher(ConsumerDispatcher &dispatcher)
Creates a batch range dispatcher around dispatcher.
Definition: BatchRangeDispatcher.h:58
Definition: BatchRangeDispatcher.h:48