Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
etl::impl::ExtractionDataPipe< RawDataType > Class Template Reference

A collection of thread safe async queues used by Extractor and Transformer to communicate. More...

#include <ExtractionDataPipe.hpp>

Public Types

using DataType = std::optional<RawDataType>
 
using QueueType = ThreadSafeQueue<DataType>
 

Public Member Functions

 ExtractionDataPipe (uint32_t stride, uint32_t startSequence)
 Create a new instance of the extraction data pipe.
 
void push (uint32_t sequence, DataType &&data)
 Push new data package for the specified sequence.
 
DataType popNext (uint32_t sequence)
 Get data package for the given sequence.
 
uint32_t getStride () const
 
void finish (uint32_t sequence)
 Hint the Transformer that the queue is done sending data.
 
void cleanup ()
 Unblocks internal queues.
 

Static Public Attributes

static constexpr auto kTOTAL_MAX_IN_QUEUE = 1000u
 

Detailed Description

template<typename RawDataType>
class etl::impl::ExtractionDataPipe< RawDataType >

A collection of thread safe async queues used by Extractor and Transformer to communicate.

Constructor & Destructor Documentation

◆ ExtractionDataPipe()

template<typename RawDataType >
etl::impl::ExtractionDataPipe< RawDataType >::ExtractionDataPipe ( uint32_t stride,
uint32_t startSequence )
inline

Create a new instance of the extraction data pipe.

Parameters
stride
startSequence

Member Function Documentation

◆ cleanup()

template<typename RawDataType >
void etl::impl::ExtractionDataPipe< RawDataType >::cleanup ( )
inline

Unblocks internal queues.

Note: For now this must be called by the ETL when Transformer exits.

◆ finish()

template<typename RawDataType >
void etl::impl::ExtractionDataPipe< RawDataType >::finish ( uint32_t sequence)
inline

Hint the Transformer that the queue is done sending data.

Parameters
sequenceThe sequence for which the extractor queue is to be hinted

◆ getStride()

template<typename RawDataType >
uint32_t etl::impl::ExtractionDataPipe< RawDataType >::getStride ( ) const
inline
Returns
Get the stride

◆ popNext()

template<typename RawDataType >
DataType etl::impl::ExtractionDataPipe< RawDataType >::popNext ( uint32_t sequence)
inline

Get data package for the given sequence.

Note: Potentially blocks until data is available.

Parameters
sequenceThe sequence for which data is required
Returns
The data wrapped in an optional; nullopt means that there is no more data to expect

◆ push()

template<typename RawDataType >
void etl::impl::ExtractionDataPipe< RawDataType >::push ( uint32_t sequence,
DataType && data )
inline

Push new data package for the specified sequence.

Note: Potentially blocks until the underlying queue can accomodate another entry.

Parameters
sequenceThe sequence for which to enqueue the data package
dataThe data to store

The documentation for this class was generated from the following file: