![]() |
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 > requires (!std::ranges::contiguous_range<T> && is_messageable<T>::value) | |
| void | snapshot (const Output &spec, T const &object) |
| void | snapshot (const Output &spec, std::string_view const &object) |
| template<typename T > requires (ContiguousMessageablesRange<T> && !std::is_pointer_v<typename T::value_type>) | |
| void | snapshot (const Output &spec, T const &object) |
| template<typename T > requires (std::ranges::random_access_range<T> && is_messageable<typename std::remove_pointer_t<typename T::value_type>>::value && std::is_pointer_v<typename T::value_type>) | |
| void | snapshot (const Output &spec, T const &object) |
| template<typename T > requires (!std::ranges::contiguous_range<T> && std::ranges::sized_range<T> && has_messageable_value_type<T>::value) | |
| void | snapshot (const Output &spec, T const &object) |
| template<typename T > requires (is_specialization_v<T, ROOTSerialized>) | |
| void | snapshot (const Output &spec, T const &object) |
| template<typename T > requires (!is_messageable<T>::value && !ContiguousMessageablesRange<T> && has_root_dictionary<T>::value && !is_specialization_v<T, ROOTSerialized>) | |
| 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) |
| void | forwardPayload (const Output &spec, fair::mq::Message &inputPayload, 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. | |
| void | pruneFromCache (CacheId id) |
| 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 161 of file DataAllocator.h.
| using o2::framework::DataAllocator::AllowedOutputRoutes = std::vector<OutputRoute> |
Definition at line 165 of file DataAllocator.h.
Definition at line 168 of file DataAllocator.h.
Definition at line 166 of file DataAllocator.h.
Definition at line 167 of file DataAllocator.h.
| using o2::framework::DataAllocator::SubSpecificationType = o2::header::DataHeader::SubSpecificationType |
Definition at line 169 of file DataAllocator.h.
|
strong |
| Enumerator | |
|---|---|
| Never | |
| Always | |
Definition at line 531 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 503 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 537 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 617 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 397 of file DataAllocator.cxx.
Definition at line 421 of file DataAllocator.cxx.
|
inline |
Definition at line 596 of file DataAllocator.h.
|
inline |
Definition at line 576 of file DataAllocator.h.
|
inline |
Definition at line 581 of file DataAllocator.h.
|
inline |
Definition at line 586 of file DataAllocator.h.
|
inline |
Definition at line 591 of file DataAllocator.h.
| void o2::framework::DataAllocator::forwardPayload | ( | const Output & | spec, |
| fair::mq::Message & | inputPayload, | ||
| o2::header::SerializationMethod | serializationMethod = o2::header::gSerializationMethodNone |
||
| ) |
create a shallow copy of the inputPayload and forward it to the output route of spec if the transport types of the input and output routes are different, a real copy is created as fallback
Definition at line 345 of file DataAllocator.cxx.
|
inline |
Definition at line 509 of file DataAllocator.h.
| bool o2::framework::DataAllocator::isAllowed | ( | Output const & | query | ) |
check if a certain output is allowed
Definition at line 386 of file DataAllocator.cxx.
|
inline |
Definition at line 274 of file DataAllocator.h.
|
inline |
Definition at line 193 of file DataAllocator.h.
|
inline |
Definition at line 211 of file DataAllocator.h.
|
inline |
Definition at line 228 of file DataAllocator.h.
|
inline |
Definition at line 247 of file DataAllocator.h.
|
inline |
Definition at line 256 of file DataAllocator.h.
|
inline |
Definition at line 265 of file DataAllocator.h.
|
inline |
Definition at line 281 of file DataAllocator.h.
|
inline |
Definition at line 292 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 492 of file DataAllocator.h.
|
inline |
Definition at line 519 of file DataAllocator.h.
Definition at line 78 of file DataAllocator.cxx.
Definition at line 181 of file DataAllocator.h.
Prune a previously cached message identified by id from the message cache. Calling this with an unknown id is a no-op.
Definition at line 415 of file DataAllocator.cxx.
| 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 332 of file DataAllocator.cxx.
|
inline |
Definition at line 345 of file DataAllocator.h.
|
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 340 of file DataAllocator.h.
|
inline |
Definition at line 353 of file DataAllocator.h.
|
inline |
Definition at line 377 of file DataAllocator.h.
|
inline |
Definition at line 403 of file DataAllocator.h.
Definition at line 425 of file DataAllocator.h.
|
inline |
Definition at line 464 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 568 of file DataAllocator.h.
|
staticconstexpr |
Definition at line 164 of file DataAllocator.h.