Skip to content

Commit 3a24c2c

Browse files
justonedev1Michal Tichák
andauthored
[QC-1082] filter empty qos and mos in datasource (#2579)
Co-authored-by: Michal Tichák <michal.tichak@cern.ch>
1 parent 473bb30 commit 3a24c2c

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

Framework/src/InfrastructureSpecReader.cxx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,12 @@ DataSourceSpec InfrastructureSpecReader::readSpecEntry<DataSourceSpec>(const std
230230
dss.inputs = { { dss.name, TaskRunner::createTaskDataOrigin(detectorName), TaskRunner::createTaskDataDescription(dss.name), 0, Lifetime::Sporadic } };
231231
if (dataSourceTree.count("MOs") > 0) {
232232
for (const auto& moName : dataSourceTree.get_child("MOs")) {
233-
dss.subInputs.push_back(moName.second.get_value<std::string>());
233+
const auto mo = moName.second.get_value<std::string>();
234+
if (!mo.empty()) {
235+
dss.subInputs.push_back(std::move(mo));
236+
} else {
237+
ILOG(Warning, Ops) << "Data source of type Task with name: " << dss.name << " contains empty mo, ignoring, but configuration should be fixed." << ENDM;
238+
}
234239
}
235240
}
236241
break;
@@ -245,7 +250,12 @@ DataSourceSpec InfrastructureSpecReader::readSpecEntry<DataSourceSpec>(const std
245250
dss.inputs = { { dss.name, TaskRunner::createTaskDataOrigin(detectorName, true), TaskRunner::createTaskDataDescription(taskName), 0, Lifetime::Sporadic } };
246251
if (dataSourceTree.count("MOs") > 0) {
247252
for (const auto& moName : dataSourceTree.get_child("MOs")) {
248-
dss.subInputs.push_back(moName.second.get_value<std::string>());
253+
const auto mo = moName.second.get_value<std::string>();
254+
if (!mo.empty()) {
255+
dss.subInputs.push_back(std::move(mo));
256+
} else {
257+
ILOG(Warning, Ops) << "Data source of type TaskMovingWindow with name: " << dss.name << " contains empty mo, ignoring, but configuration should be fixed." << ENDM;
258+
}
249259
}
250260
}
251261
break;
@@ -270,7 +280,12 @@ DataSourceSpec InfrastructureSpecReader::readSpecEntry<DataSourceSpec>(const std
270280
dss.inputs = { { dss.name, Check::createCheckDataOrigin(detectorName), Check::createCheckDataDescription(dss.name), 0, Lifetime::Sporadic } };
271281
if (dataSourceTree.count("QOs") > 0) {
272282
for (const auto& moName : dataSourceTree.get_child("QOs")) {
273-
dss.subInputs.push_back(moName.second.get_value<std::string>());
283+
const auto qo = moName.second.get_value<std::string>();
284+
if (!qo.empty()) {
285+
dss.subInputs.push_back(std::move(qo));
286+
} else {
287+
ILOG(Warning, Ops) << "Data source of type Check with name: " << dss.name << " contains empty qo, ignoring, but configuration should be fixed." << ENDM;
288+
}
274289
}
275290
}
276291
break;
@@ -282,7 +297,12 @@ DataSourceSpec InfrastructureSpecReader::readSpecEntry<DataSourceSpec>(const std
282297
dss.inputs = { { dss.name, Check::createCheckDataOrigin(detectorName), AggregatorRunner::createAggregatorRunnerDataDescription(dss.name), 0, Lifetime::Sporadic } };
283298
if (dataSourceTree.count("QOs") > 0) {
284299
for (const auto& moName : dataSourceTree.get_child("QOs")) {
285-
dss.subInputs.push_back(moName.second.get_value<std::string>());
300+
const auto qo = moName.second.get_value<std::string>();
301+
if (!qo.empty()) {
302+
dss.subInputs.push_back(std::move(qo));
303+
} else {
304+
ILOG(Warning, Ops) << "Data source of type Aggregator with name: " << dss.name << " contains empty qo, ignoring, but configuration should be fixed." << ENDM;
305+
}
286306
}
287307
}
288308
break;

0 commit comments

Comments
 (0)