16 #ifndef QC_REPOSITORY_MYSQLDATABASE_H 17 #define QC_REPOSITORY_MYSQLDATABASE_H 19 #include <Common/Timer.h> 40 void connect(std::string host, std::string database, std::string username, std::string password)
override;
41 void connect(
const std::unordered_map<std::string, std::string>& config)
override;
43 void storeMO(std::shared_ptr<const o2::quality_control::core::MonitorObject> mo,
long from,
long to)
override;
44 std::shared_ptr<o2::quality_control::core::MonitorObject>
retrieveMO(std::string taskName, std::string objectName,
long timestamp = -1)
override;
45 std::string
retrieveMOJson(std::string taskName, std::string objectName,
long timestamp = -1)
override;
47 void storeQO(std::shared_ptr<const o2::quality_control::core::QualityObject> q,
long from,
long to)
override;
48 std::shared_ptr<o2::quality_control::core::QualityObject>
retrieveQO(std::string qoPath,
long timestamp = -1)
override;
49 std::string
retrieveQOJson(std::string qoPath,
long timestamp = -1)
override;
51 std::string
retrieveJson(std::string path,
long timestamp,
const std::map<std::string, std::string>& metadata)
override;
52 TObject*
retrieveTObject(std::string path,
const std::map<std::string, std::string>& metadata,
long timestamp = -1, std::map<std::string, std::string>* headers =
nullptr)
override;
54 void disconnect()
override;
55 std::vector<std::string> getPublishedObjectNames(std::string taskName)
override;
56 std::vector<std::string> getListOfTasksWithPublications();
57 void truncate(std::string taskName, std::string objectName)
override;
64 TMySQLResult* query(std::string sql);
70 bool execute(std::string sql);
76 void addIndex(std::string table, std::string column);
78 void prepareTaskDataContainer(std::string taskName)
override;
79 void prepareTable(std::string table_name);
82 void storeForMonitorObject(std::string taskName);
83 void storeForQualityObject(std::string checkName);
85 TMySQLServer* mServer;
89 std::map<std::string, std::vector<std::shared_ptr<const o2::quality_control::core::QualityObject>>> mQualityObjectsQueue;
90 std::map<std::string, std::vector<std::shared_ptr<const o2::quality_control::core::MonitorObject>>> mMonitorObjectsQueue;
92 AliceO2::Common::Timer lastStorage;
97 #endif // QC_REPOSITORY_MYSQLDATABASE_H Definition: AggregatorRunner.h:59
Implementation of the DatabaseInterface for MySQL.
Definition: MySqlDatabase.h:32
std::shared_ptr< o2::quality_control::core::QualityObject > retrieveQO(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...
Definition: MySqlDatabase.cxx:235
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 fou...
Definition: MySqlDatabase.cxx:466
MySqlDatabase()
Default constructor.
Definition: MySqlDatabase.cxx:38
~MySqlDatabase() override
Destructor.
Definition: MySqlDatabase.cxx:40
The interface to the MonitorObject's repository.
Definition: DatabaseInterface.h:35
void storeMO(std::shared_ptr< const o2::quality_control::core::MonitorObject > mo, long from, long to) override
Definition: MySqlDatabase.cxx:106
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...
Definition: MySqlDatabase.cxx:355
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...
Definition: MySqlDatabase.cxx:290
void truncate(std::string taskName, std::string objectName) override
Definition: MySqlDatabase.cxx:449
void storeQO(std::shared_ptr< const o2::quality_control::core::QualityObject > q, long from, long to) override
Definition: MySqlDatabase.cxx:95
std::shared_ptr< o2::quality_control::core::MonitorObject > retrieveMO(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...
Definition: MySqlDatabase.cxx:300
TObject * retrieveTObject(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...
Definition: MySqlDatabase.cxx:461
void connect(std::string host, std::string database, std::string username, std::string password) override
Definition: MySqlDatabase.cxx:42