QualityControl  1.5.1
O2 Data Quality Control Framework
o2::quality_control::checker::UpdatePolicyManager Class Reference

#include <UpdatePolicyManager.h>

Collaboration diagram for o2::quality_control::checker::UpdatePolicyManager:

Public Member Functions

void updateGlobalRevision ()
 Update the global revision number. More...
 
void updateActorRevision (const std::string &actorName, RevisionType revision)
 Update the revision number associated with an actor. More...
 
void updateActorRevision (std::string actorName)
 
void updateObjectRevision (std::string objectName, RevisionType revision)
 Update the revision number associated with an object. More...
 
void updateObjectRevision (std::string objectName)
 
void addPolicy (std::string actorName, std::string policyType, std::vector< std::string > objectNames, bool allObjects, bool policyHelper)
 
bool isReady (const std::string &actorName)
 

Detailed Description

The UpdatePolicyManager is in charge of instantiating and keeping track of policies.

Naming:

  • a caller (e.g. CheckRunner or AggregatorRunner) holds an instance of the UpdatePolicyManager and drives it.
  • a policy determines whether something is ready to be done or not. It is a function returning a boolean.
  • an actor (e.g. Check or Aggregator) is in charge of executing something when a policy is fulfilled. There can be several actors for a caller. The actor is not aware of the UpdatePolicyManager.
  • the objects are received by the caller. They are processed by the actors and their status (e.g. freshly received) is used by some policies.
  • a revision is a number associated to each object to determine when it was received and associated to each actor to determine when it was last time triggered.

The following policies are available:

  • OnAny: triggers when an object is received that matches ANY object listed as a data source of the policy.
  • OnAnyNonZero: triggers only if all objects have been received at least once, then trigger the same way as onAny.
  • onAll: triggers when ALL objects listed as data source of the policy have been updated at least once.
  • onEachSeparately: synonym of 'onAny'. If "all" is specified as list of object, or the list is empty, we always trigger.

A typical caller code looks like this:

// when initializing
UpdatePolicyManager.addPolicy("actor1", "OnAny", {"object1"}, false, false);
// in run() loop :
// upon receiving new data, i.e. object1
UpdatePolicyManager.updateObjectRevision("object1");
// check if we should do something
if (UpdatePolicyManager.isReady("object1") {
doSomething();
UpdatePolicyManager.updateActorRevision("actor1");
}
UpdatePolicyManager.updateGlobalRevision();
// end run() loop

Member Function Documentation

void o2::quality_control::checker::UpdatePolicyManager::addPolicy ( std::string  actorName,
std::string  policyType,
std::vector< std::string >  objectNames,
bool  allObjects,
bool  policyHelper 
)

Add a policy for the given actor.

Parameters
actorName
policyTypeOne of the policy names: OnAll, OnAnyNonZero, OnEachSeparately, OnAny
objectNames
allObjects
policyHelper

Run check if all MOs are updated

Return true if any declared MOs were updated Guarantee that all declared MOs are available

Return true if any declared object were updated. This is the same behaviour as OnAny.

Return true if any MOs were updated. Inner policy - used for "MOs": "all" Might return true even if MO is not used in Check

Default behaviour

Run check if any declared MOs are updated Does not guarantee to contain all declared MOs

bool o2::quality_control::checker::UpdatePolicyManager::isReady ( const std::string &  actorName)

Checks whether the given actor is ready or not.

Parameters
actorName
Returns
void o2::quality_control::checker::UpdatePolicyManager::updateActorRevision ( const std::string &  actorName,
RevisionType  revision 
)

Update the revision number associated with an actor.

This function is typically called after the actor has been triggered based on its policy and its work is done.

Parameters
actorName
revision
void o2::quality_control::checker::UpdatePolicyManager::updateGlobalRevision ( )

Update the global revision number.

This function function should be called at the end of a processing loop (typically the run() method).

void o2::quality_control::checker::UpdatePolicyManager::updateObjectRevision ( std::string  objectName,
RevisionType  revision 
)

Update the revision number associated with an object.

This function is typically called after a new object has been received.

Parameters
objectName
revision

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