![]() |
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 TreeToTable>(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 TreeToTable > &) |
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) |
o2::pmr::FairMQMemoryResource * | getMemoryResource (const Output &spec) |
template<typename T , typename... Args> | |
o2::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 134 of file DataAllocator.h.
using o2::framework::DataAllocator::AllowedOutputRoutes = std::vector<OutputRoute> |
Definition at line 138 of file DataAllocator.h.
Definition at line 141 of file DataAllocator.h.
Definition at line 139 of file DataAllocator.h.
Definition at line 140 of file DataAllocator.h.
using o2::framework::DataAllocator::SubSpecificationType = o2::header::DataHeader::SubSpecificationType |
Definition at line 142 of file DataAllocator.h.
|
strong |
Enumerator | |
---|---|
Never | |
Always |
Definition at line 486 of file DataAllocator.h.
o2::framework::DataAllocator::DataAllocator | ( | ServiceRegistryRef | ref | ) |
Definition at line 49 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
To finalise this we write the table to the buffer. FIXME: most likely not a great idea. We should probably write to the buffer directly in the TableBuilder, incrementally.
Definition at line 304 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 242 of file DataAllocator.cxx.
void o2::framework::DataAllocator::adopt | ( | const Output & | spec, |
LifetimeHolder< struct TreeToTable > & | t2t | ||
) |
Adopt a Tree2Table 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. FIXME: most likely not a great idea. We should probably write to the buffer directly in the TableBuilder, incrementally.
Definition at line 272 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 151 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 460 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 91 of file DataAllocator.cxx.
|
inline |
Definition at line 492 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 568 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 400 of file DataAllocator.cxx.
Definition at line 418 of file DataAllocator.cxx.
|
inline |
Definition at line 547 of file DataAllocator.h.
|
inline |
Definition at line 527 of file DataAllocator.h.
|
inline |
Definition at line 532 of file DataAllocator.h.
|
inline |
Definition at line 537 of file DataAllocator.h.
|
inline |
Definition at line 542 of file DataAllocator.h.
|
inline |
Definition at line 466 of file DataAllocator.h.
bool o2::framework::DataAllocator::isAllowed | ( | Output const & | query | ) |
check if a certain output is allowed
Definition at line 389 of file DataAllocator.cxx.
|
inline |
Definition at line 256 of file DataAllocator.h.
|
inline |
Definition at line 166 of file DataAllocator.h.
|
inline |
Definition at line 184 of file DataAllocator.h.
|
inline |
Definition at line 201 of file DataAllocator.h.
|
inline |
Definition at line 220 of file DataAllocator.h.
|
inline |
Definition at line 229 of file DataAllocator.h.
|
inline |
Definition at line 238 of file DataAllocator.h.
|
inline |
Definition at line 247 of file DataAllocator.h.
|
inline |
Definition at line 263 of file DataAllocator.h.
|
inline |
Definition at line 274 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 449 of file DataAllocator.h.
|
inline |
Definition at line 476 of file DataAllocator.h.
Definition at line 77 of file DataAllocator.cxx.
Definition at line 154 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 355 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 325 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 519 of file DataAllocator.h.
|
staticconstexpr |
Definition at line 137 of file DataAllocator.h.