16 #ifndef QC_REPOSITORY_DATABASEINTERFACE_H 17 #define QC_REPOSITORY_DATABASEINTERFACE_H 22 #include <unordered_map> 24 #include <Framework/ServiceRegistry.h> 26 #include "QualityControl/QualityObject.h" 38 constexpr
static framework::ServiceKind service_kind = framework::ServiceKind::Global;
54 virtual void connect(std::string host, std::string database, std::string username, std::string password) = 0;
60 virtual void connect(
const std::unordered_map<std::string, std::string>& config) = 0;
68 virtual void storeMO(std::shared_ptr<const o2::quality_control::core::MonitorObject> mo,
long from = -1,
long to = -1) = 0;
76 virtual void storeQO(std::shared_ptr<const o2::quality_control::core::QualityObject> qo,
long from = -1,
long to = -1) = 0;
83 virtual std::shared_ptr<o2::quality_control::core::MonitorObject>
retrieveMO(std::string taskName, std::string objectName,
long timestamp = -1) = 0;
89 virtual std::shared_ptr<o2::quality_control::core::QualityObject>
retrieveQO(std::string qoPath,
long timestamp = -1) = 0;
98 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;
106 virtual std::string
retrieveMOJson(std::string taskName, std::string objectName,
long timestamp = -1) = 0;
113 virtual std::string
retrieveQOJson(std::string qoPath,
long timestamp = -1) = 0;
122 virtual std::string
retrieveJson(std::string path,
long timestamp,
const std::map<std::string, std::string>& metadata) = 0;
132 std::map<std::string, std::string> metadata;
136 virtual void disconnect() = 0;
142 virtual std::vector<std::string> getPublishedObjectNames(std::string taskName) = 0;
148 virtual void truncate(std::string taskName, std::string objectName) = 0;
virtual ~DatabaseInterface()=default
Destructor.
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...
Definition: AggregatorRunner.h:59
virtual void prepareTaskDataContainer(std::string taskName)=0
Prepare the container, such as a table in a relational database, that will contain the MonitorObject'...
virtual void storeMO(std::shared_ptr< const o2::quality_control::core::MonitorObject > mo, long from=-1, long to=-1)=0
virtual void connect(std::string host, std::string database, std::string username, std::string password)=0
virtual void truncate(std::string taskName, std::string objectName)=0
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...
The interface to the MonitorObject's repository.
Definition: DatabaseInterface.h:35
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...
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 fou...
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...
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...
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 fou...
Definition: DatabaseInterface.h:130
DatabaseInterface()=default
Default constructor.
virtual void storeQO(std::shared_ptr< const o2::quality_control::core::QualityObject > qo, long from=-1, long to=-1)=0