CatapultServer  v0.5.0.1 (Elephant)
catapult::disruptor Namespace Reference

Classes

class  BatchRangeDispatcher
 Batches entity ranges for processing by a ConsumerDispatcher. More...
 
struct  ConsumerCompletionResult
 Extended consumer result passed to completion callback. More...
 
class  ConsumerDispatcher
 Dispatcher for disruptor consumers. More...
 
struct  ConsumerDispatcherOptions
 Consumer dispatcher options. More...
 
class  ConsumerEntry
 Holds information about a consumer. More...
 
class  ConsumerInput
 Consumer input composed of a range of entities augmented with metadata. More...
 
struct  ConsumerResult
 Result of a consumer operation. More...
 
class  Disruptor
 Disruptor wraps around CircularBuffer for usage within Consumer Dispatcher. More...
 
class  DisruptorBarrier
 
class  DisruptorBarriers
 Container for disruptor barriers. More...
 
class  DisruptorElement
 Augments consumer input with disruptor metadata. More...
 
struct  FreeTransactionElement
 Processing element for a transaction unassociated with a block composed of a transaction and metadata. More...
 

Typedefs

template<typename TInput >
using DisruptorConsumerT = std::function< ConsumerResult(TInput &)>
 A typed disruptor consumer function. More...
 
using DisruptorConsumer = DisruptorConsumerT< ConsumerInput >
 A disruptor consumer function. More...
 
using ConstDisruptorConsumer = DisruptorConsumerT< const ConsumerInput >
 A const disruptor consumer function. More...
 
using BlockConsumer = DisruptorConsumerT< BlockElements >
 A block disruptor consumer function. More...
 
using ConstBlockConsumer = DisruptorConsumerT< const BlockElements >
 A const block disruptor consumer function. More...
 
using TransactionConsumer = DisruptorConsumerT< TransactionElements >
 A transaction disruptor consumer function. More...
 
using ConstTransactionConsumer = DisruptorConsumerT< const TransactionElements >
 A const transaction disruptor consumer function. More...
 
using DisruptorInspector = consumer< ConsumerInput &, const ConsumerCompletionResult & >
 A disruptor inspector function. More...
 
using PositionType = uint64_t
 Position within disruptor components. More...
 
using DisruptorElementId = uint64_t
 Id of a disruptor element. More...
 
using CompletionCode = uint32_t
 Optional code that can provide additional consumer completion information. More...
 
using ProcessingCompleteFunc = consumer< DisruptorElementId, const ConsumerCompletionResult & >
 Function signature for signaling that processing finished. More...
 
using BlockElements = std::vector< model::BlockElement >
 A container of BlockElement. More...
 
using TransactionElements = std::vector< FreeTransactionElement >
 A container of FreeTransactionElement. More...
 

Enumerations

enum  CompletionStatus : uint8_t { CompletionStatus::Aborted, CompletionStatus::Normal, CompletionStatus::Consumed }
 Completion status. More...
 
enum  ConsumerResultSeverity : uint8_t { ConsumerResultSeverity::Neutral, ConsumerResultSeverity::Success, ConsumerResultSeverity::Failure }
 
enum  InputSource : uint32_t { InputSource::INPUT_SOURCE_LIST }
 Possible consumer input sources. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const ConsumerInput &input)
 
std::vector< DisruptorConsumerDisruptorConsumersFromBlockConsumers (const std::vector< BlockConsumer > &blockConsumers)
 Maps blockConsumers to disruptor consumers so that they can be used to create a ConsumerDispatcher. More...
 
std::vector< DisruptorConsumerDisruptorConsumersFromTransactionConsumers (const std::vector< TransactionConsumer > &transactionConsumers)
 Maps transactionConsumers to disruptor consumers so that they can be used to create a ConsumerDispatcher. More...
 
std::ostream & operator<< (std::ostream &out, const DisruptorElement &element)
 Insertion operator for outputting element to out. More...
 
constexpr bool IsIntervalElementId (DisruptorElementId id, size_t interval)
 Returns true if id matches interval. More...
 
std::ostream & operator<< (std::ostream &out, InputSource value)
 Insertion operator for outputting value to out. More...
 

Typedef Documentation

◆ BlockConsumer

A block disruptor consumer function.

◆ BlockElements

A container of BlockElement.

◆ CompletionCode

using catapult::disruptor::CompletionCode = typedef uint32_t

Optional code that can provide additional consumer completion information.

◆ ConstBlockConsumer

A const block disruptor consumer function.

◆ ConstDisruptorConsumer

A const disruptor consumer function.

◆ ConstTransactionConsumer

A const transaction disruptor consumer function.

◆ DisruptorConsumer

A disruptor consumer function.

◆ DisruptorConsumerT

template<typename TInput >
using catapult::disruptor::DisruptorConsumerT = typedef std::function<ConsumerResult (TInput&)>

A typed disruptor consumer function.

◆ DisruptorElementId

using catapult::disruptor::DisruptorElementId = typedef uint64_t

Id of a disruptor element.

◆ DisruptorInspector

A disruptor inspector function.

◆ PositionType

using catapult::disruptor::PositionType = typedef uint64_t

Position within disruptor components.

◆ ProcessingCompleteFunc

Function signature for signaling that processing finished.

◆ TransactionConsumer

A transaction disruptor consumer function.

◆ TransactionElements

Enumeration Type Documentation

◆ CompletionStatus

Completion status.

Enumerator
Aborted 

Processing of the entity was aborted by a consumer.

Normal 

Processing of the entity is ongoing.

Consumed 

Processing of the entity was completed and the entity was consumed.

◆ ConsumerResultSeverity

Consumer result severity.

Note
Non-success results mean that processing was aborted.
Enumerator
Neutral 

Neutral result.

Success 

Success result.

Failure 

Failure result.

◆ InputSource

enum catapult::disruptor::InputSource : uint32_t
strong

Possible consumer input sources.

Enumerator
INPUT_SOURCE_LIST 

Function Documentation

◆ DisruptorConsumersFromBlockConsumers()

std::vector< DisruptorConsumer > catapult::disruptor::DisruptorConsumersFromBlockConsumers ( const std::vector< BlockConsumer > &  blockConsumers)

Maps blockConsumers to disruptor consumers so that they can be used to create a ConsumerDispatcher.

◆ DisruptorConsumersFromTransactionConsumers()

std::vector< DisruptorConsumer > catapult::disruptor::DisruptorConsumersFromTransactionConsumers ( const std::vector< TransactionConsumer > &  transactionConsumers)

Maps transactionConsumers to disruptor consumers so that they can be used to create a ConsumerDispatcher.

◆ IsIntervalElementId()

constexpr bool catapult::disruptor::IsIntervalElementId ( DisruptorElementId  id,
size_t  interval 
)
constexpr

Returns true if id matches interval.

Here is the caller graph for this function:

◆ operator<<() [1/3]

std::ostream& catapult::disruptor::operator<< ( std::ostream &  out,
const ConsumerInput input 
)
Here is the call graph for this function:

◆ operator<<() [2/3]

std::ostream & catapult::disruptor::operator<< ( std::ostream &  out,
const DisruptorElement element 
)

Insertion operator for outputting element to out.

Here is the call graph for this function:

◆ operator<<() [3/3]

std::ostream& catapult::disruptor::operator<< ( std::ostream &  out,
InputSource  value 
)

Insertion operator for outputting value to out.