Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the switch for old validity rules #2040

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Framework/src/AggregatorRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,7 @@ void AggregatorRunner::store(QualityObjectsType& qualityObjects)
auto validFrom = getCurrentTimestamp();
try {
for (auto& qo : qualityObjects) {
if (getenv("O2_QC_OLD_VALIDITY")) {
auto tmpValidity = qo->getValidity();
qo->setValidity(ValidityInterval{ static_cast<unsigned long>(validFrom), validFrom + 10ull * 365 * 24 * 60 * 60 * 1000 });
mDatabase->storeQO(qo);
qo->setValidity(tmpValidity);
} else {
mDatabase->storeQO(qo);
}
mDatabase->storeQO(qo);
}
if (!qualityObjects.empty()) {
auto& qo = qualityObjects.at(0);
Expand Down
23 changes: 4 additions & 19 deletions Framework/src/CheckRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -377,21 +377,13 @@ void CheckRunner::store(QualityObjectsType& qualityObjects, long validFrom)
ILOG(Debug, Devel) << "Storing " << qualityObjects.size() << " QualityObjects" << ENDM;
try {
for (auto& qo : qualityObjects) {
if (getenv("O2_QC_OLD_VALIDITY")) {
auto tmpValidity = qo->getValidity();
qo->setValidity(ValidityInterval{ static_cast<unsigned long>(validFrom), validFrom + 10ull * 365 * 24 * 60 * 60 * 1000 });
mDatabase->storeQO(qo);
qo->setValidity(tmpValidity);
} else {
mDatabase->storeQO(qo);
}
mDatabase->storeQO(qo);
mTotalNumberQOStored++;
mNumberQOStored++;
}

if (!qualityObjects.empty()) {
auto& qo = qualityObjects.at(0);
ILOG(Info, Devel) << "New validity of QO '" << qo->GetName() << "' is (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
ILOG(Info, Devel) << "Validity of QO '" << qo->GetName() << "' is (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
}
} catch (boost::exception& e) {
ILOG(Info, Support) << "Unable to " << diagnostic_information(e) << ENDM;
Expand All @@ -403,21 +395,14 @@ void CheckRunner::store(std::vector<std::shared_ptr<MonitorObject>>& monitorObje
ILOG(Debug, Devel) << "Storing " << monitorObjects.size() << " MonitorObjects" << ENDM;
try {
for (auto& mo : monitorObjects) {
if (getenv("O2_QC_OLD_VALIDITY")) {
auto tmpValidity = mo->getValidity();
mo->setValidity(ValidityInterval{ static_cast<unsigned long>(validFrom), validFrom + 10ull * 365 * 24 * 60 * 60 * 1000 });
mDatabase->storeMO(mo);
mo->setValidity(tmpValidity);
} else {
mDatabase->storeMO(mo);
}
mDatabase->storeMO(mo);

mTotalNumberMOStored++;
mNumberMOStored++;
}
if (!monitorObjects.empty()) {
auto& mo = monitorObjects.at(0);
ILOG(Info, Devel) << "New validity of MO '" << mo->GetName() << "' is (" << mo->getValidity().getMin() << ", " << mo->getValidity().getMax() << ")" << ENDM;
ILOG(Info, Devel) << "Validity of MO '" << mo->GetName() << "' is (" << mo->getValidity().getMin() << ", " << mo->getValidity().getMax() << ")" << ENDM;
}
} catch (boost::exception& e) {
ILOG(Info, Support) << "Unable to " << diagnostic_information(e) << ENDM;
Expand Down
16 changes: 6 additions & 10 deletions Framework/src/PostProcessingRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,13 @@ void PostProcessingRunner::reset()

void PostProcessingRunner::updateValidity(const Trigger& trigger)
{
if (getenv("O2_QC_OLD_VALIDITY")) {
mObjectManager->setValidity(ValidityInterval{ trigger.timestamp, trigger.timestamp + objectValidity });
} else if (trigger.activity.mValidity.isValid() && trigger.activity.mValidity != gFullValidityInterval) {
if (!core::activity_helpers::onNumericLimit(trigger.activity.mValidity.getMin())) {
mActivity.mValidity.update(trigger.activity.mValidity.getMin());
}
if (!core::activity_helpers::onNumericLimit(trigger.activity.mValidity.getMax())) {
mActivity.mValidity.update(trigger.activity.mValidity.getMax());
}
mObjectManager->setValidity(mActivity.mValidity);
if (!core::activity_helpers::onNumericLimit(trigger.activity.mValidity.getMin())) {
mActivity.mValidity.update(trigger.activity.mValidity.getMin());
}
if (!core::activity_helpers::onNumericLimit(trigger.activity.mValidity.getMax())) {
mActivity.mValidity.update(trigger.activity.mValidity.getMax());
}
mObjectManager->setValidity(mActivity.mValidity);
}

void PostProcessingRunner::doInitialize(const Trigger& trigger)
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/TaskRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ void TaskRunner::finishCycle(DataAllocator& outputs)
ILOG(Debug, Support) << "Finish cycle " << mCycleNumber << ENDM;
// in the async context we print only info/ops logs, it's easier to temporarily elevate this log
((mDeploymentMode == DeploymentMode::Grid) ? ILOG(Info, Ops) : ILOG(Info, Devel)) //
<< "According to new validity rules, the objects validity is "
<< "The objects validity is "
<< "(" << mTimekeeper->getValidity().getMin() << ", " << mTimekeeper->getValidity().getMax() << "), "
<< "(" << mTimekeeper->getSampleTimespan().getMin() << ", " << mTimekeeper->getSampleTimespan().getMax() << "), "
<< "(" << mTimekeeper->getTimerangeIdRange().getMin() << ", " << mTimekeeper->getTimerangeIdRange().getMax() << ")" << ENDM;
Expand Down
Loading