Project
Loading...
Searching...
No Matches
o2::framework::LifetimeHelpers Struct Reference

#include <LifetimeHelpers.h>

Static Public Member Functions

static ExpirationHandler::Creator dataDrivenCreation ()
 Callback which does nothing, waiting for data to arrive.
 
static ExpirationHandler::Creator enumDrivenCreation (size_t first, size_t last, size_t step, size_t inputTimeslice, size_t maxTimeSliceId, size_t repetitions)
 
static ExpirationHandler::Creator timeDrivenCreation (std::vector< std::chrono::microseconds > periods, std::vector< std::chrono::seconds > intervals, std::function< bool(void)> hasTimerFired, std::function< void(uint64_t, uint64_t)> updateTimerPeriod)
 
static ExpirationHandler::Creator uvDrivenCreation (int loopReason, DeviceState &state)
 Callback which creates a new timeslice whenever some libuv event happens.
 
static ExpirationHandler::Checker expireNever ()
 
static ExpirationHandler::Checker expireAlways ()
 
static ExpirationHandler::Checker expireIfPresent (std::vector< InputRoute > const &schema, ConcreteDataMatcher matcher)
 
static ExpirationHandler::Checker expireTimed (std::chrono::microseconds period)
 
static ExpirationHandler::Handler doNothing ()
 
static ExpirationHandler::Checker expectCTP (std::string const &serverUrl, bool waitForCTP)
 
static ExpirationHandler::Handler fetchFromCCDBCache (InputSpec const &spec, std::string const &prefix, std::string const &overrideTimestamp, std::string const &sourceChannel)
 
static ExpirationHandler::Handler fetchFromFairMQ (InputSpec const &spec, std::string const &channelName)
 
static ExpirationHandler::Handler fetchFromQARegistry ()
 
static ExpirationHandler::Handler fetchFromObjectRegistry ()
 
static ExpirationHandler::Handler enumerate (ConcreteDataMatcher const &spec, std::string const &sourceChannel, int64_t orbitOffset, int64_t orbitMultiplier)
 Enumerate entries on every invokation.
 
static ExpirationHandler::Handler dummy (ConcreteDataMatcher const &spec, std::string const &sourceChannel)
 Create a dummy message with the provided ConcreteDataMatcher.
 

Detailed Description

Lifetime handlers are used to manage the cases in which data is not coming from the dataflow, but from some other source or trigger, e.g., in the case condition data or time based triggers.

Definition at line 31 of file LifetimeHelpers.h.

Member Function Documentation

◆ dataDrivenCreation()

ExpirationHandler::Creator o2::framework::LifetimeHelpers::dataDrivenCreation ( )
static

Callback which does nothing, waiting for data to arrive.

Definition at line 63 of file LifetimeHelpers.cxx.

◆ doNothing()

ExpirationHandler::Handler o2::framework::LifetimeHelpers::doNothing ( )
static

Does nothing. Use this for cases where you do not want to do anything when records expire. This is the default behavior for data (which never expires via this mechanism).

Definition at line 325 of file LifetimeHelpers.cxx.

◆ dummy()

ExpirationHandler::Handler o2::framework::LifetimeHelpers::dummy ( ConcreteDataMatcher const &  spec,
std::string const &  sourceChannel 
)
static

Create a dummy message with the provided ConcreteDataMatcher.

Create a dummy (empty) message every time a record expires, suing spec as content of the payload.

Definition at line 449 of file LifetimeHelpers.cxx.

◆ enumDrivenCreation()

ExpirationHandler::Creator o2::framework::LifetimeHelpers::enumDrivenCreation ( size_t  first,
size_t  last,
size_t  step,
size_t  inputTimeslice,
size_t  maxTimeSliceId,
size_t  repetitions 
)
static

Callback which creates a new timeslice as soon as one is available and uses an incremental number as timestamp. repetitions number of times we should repeat the same value of the enumeration.

Definition at line 70 of file LifetimeHelpers.cxx.

◆ enumerate()

ExpirationHandler::Handler o2::framework::LifetimeHelpers::enumerate ( ConcreteDataMatcher const &  spec,
std::string const &  sourceChannel,
int64_t  orbitOffset,
int64_t  orbitMultiplier 
)
static

Enumerate entries on every invokation.

Enumerate entries on every invokation. matcher is the InputSpec which the given enumeration refers to. In particular messages created by the returned ExpirationHandler will have an header which matches the dataOrigin, dataDescrition and dataSpecification of the given route. The payload of each message will contain an incremental number for each message being created.

Definition at line 403 of file LifetimeHelpers.cxx.

◆ expectCTP()

static ExpirationHandler::Checker o2::framework::LifetimeHelpers::expectCTP ( std::string const &  serverUrl,
bool  waitForCTP 
)
static

Fetches CTP if not requested via waitForCTP and not available Sets DataTakingContext::orbitResetTime accordingly

◆ expireAlways()

ExpirationHandler::Checker o2::framework::LifetimeHelpers::expireAlways ( )
static

Callback which always expires records. To be used with, e.g. Lifetime::Transient.

Definition at line 205 of file LifetimeHelpers.cxx.

◆ expireIfPresent()

ExpirationHandler::Checker o2::framework::LifetimeHelpers::expireIfPresent ( std::vector< InputRoute > const &  schema,
ConcreteDataMatcher  matcher 
)
static

Callback which expires records based on the content of the record. To be used with, e.g. Lifetime::Optional.

Definition at line 210 of file LifetimeHelpers.cxx.

◆ expireNever()

ExpirationHandler::Checker o2::framework::LifetimeHelpers::expireNever ( )
static

Callback which never expires records. To be used with, e.g. Lifetime::Timeframe.

Definition at line 200 of file LifetimeHelpers.cxx.

◆ expireTimed()

ExpirationHandler::Checker o2::framework::LifetimeHelpers::expireTimed ( std::chrono::microseconds  period)
static

Callback which expires records with the rate given by period, in microseconds.

Definition at line 307 of file LifetimeHelpers.cxx.

◆ fetchFromCCDBCache()

static ExpirationHandler::Handler o2::framework::LifetimeHelpers::fetchFromCCDBCache ( InputSpec const &  spec,
std::string const &  prefix,
std::string const &  overrideTimestamp,
std::string const &  sourceChannel 
)
static

Build a fetcher for an object from CCDB when the record is expired. spec is the associated InputSpec prefix is the lookup prefix in CCDB overrideTimestamp can be used to override the timestamp found in the data.

◆ fetchFromFairMQ()

ExpirationHandler::Handler o2::framework::LifetimeHelpers::fetchFromFairMQ ( InputSpec const &  spec,
std::string const &  channelName 
)
static

Build a fetcher for an object from an out of band FairMQ channel whenever the record is expired. spec is the associated InputSpec channelName the channel we should Receive data from

Definition at line 363 of file LifetimeHelpers.cxx.

◆ fetchFromObjectRegistry()

ExpirationHandler::Handler o2::framework::LifetimeHelpers::fetchFromObjectRegistry ( )
static

Create an entry in the registry for histograms on the first FIXME: actually implement this FIXME: provide a way to customise the histogram from the configuration.

Definition at line 394 of file LifetimeHelpers.cxx.

◆ fetchFromQARegistry()

ExpirationHandler::Handler o2::framework::LifetimeHelpers::fetchFromQARegistry ( )
static

Create an entry in the registry for histograms on the first FIXME: actually implement this FIXME: provide a way to customise the histogram from the configuration.

Definition at line 383 of file LifetimeHelpers.cxx.

◆ timeDrivenCreation()

ExpirationHandler::Creator o2::framework::LifetimeHelpers::timeDrivenCreation ( std::vector< std::chrono::microseconds >  periods,
std::vector< std::chrono::seconds >  intervals,
std::function< bool(void)>  hasTimerFired,
std::function< void(uint64_t, uint64_t)>  updateTimerPeriod 
)
static

Callback which creates a new timeslice when timer expires and there is not a compatible datadriven callback available.

Definition at line 111 of file LifetimeHelpers.cxx.

◆ uvDrivenCreation()

ExpirationHandler::Creator o2::framework::LifetimeHelpers::uvDrivenCreation ( int  loopReason,
DeviceState state 
)
static

Callback which creates a new timeslice whenever some libuv event happens.

Not the expected loop reason, return an invalid slot.

Definition at line 254 of file LifetimeHelpers.cxx.


The documentation for this struct was generated from the following files: