QualityControl  1.5.1
O2 Data Quality Control Framework
o2::quality_control::repository::CcdbDatabase Class Reference
Inheritance diagram for o2::quality_control::repository::CcdbDatabase:
Collaboration diagram for o2::quality_control::repository::CcdbDatabase:

Public Member Functions

void connect (std::string host, std::string database, std::string username, std::string password) override
 
void connect (const std::unordered_map< std::string, std::string > &config) override
 
void storeMO (std::shared_ptr< const o2::quality_control::core::MonitorObject > q, long from=-1, long to=-1) override
 
void storeQO (std::shared_ptr< const o2::quality_control::core::QualityObject > q, long from=-1, long to=-1) override
 
std::shared_ptr< o2::quality_control::core::MonitorObjectretrieveMO (std::string taskName, std::string objectName, long timestamp=-1) override
 Look up a monitor object and return it. Look up a monitor object and return it if found or nullptr if not. More...
 
std::string retrieveMOJson (std::string taskName, std::string objectName, long timestamp=-1) override
 Look up a monitor object and return it in JSON format. Look up a monitor object and return it in JSON format if found or an empty string if not. The headers associated with the object are added to the JSON object under the key "metadata". More...
 
std::shared_ptr< o2::quality_control::core::QualityObjectretrieveQO (std::string qoPath, long timestamp=-1) override
 Look up a quality object and return it. Look up a quality object and return it if found or nullptr if not. More...
 
std::string retrieveQOJson (std::string qoPath, long timestamp=-1) override
 Look up a quality object and return it in JSON format. Look up a quality object and return it in JSON format if found or an empty string if not. The headers associated with the object are added to the JSON object under the key "metadata". More...
 
std::string retrieveJson (std::string path, long timestamp, const std::map< std::string, std::string > &metadata) override
 Look up an object and return it in JSON format. Look up an object and return it in JSON format if found or an empty string if not. The headers associated with the object are added to the JSON object under the key "metadata". More...
 
TObjectretrieveTObject (std::string path, const std::map< std::string, std::string > &metadata, long timestamp=-1, std::map< std::string, std::string > *headers=nullptr) override
 Look up an object and return it. Look up an object and return it if found or nullptr if not. It is a raw pointer because we might need it to build a MO. More...
 
void disconnect () override
 
void prepareTaskDataContainer (std::string taskName) override
 Prepare the container, such as a table in a relational database, that will contain the MonitorObject's for the given Task. If the container already exists, we do nothing.
 
std::vector< std::string > getPublishedObjectNames (std::string taskName) override
 
void truncate (std::string taskName, std::string objectName) override
 
void storeStreamerInfosToFile (std::string filename)
 
std::vector< std::string > getListing (std::string subpath="")
 
- Public Member Functions inherited from o2::quality_control::repository::DatabaseInterface
 DatabaseInterface ()=default
 Default constructor.
 
virtual ~DatabaseInterface ()=default
 Destructor.
 
virtual std::string retrieveJson (std::string path)
 Look up an object and return it in JSON format. Look up an object and return it in JSON format if found or an empty string if not. The headers associated with the object are added to the JSON object under the key "metadata". A default timestamp of -1 is used, usually meaning to use the current timestamp. More...
 

Static Public Member Functions

static long getCurrentTimestamp ()
 
static long getFutureTimestamp (int secondsInFuture)
 

Additional Inherited Members

- Static Public Attributes inherited from o2::quality_control::repository::DatabaseInterface
static constexpr framework::ServiceKind service_kind = framework::ServiceKind::Global
 

Member Function Documentation

void o2::quality_control::repository::CcdbDatabase::connect ( std::string  host,
std::string  database,
std::string  username,
std::string  password 
)
overridevirtual

Connects to the database. For some implementations, this is a noop.

Parameters
host
database
username
password
Deprecated:

Implements o2::quality_control::repository::DatabaseInterface.

void o2::quality_control::repository::CcdbDatabase::connect ( const std::unordered_map< std::string, std::string > &  config)
overridevirtual

Connects to the database. For some implementations, this is a noop.

Parameters
configmap of values coming from configuration library.

Implements o2::quality_control::repository::DatabaseInterface.

std::vector< std::string > o2::quality_control::repository::CcdbDatabase::getListing ( std::string  subpath = "")

Return the listing of folder and/or objects in the subpath.

Parameters
subpathThe folder we want to list the children of.
Returns
The listing of folder and/or objects at the subpath.
std::string o2::quality_control::repository::CcdbDatabase::retrieveJson ( std::string  path,
long  timestamp,
const std::map< std::string, std::string > &  metadata 
)
overridevirtual

Look up an object and return it in JSON format. Look up an object and return it in JSON format if found or an empty string if not. The headers associated with the object are added to the JSON object under the key "metadata".

Parameters
paththe path of the object
timestampthe timestamp to query the object
metadatafilters under the form of key-value pairs to select data

Implements o2::quality_control::repository::DatabaseInterface.

std::shared_ptr< core::MonitorObject > o2::quality_control::repository::CcdbDatabase::retrieveMO ( std::string  taskName,
std::string  objectName,
long  timestamp = -1 
)
overridevirtual

Look up a monitor object and return it. Look up a monitor object and return it if found or nullptr if not.

Deprecated:

Implements o2::quality_control::repository::DatabaseInterface.

std::string o2::quality_control::repository::CcdbDatabase::retrieveMOJson ( std::string  taskName,
std::string  objectName,
long  timestamp = -1 
)
overridevirtual

Look up a monitor object and return it in JSON format. Look up a monitor object and return it in JSON format if found or an empty string if not. The headers associated with the object are added to the JSON object under the key "metadata".

Deprecated:

Implements o2::quality_control::repository::DatabaseInterface.

std::shared_ptr< QualityObject > o2::quality_control::repository::CcdbDatabase::retrieveQO ( std::string  qoPath,
long  timestamp = -1 
)
overridevirtual

Look up a quality object and return it. Look up a quality object and return it if found or nullptr if not.

Deprecated:

Implements o2::quality_control::repository::DatabaseInterface.

std::string o2::quality_control::repository::CcdbDatabase::retrieveQOJson ( std::string  qoPath,
long  timestamp = -1 
)
overridevirtual

Look up a quality object and return it in JSON format. Look up a quality object and return it in JSON format if found or an empty string if not. The headers associated with the object are added to the JSON object under the key "metadata".

Deprecated:

Implements o2::quality_control::repository::DatabaseInterface.

TObject * o2::quality_control::repository::CcdbDatabase::retrieveTObject ( std::string  path,
const std::map< std::string, std::string > &  metadata,
long  timestamp = -1,
std::map< std::string, std::string > *  headers = nullptr 
)
overridevirtual

Look up an object and return it. Look up an object and return it if found or nullptr if not. It is a raw pointer because we might need it to build a MO.

Parameters
paththe path of the object
timestampthe timestamp to query the object
headersMap to be populated with the headers we received, if it is not null.
metadatafilters under the form of key-value pairs to select data

Implements o2::quality_control::repository::DatabaseInterface.

void o2::quality_control::repository::CcdbDatabase::storeMO ( std::shared_ptr< const o2::quality_control::core::MonitorObject mo,
long  from = -1,
long  to = -1 
)
overridevirtual

Stores the serialized MonitorObject in the database.

Parameters
moThe MonitorObject to serialize and store.
fromThe timestamp indicating the start of object's validity (ms since epoch).
toThe timestamp indicating the end of object's validity (ms since epoch).

Implements o2::quality_control::repository::DatabaseInterface.

void o2::quality_control::repository::CcdbDatabase::storeQO ( std::shared_ptr< const o2::quality_control::core::QualityObject qo,
long  from = -1,
long  to = -1 
)
overridevirtual

Stores the serialized QualityObject in the database.

Parameters
qoThe QualityObject to serialize and store.
fromThe timestamp indicating the start of object's validity (ms since epoch).
toThe timestamp indicating the end of object's validity (ms since epoch).

Implements o2::quality_control::repository::DatabaseInterface.

void o2::quality_control::repository::CcdbDatabase::truncate ( std::string  taskName,
std::string  objectName 
)
overridevirtual

Delete all versions of a given object

Parameters
taskNameTask sending the object
objectNameName of the object

Implements o2::quality_control::repository::DatabaseInterface.


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