Skip to content

Commit 9bd49ba

Browse files
committed
[QC-740] Fix inconsistencies between retrieveMO and retrieveQO
- adapt retrieveMO's signature to have it similar to retrieveQO.
1 parent 0106452 commit 9bd49ba

41 files changed

Lines changed: 100 additions & 104 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Framework/basic.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"config": {
44
"database": {
55
"implementation": "CCDB",
6-
"host": "localhost:8083",
6+
"host": "alio2-cr1-hv-ali-qcdb-test-gpn.cern.ch:8083",
77
"username": "not_applicable",
88
"password": "not_applicable",
99
"name": "not_applicable",
@@ -20,7 +20,7 @@
2020
"url": ""
2121
},
2222
"conditionDB": {
23-
"url": "localhost:8083"
23+
"url": "alio2-cr1-hv-ali-qcdb-test-gpn.cern.ch:8083"
2424
},
2525
"infologger": { "": "Configuration of the Infologger (optional).",
2626
"filterDiscardDebug": "false", "": "Set to true to discard debug and trace messages (default: false)",

‎Framework/include/QualityControl/CcdbDatabase.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ class CcdbDatabase : public DatabaseInterface
7777
const std::string& createdNotAfter = "", const std::string& createdNotBefore = "") override;
7878

7979
// retrieval - MO
80-
std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string objectPath, std::string objectName,
80+
std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string objectPath,
8181
long timestamp = Timestamp::Current,
8282
const core::Activity& activity = {},
8383
const std::map<std::string, std::string>& metadata = {}) override;
8484
// retrieval - QO
85-
std::shared_ptr<o2::quality_control::core::QualityObject> retrieveQO(std::string qoPath, long timestamp = Timestamp::Current,
85+
std::shared_ptr<o2::quality_control::core::QualityObject> retrieveQO(std::string qoPath,
86+
long timestamp = Timestamp::Current,
8687
const core::Activity& activity = {},
8788
const std::map<std::string, std::string>& metadata = {}) override;
8889

‎Framework/include/QualityControl/DatabaseInterface.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,12 @@ class DatabaseInterface
129129
/**
130130
* \brief Look up a monitor object and return it.
131131
* Look up a monitor object and return it if found or nullptr if not.
132-
* @param objectPath Path to the object without the provenance prefix
133-
* @param objectName Name of the object
132+
* @param objectPath Full path to the object (including the object name) without the provenance prefix
134133
* @param timestamp Timestamp of the object in ms since epoch
135134
* @param activity Activity of the object
136135
* @param metadata additional metadata to filter objects during retrieval
137136
*/
138-
virtual std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string objectPath, std::string objectName,
137+
virtual std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string objectPath,
139138
long timestamp = Timestamp::Current, const core::Activity& activity = {},
140139
const std::map<std::string, std::string>& metadata = {}) = 0;
141140
/**

‎Framework/include/QualityControl/DummyDatabase.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DummyDatabase : public DatabaseInterface
3535
std::string const& detectorName, std::string const& taskName, long from = -1, long to = -1) override;
3636
// MonitorObject
3737
void storeMO(std::shared_ptr<const o2::quality_control::core::MonitorObject> q) override;
38-
std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string taskName, std::string objectName, long timestamp = -1, const core::Activity& activity = {}, const std::map<std::string, std::string>& metadata = {}) override;
38+
std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string objectPath, long timestamp = -1, const core::Activity& activity = {}, const std::map<std::string, std::string>& metadata = {}) override;
3939
// QualityObject
4040
void storeQO(std::shared_ptr<const o2::quality_control::core::QualityObject> q) override;
4141
std::shared_ptr<o2::quality_control::core::QualityObject> retrieveQO(std::string checkerName, long timestamp = -1, const core::Activity& activity = {}, const std::map<std::string, std::string>& metadata = {}) override;

‎Framework/include/QualityControl/ReferenceUtils.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ namespace o2::quality_control::checker
3838
static std::shared_ptr<quality_control::core::MonitorObject> getReferencePlot(quality_control::repository::DatabaseInterface* qcdb, std::string& fullPath,
3939
core::Activity referenceActivity)
4040
{
41-
auto [success, path, name] = o2::quality_control::core::RepoPathUtils::splitObjectPath(fullPath);
42-
if (!success) {
41+
if (fullPath.find('/') == std::string::npos) {
4342
return nullptr;
4443
}
45-
return qcdb->retrieveMO(path, name, repository::DatabaseInterface::Timestamp::Latest, referenceActivity);
44+
return qcdb->retrieveMO(fullPath, repository::DatabaseInterface::Timestamp::Latest, referenceActivity);
4645
}
4746

4847
//_________________________________________________________________________________________

‎Framework/src/CcdbDatabase.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,12 @@ std::pair<std::string, TObject*> CcdbDatabase::retrieveQcObject(const std::strin
326326
return { fullPath, obj };
327327
}
328328

329-
std::shared_ptr<o2::quality_control::core::MonitorObject> CcdbDatabase::retrieveMO(std::string objectPath, std::string objectName,
329+
std::shared_ptr<o2::quality_control::core::MonitorObject> CcdbDatabase::retrieveMO(std::string objectPath,
330330
long timestamp, const core::Activity& activity,
331331
const std::map<std::string, std::string>& metadataToRetrieve)
332332
{
333333
map<string, string> headers;
334-
auto [fullPath, obj] = retrieveQcObject(objectPath + "/" + objectName, timestamp, activity, metadataToRetrieve, headers);
334+
auto [fullPath, obj] = retrieveQcObject(objectPath, timestamp, activity, metadataToRetrieve, headers);
335335
if (obj == nullptr) {
336336
return nullptr;
337337
}

‎Framework/src/DummyDatabase.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void DummyDatabase::storeMO(std::shared_ptr<const o2::quality_control::core::Mon
3838
{
3939
}
4040

41-
std::shared_ptr<o2::quality_control::core::MonitorObject> DummyDatabase::retrieveMO(std::string, std::string, long, const core::Activity& activity, const std::map<std::string, std::string>&)
41+
std::shared_ptr<o2::quality_control::core::MonitorObject> DummyDatabase::retrieveMO(std::string, long, const core::Activity& activity, const std::map<std::string, std::string>&)
4242
{
4343
return {};
4444
}

‎Framework/src/ReductorHelpers.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bool updateReductorImpl(Reductor* r, const Trigger& t, const std::string& path,
3535
}
3636

3737
if (type == "repository") {
38-
auto mo = qcdb.retrieveMO(path, name, t.timestamp, t.activity, t.metadata);
38+
auto mo = qcdb.retrieveMO(path + "/" + name, t.timestamp, t.activity, t.metadata);
3939
TObject* obj = mo ? mo->getObject() : nullptr;
4040
auto reductorTObject = dynamic_cast<ReductorTObject*>(r);
4141
if (obj && reductorTObject) {

‎Framework/src/SliceTrendingTask.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void SliceTrendingTask::initialize(Trigger t, framework::ServiceRegistryRef serv
130130
ILOG(Info, Support) << "Trying to retrieve an existing TTree for this task to continue the trend." << ENDM;
131131
auto& qcdb = services.get<repository::DatabaseInterface>();
132132
auto path = RepoPathUtils::getMoPath(mConfig.detectorName, PostProcessingInterface::getName(), "", "", false);
133-
auto mo = qcdb.retrieveMO(path, PostProcessingInterface::getName(), repository::DatabaseInterface::Timestamp::Latest);
133+
auto mo = qcdb.retrieveMO(path + "/" + PostProcessingInterface::getName(), repository::DatabaseInterface::Timestamp::Latest);
134134
if (mo && mo->getObject()) {
135135
auto tree = dynamic_cast<TTree*>(mo->getObject());
136136
if (tree) {
@@ -225,7 +225,7 @@ void SliceTrendingTask::trendValues(const Trigger& t,
225225
mNumberPads[dataSource.name] = 0;
226226
mSources[dataSource.name]->clear();
227227
if (dataSource.type == "repository") {
228-
auto mo = qcdb.retrieveMO(dataSource.path, dataSource.name, t.timestamp, t.activity, t.metadata);
228+
auto mo = qcdb.retrieveMO(dataSource.path + "/" + dataSource.name, t.timestamp, t.activity, t.metadata);
229229
TObject* obj = mo ? mo->getObject() : nullptr;
230230

231231
mAxisDivision[dataSource.name] = dataSource.axisDivision;

‎Framework/src/TrendingTask.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void TrendingTask::initializeTrend(o2::quality_control::repository::DatabaseInte
6262
if (mConfig.resumeTrend) {
6363
ILOG(Info, Support) << "Trying to retrieve an existing TTree for this task to continue the trend." << ENDM;
6464
auto path = RepoPathUtils::getMoPath(mConfig.detectorName, PostProcessingInterface::getName(), "", "", false);
65-
auto mo = qcdb.retrieveMO(path, PostProcessingInterface::getName(), repository::DatabaseInterface::Timestamp::Latest);
65+
auto mo = qcdb.retrieveMO(path + "/" + PostProcessingInterface::getName(), repository::DatabaseInterface::Timestamp::Latest);
6666
if (mo && mo->getObject()) {
6767
auto tree = dynamic_cast<TTree*>(mo->getObject());
6868
if (tree) {

0 commit comments

Comments
 (0)