QualityControl
1.5.1
O2 Data Quality Control Framework
|
The interface to the MonitorObject's repository. More...
#include <DatabaseInterface.h>
Public Member Functions | |
DatabaseInterface ()=default | |
Default constructor. | |
virtual | ~DatabaseInterface ()=default |
Destructor. | |
virtual void | connect (std::string host, std::string database, std::string username, std::string password)=0 |
virtual void | connect (const std::unordered_map< std::string, std::string > &config)=0 |
virtual void | storeMO (std::shared_ptr< const o2::quality_control::core::MonitorObject > mo, long from=-1, long to=-1)=0 |
virtual void | storeQO (std::shared_ptr< const o2::quality_control::core::QualityObject > qo, long from=-1, long to=-1)=0 |
virtual std::shared_ptr< o2::quality_control::core::MonitorObject > | retrieveMO (std::string taskName, std::string objectName, long timestamp=-1)=0 |
Look up a monitor object and return it. Look up a monitor object and return it if found or nullptr if not. More... | |
virtual std::shared_ptr< o2::quality_control::core::QualityObject > | retrieveQO (std::string qoPath, long timestamp=-1)=0 |
Look up a quality object and return it. Look up a quality object and return it if found or nullptr if not. More... | |
virtual TObject * | retrieveTObject (std::string path, const std::map< std::string, std::string > &metadata, long timestamp=-1, std::map< std::string, std::string > *headers=nullptr)=0 |
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... | |
virtual std::string | retrieveMOJson (std::string taskName, std::string objectName, long timestamp=-1)=0 |
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... | |
virtual std::string | retrieveQOJson (std::string qoPath, long timestamp=-1)=0 |
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... | |
virtual std::string | retrieveJson (std::string path, long timestamp, const std::map< std::string, std::string > &metadata)=0 |
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... | |
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... | |
virtual void | disconnect ()=0 |
virtual void | prepareTaskDataContainer (std::string taskName)=0 |
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. | |
virtual std::vector< std::string > | getPublishedObjectNames (std::string taskName)=0 |
virtual void | truncate (std::string taskName, std::string objectName)=0 |
Static Public Attributes | |
static constexpr framework::ServiceKind | service_kind = framework::ServiceKind::Global |
The interface to the MonitorObject's repository.
|
pure virtual |
Connects to the database. For some implementations, this is a noop.
host | |
database | |
username | |
password |
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
Connects to the database. For some implementations, this is a noop.
config | map of values coming from configuration library. |
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
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".
path | the path of the object |
timestamp | the timestamp to query the object |
metadata | filters under the form of key-value pairs to select data |
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
inlinevirtual |
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.
path | the path to the object |
|
pure virtual |
Look up a monitor object and return it. Look up a monitor object and return it if found or nullptr if not.
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
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".
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
Look up a quality object and return it. Look up a quality object and return it if found or nullptr if not.
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
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".
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
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.
path | the path of the object |
timestamp | the timestamp to query the object |
headers | Map to be populated with the headers we received, if it is not null. |
metadata | filters under the form of key-value pairs to select data |
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
Stores the serialized MonitorObject in the database.
mo | The MonitorObject to serialize and store. |
from | The timestamp indicating the start of object's validity (ms since epoch). |
to | The timestamp indicating the end of object's validity (ms since epoch). |
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
Stores the serialized QualityObject in the database.
qo | The QualityObject to serialize and store. |
from | The timestamp indicating the start of object's validity (ms since epoch). |
to | The timestamp indicating the end of object's validity (ms since epoch). |
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.
|
pure virtual |
Delete all versions of a given object
taskName | Task sending the object |
objectName | Name of the object |
Implemented in o2::quality_control::repository::CcdbDatabase, o2::quality_control::repository::MySqlDatabase, and o2::quality_control::repository::DummyDatabase.