![]() |
Project
|
#include <DataAllocator.h>
Classes | |
struct | CacheId |
struct | UninitializedVector |
Public Types | |
enum struct | CacheStrategy : int { Never = 0 , Always = 1 } |
using | AllowedOutputRoutes = std::vector< OutputRoute > |
using | DataHeader = o2::header::DataHeader |
using | DataOrigin = o2::header::DataOrigin |
using | DataDescription = o2::header::DataDescription |
using | SubSpecificationType = o2::header::DataHeader::SubSpecificationType |
Public Member Functions | |
DataAllocator (ServiceRegistryRef ref) | |
DataChunk & | newChunk (const Output &, size_t) |
DataChunk & | newChunk (OutputRef &&ref, size_t size) |
void | adoptChunk (const Output &, char *, size_t, fair::mq::FreeFn *, void *) |
void | cookDeadBeef (const Output &spec) |
template<typename T , typename... Args> requires is_specialization_v<T, o2::framework::DataAllocator::UninitializedVector> | |
decltype(auto) | make (const Output &spec, Args... args) |
template<typename T , typename... Args> requires VectorOfMessageableTypes<T> | |
decltype(auto) | make (const Output &spec, Args... args) |
template<typename T , typename... Args> requires (!VectorOfMessageableTypes<T> && has_root_dictionary<T>::value == true && is_messageable<T>::value == false) | |
decltype(auto) | make (const Output &spec, Args... args) |
template<typename T , typename... Args> requires std::is_base_of_v<std::string, T> | |
decltype(auto) | make (const Output &spec, Args... args) |
template<typename T , typename... Args> requires (requires { static_cast<struct TableBuilder>(std::declval<std::decay_t<T>>()); }) | |
decltype(auto) | make (const Output &spec, Args... args) |
template<typename T , typename... Args> requires (requires { static_cast<struct FragmentToBatch>(std::declval<std::decay_t<T>>()); }) | |
decltype(auto) | make (const Output &spec, Args... args) |
template<typename T > requires is_messageable<T> | |
::value &&!is_specialization_v< T, UninitializedVector > decltype(auto) | make (const Output &spec) |
template<typename T > requires is_messageable<T> | |
::value &&!is_specialization_v< T, UninitializedVector > decltype(auto) | make (const Output &spec, std::integral auto nElements) |
template<typename T , typename Arg > | |
decltype(auto) | make (const Output &spec, std::same_as< std::shared_ptr< arrow::Schema > > auto schema) |
void | adopt (const Output &spec, std::string *) |
void | adopt (const Output &spec, LifetimeHolder< struct TableBuilder > &) |
void | adopt (const Output &spec, LifetimeHolder< struct FragmentToBatch > &) |
void | adopt (const Output &spec, std::shared_ptr< class arrow::Table >) |
Adopt an Arrow table and send it to all consumers of spec. | |
template<typename T > | |
void | snapshot (const Output &spec, T const &object) |
void | snapshot (const Output &spec, const char *payload, size_t payloadSize, o2::header::SerializationMethod serializationMethod=o2::header::gSerializationMethodNone) |
template<typename T , typename... Args> | |
decltype(auto) | make (OutputRef &&ref, Args &&... args) |
template<typename T > | |
void | adopt (OutputRef &&ref, T *obj) |
std::pmr::memory_resource * | getMemoryResource (const Output &spec) |
template<typename T , typename... Args> | |
std::pmr::vector< T > | makeVector (const Output &spec, Args &&... args) |
template<typename ContainerT > | |
CacheId | adoptContainer (const Output &, ContainerT &, CacheStrategy, o2::header::SerializationMethod) |
template<typename ContainerT > | |
CacheId | adoptContainer (const Output &spec, ContainerT &&container, CacheStrategy cache=CacheStrategy::Never, o2::header::SerializationMethod method=header::gSerializationMethodNone) |
void | adoptFromCache (Output const &spec, CacheId id, header::SerializationMethod method=header::gSerializationMethodNone) |
Adopt an already cached message, using an already provided CacheId. | |
template<typename... Args> | |
auto | snapshot (OutputRef &&ref, Args &&... args) |
bool | isAllowed (Output const &query) |
check if a certain output is allowed | |
o2::header::DataHeader * | findMessageHeader (const Output &spec) |
o2::header::DataHeader * | findMessageHeader (OutputRef &&ref) |
o2::header::Stack * | findMessageHeaderStack (const Output &spec) |
o2::header::Stack * | findMessageHeaderStack (OutputRef &&ref) |
int | countDeviceOutputs (bool excludeDPLOrigin=false) |
Static Public Attributes | |
static constexpr ServiceKind | service_kind = ServiceKind::Stream |
This allocator is responsible to make sure that the messages created match the provided spec and that depending on how many pipelined reader we have, messages get created on the channel for the reader of the current timeframe.
Definition at line 135 of file DataAllocator.h.
using o2::framework::DataAllocator::AllowedOutputRoutes = std::vector<OutputRoute> |
Definition at line 139 of file DataAllocator.h.
Definition at line 142 of file DataAllocator.h.
Definition at line 140 of file DataAllocator.h.
Definition at line 141 of file DataAllocator.h.
using o2::framework::DataAllocator::SubSpecificationType = o2::header::DataHeader::SubSpecificationType |
Definition at line 143 of file DataAllocator.h.
|
strong |
Enumerator | |
---|---|
Never | |
Always |
Definition at line 473 of file DataAllocator.h.
o2::framework::DataAllocator::DataAllocator | ( | ServiceRegistryRef | ref | ) |
Definition at line 50 of file DataAllocator.cxx.
void o2::framework::DataAllocator::adopt | ( | const Output & | spec, |
LifetimeHolder< struct FragmentToBatch > & | f2b | ||
) |
Adopt a Source2Batch in the framework and serialise / send it as an Arrow Dataset to all consumers of spec once done
Definition at line 249 of file DataAllocator.cxx.
void o2::framework::DataAllocator::adopt | ( | const Output & | spec, |
LifetimeHolder< struct TableBuilder > & | tb | ||
) |
Adopt a TableBuilder in the framework and serialise / send it as an Arrow table to all consumers of spec once done
To finalise this we write the table to the buffer.
Definition at line 219 of file DataAllocator.cxx.
void o2::framework::DataAllocator::adopt | ( | const Output & | spec, |
std::shared_ptr< class arrow::Table > | |||
) |
Adopt an Arrow table and send it to all consumers of spec.
Adopt a string in the framework and serialize / send it to the consumers of spec once done.
Definition at line 156 of file DataAllocator.cxx.
adopt an object of type T and route to output specified by OutputRef Framework takes ownership of the object
OutputRef descriptors are expected to be passed as rvalue, i.e. a temporary object in the function call
Definition at line 447 of file DataAllocator.h.
void o2::framework::DataAllocator::adoptChunk | ( | const Output & | spec, |
char * | buffer, | ||
size_t | size, | ||
fair::mq::FreeFn * | freefn, | ||
void * | hint = nullptr |
||
) |
Definition at line 92 of file DataAllocator.cxx.
|
inline |
Definition at line 479 of file DataAllocator.h.
DataAllocator::CacheId o2::framework::DataAllocator::adoptContainer | ( | const Output & | spec, |
ContainerT && | container, | ||
CacheStrategy | cache = CacheStrategy::Never , |
||
o2::header::SerializationMethod | method = header::gSerializationMethodNone |
||
) |
Adopt a PMR container. Notice that the container must be moveable and eventually backed / by a o2::pmr::FairMQMemoryResource. spec where to send the message container the container whose resource needs to be sent cache: if true, the messages being sent are shallow copies of a cached copy. The entry in the cache can be subsequently be sent using the returned CacheId.
Definition at line 555 of file DataAllocator.h.
void o2::framework::DataAllocator::adoptFromCache | ( | Output const & | spec, |
CacheId | id, | ||
header::SerializationMethod | method = header::gSerializationMethodNone |
||
) |
Adopt an already cached message, using an already provided CacheId.
Definition at line 364 of file DataAllocator.cxx.
Definition at line 382 of file DataAllocator.cxx.
|
inline |
Definition at line 534 of file DataAllocator.h.
|
inline |
Definition at line 514 of file DataAllocator.h.
|
inline |
Definition at line 519 of file DataAllocator.h.
|
inline |
Definition at line 524 of file DataAllocator.h.
|
inline |
Definition at line 529 of file DataAllocator.h.
|
inline |
Definition at line 453 of file DataAllocator.h.
bool o2::framework::DataAllocator::isAllowed | ( | Output const & | query | ) |
check if a certain output is allowed
Definition at line 353 of file DataAllocator.cxx.
|
inline |
Definition at line 248 of file DataAllocator.h.
|
inline |
Definition at line 167 of file DataAllocator.h.
|
inline |
Definition at line 185 of file DataAllocator.h.
|
inline |
Definition at line 202 of file DataAllocator.h.
|
inline |
Definition at line 221 of file DataAllocator.h.
|
inline |
Definition at line 230 of file DataAllocator.h.
|
inline |
Definition at line 239 of file DataAllocator.h.
|
inline |
Definition at line 255 of file DataAllocator.h.
|
inline |
Definition at line 266 of file DataAllocator.h.
|
inline |
make an object of type T and route to output specified by OutputRef The object is owned by the framework, returned reference can be used to fill the object.
OutputRef descriptors are expected to be passed as rvalue, i.e. a temporary object in the function call
Definition at line 436 of file DataAllocator.h.
|
inline |
Definition at line 463 of file DataAllocator.h.
Definition at line 78 of file DataAllocator.cxx.
Definition at line 155 of file DataAllocator.h.
void o2::framework::DataAllocator::snapshot | ( | const Output & | spec, |
const char * | payload, | ||
size_t | payloadSize, | ||
o2::header::SerializationMethod | serializationMethod = o2::header::gSerializationMethodNone |
||
) |
Take a snapshot of a raw data array which can be either POD or may contain a serialized object (in such case the serialization method should be specified accordingly). Changes to the data after the call will not be sent.
Definition at line 319 of file DataAllocator.cxx.
|
inline |
Send a snapshot of an object, depending on the object type it is serialized before. The method always takes a copy of the data, which will then be sent once the computation ends. Framework does not take ownership of the object. Changes to object after the call will not be sent.
Supported types:
Note: for many use cases, especially for the messageable types, the make
interface might be better suited as the objects are allocated directly in the underlying memory resource and the copy can be avoided.
Note: messageable objects with ROOT dictionary are preferably sent unserialized. Use ROOTSerialized type wrapper to force ROOT serialization. Same applies to types which do not implement the ClassDef interface but have a dictionary.
Definition at line 312 of file DataAllocator.h.
|
inline |
snapshot object and route to output specified by OutputRef Framework makes a (serialized) copy of object content.
OutputRef descriptors are expected to be passed as rvalue, i.e. a temporary object in the function call
Definition at line 506 of file DataAllocator.h.
|
staticconstexpr |
Definition at line 138 of file DataAllocator.h.