Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ add_library(O2QualityControl
src/Check.cxx
src/Aggregator.cxx
src/HashDataDescription.cxx
src/ServiceDiscovery.cxx
src/Triggers.cxx
src/TriggerHelpers.cxx
src/PostProcessingRunner.cxx
Expand Down
8 changes: 0 additions & 8 deletions Framework/include/QualityControl/AggregatorRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ class ConfigurationInterface;

namespace o2::quality_control
{
namespace core
{
class ServiceDiscovery;
}
namespace checker
{
class Aggregator;
Expand Down Expand Up @@ -150,7 +146,6 @@ class AggregatorRunner : public framework::Task

void initDatabase();
void initMonitoring();
void initServiceDiscovery();
void initLibraries();
void initAggregators();

Expand Down Expand Up @@ -203,9 +198,6 @@ class AggregatorRunner : public framework::Task
int mTotalNumberObjectsReceived;
int mTotalNumberAggregatorExecuted;
int mTotalNumberObjectsProduced;

// Service discovery
std::shared_ptr<core::ServiceDiscovery> mServiceDiscovery;
};

} // namespace o2::quality_control::checker
Expand Down
22 changes: 1 addition & 21 deletions Framework/include/QualityControl/ObjectsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
#include "QualityControl/MonitorObjectCollection.h"
#include <Mergers/Mergeable.h>
// stl
#include <concepts>
#include <string>
#include <memory>
#include <type_traits>

class TObject;

Expand All @@ -49,8 +46,6 @@ enum class PublicationPolicy {
Forever
};

class ServiceDiscovery;

/// \brief Keeps the list of encapsulated objects to publish and does the actual publication.
///
/// Keeps a list of the objects to publish, encapsulates them and does the actual publication.
Expand All @@ -69,7 +64,7 @@ class ObjectsManager
* @param parallelTaskID ID of a parallel Task, use 0 if there is only one.
* @param noDiscovery If true disables the use of ServiceDiscovery
*/
ObjectsManager(std::string taskName, std::string taskClass, std::string detectorName, std::string consulUrl, int parallelTaskID = 0, bool noDiscovery = false);
ObjectsManager(std::string taskName, std::string taskClass, std::string detectorName, int parallelTaskID = 0);
virtual ~ObjectsManager();

static const std::string gDrawOptionsKey;
Expand Down Expand Up @@ -202,19 +197,6 @@ class ObjectsManager
*/
MonitorObject* getMonitorObject(size_t index);

/**
* \brief Update the list of objects stored in the Service Discovery.
* Update the list of objects stored in the Service Discovery.
*/
void updateServiceDiscovery();

/**
* \brief Remove all objects from the ServiceDiscovery.
* Remove all objects from the ServiceDiscovery even though they still might be published by the task.
* This is typically used at End of Activity.
*/
void removeAllFromServiceDiscovery();

/**
* \brief Sets the validity interval of all registered objects.
*/
Expand All @@ -237,8 +219,6 @@ class ObjectsManager
std::string mTaskName;
std::string mTaskClass;
std::string mDetectorName;
std::unique_ptr<ServiceDiscovery> mServiceDiscovery;
bool mUpdateServiceDiscovery;
Activity mActivity;
std::vector<std::string> mMovingWindowsList;

Expand Down
1 change: 0 additions & 1 deletion Framework/include/QualityControl/PostProcessingRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <memory>
#include <functional>
#include <Framework/ServiceRegistryRef.h>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need that one, it's something else.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok !

#include <boost/property_tree/ptree_fwd.hpp>
#include "QualityControl/PostProcessingConfig.h"
#include "QualityControl/PostProcessingInterface.h"
Expand Down
87 changes: 0 additions & 87 deletions Framework/include/QualityControl/ServiceDiscovery.h

This file was deleted.

17 changes: 0 additions & 17 deletions Framework/src/AggregatorRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// QC
#include "QualityControl/DatabaseFactory.h"
#include "QualityControl/QcInfoLogger.h"
#include "QualityControl/ServiceDiscovery.h"
#include "QualityControl/Aggregator.h"
#include "QualityControl/runnerUtils.h"
#include "QualityControl/InfrastructureSpecReader.h"
Expand Down Expand Up @@ -73,9 +72,6 @@ AggregatorRunner::AggregatorRunner(AggregatorRunnerConfig arc, const std::vector
AggregatorRunner::~AggregatorRunner()
{
ILOG(Debug, Trace) << "AggregatorRunner destructor (" << this << ")" << ENDM;
if (mServiceDiscovery != nullptr) {
mServiceDiscovery->deregister();
}
}

void AggregatorRunner::prepareInputs()
Expand Down Expand Up @@ -127,7 +123,6 @@ void AggregatorRunner::init(framework::InitContext& iCtx)
}
initDatabase();
initMonitoring();
initServiceDiscovery();
initAggregators();
} catch (...) {
ILOG(Fatal) << "Unexpected exception during initialization: "
Expand Down Expand Up @@ -253,18 +248,6 @@ void AggregatorRunner::initMonitoring()
mTimer.reset(1000000); // 10 s.
}

void AggregatorRunner::initServiceDiscovery()
{
auto consulUrl = mRunnerConfig.consulUrl;
if (consulUrl.empty()) {
mServiceDiscovery = nullptr;
ILOG(Warning, Support) << "Service Discovery disabled" << ENDM;
return;
}
mServiceDiscovery = std::make_shared<ServiceDiscovery>(consulUrl, mDeviceName, mDeviceName);
ILOG(Info, Devel) << "ServiceDiscovery initialized";
}

void AggregatorRunner::initAggregators()
{
ILOG(Info, Devel) << "Initialization of the aggregators" << ENDM;
Expand Down
18 changes: 0 additions & 18 deletions Framework/src/CheckRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@
#include <utility>
// QC
#include "QualityControl/DatabaseFactory.h"
#include "QualityControl/ServiceDiscovery.h"
#include "QualityControl/runnerUtils.h"
#include "QualityControl/InfrastructureSpecReader.h"
#include "QualityControl/CheckRunnerFactory.h"
#include "QualityControl/RootClassFactory.h"
#include "QualityControl/ConfigParamGlo.h"
#include "QualityControl/Bookkeeping.h"
#include "QualityControl/WorkflowType.h"

#include <TSystem.h>

Expand Down Expand Up @@ -164,9 +162,6 @@ CheckRunner::CheckRunner(CheckRunnerConfig checkRunnerConfig, InputSpec input)
CheckRunner::~CheckRunner()
{
ILOG(Debug, Trace) << "CheckRunner destructor (" << this << ")" << ENDM;
if (mServiceDiscovery != nullptr) {
mServiceDiscovery->deregister();
}
}

void CheckRunner::init(framework::InitContext& iCtx)
Expand All @@ -176,7 +171,6 @@ void CheckRunner::init(framework::InitContext& iCtx)
Bookkeeping::getInstance().init(mConfig.bookkeepingUrl);
initDatabase();
initMonitoring();
initServiceDiscovery();
initLibraries(); // we have to load libraries before we load ConfigurableParams, otherwise the corresponding ROOT dictionaries won't be found

if (!ConfigParamGlo::keyValues.empty()) {
Expand Down Expand Up @@ -413,7 +407,6 @@ void CheckRunner::updateServiceDiscovery(const QualityObjectsType& qualityObject
objects += path + ",";
}
objects.pop_back(); // remove last comma
mServiceDiscovery->_register(objects);
}

void CheckRunner::initDatabase()
Expand All @@ -431,17 +424,6 @@ void CheckRunner::initMonitoring()
mTimer.reset(10000000); // 10 s.
}

void CheckRunner::initServiceDiscovery()
{
if (mConfig.consulUrl.empty()) {
mServiceDiscovery = nullptr;
ILOG(Warning, Support) << "Service Discovery disabled" << ENDM;
return;
}
mServiceDiscovery = std::make_shared<ServiceDiscovery>(mConfig.consulUrl, mDeviceName, mDeviceName);
ILOG(Info, Support) << "ServiceDiscovery initialized" << ENDM;
}

void CheckRunner::initLibraries()
{
std::set<std::string> moduleNames;
Expand Down
45 changes: 2 additions & 43 deletions Framework/src/ObjectsManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "QualityControl/ObjectsManager.h"

#include "QualityControl/QcInfoLogger.h"
#include "QualityControl/ServiceDiscovery.h"
#include "QualityControl/MonitorObjectCollection.h"
#include <Common/Exceptions.h>
#include <TObjArray.h>
Expand All @@ -36,23 +35,14 @@ namespace o2::quality_control::core
const std::string ObjectsManager::gDrawOptionsKey = "drawOptions";
const std::string ObjectsManager::gDisplayHintsKey = "displayHints";

ObjectsManager::ObjectsManager(std::string taskName, std::string taskClass, std::string detectorName, std::string consulUrl, int parallelTaskID, bool noDiscovery)
: mTaskName(std::move(taskName)), mTaskClass(std::move(taskClass)), mDetectorName(std::move(detectorName)), mUpdateServiceDiscovery(false)
ObjectsManager::ObjectsManager(std::string taskName, std::string taskClass, std::string detectorName, int parallelTaskID)
: mTaskName(std::move(taskName)), mTaskClass(std::move(taskClass)), mDetectorName(std::move(detectorName))
{
mMonitorObjects = std::make_unique<MonitorObjectCollection>();
mMonitorObjects->SetOwner(true);
mMonitorObjects->SetName(mTaskName.c_str());
mMonitorObjects->setDetector(mDetectorName);
mMonitorObjects->setTaskName(mTaskName);

// register with the discovery service
if (!noDiscovery && !consulUrl.empty()) {
std::string uniqueTaskID = mTaskName + "_" + std::to_string(parallelTaskID);
mServiceDiscovery = std::make_unique<ServiceDiscovery>(consulUrl, mTaskName, uniqueTaskID);
} else {
ILOG(Warning, Support) << "Service Discovery disabled" << ENDM;
mServiceDiscovery = nullptr;
}
}

ObjectsManager::~ObjectsManager()
Expand Down Expand Up @@ -81,39 +71,9 @@ void ObjectsManager::startPublishingImpl(TObject* object, PublicationPolicy publ
newObject->setActivity(mActivity);
newObject->setCreateMovingWindow(std::find(mMovingWindowsList.begin(), mMovingWindowsList.end(), object->GetName()) != mMovingWindowsList.end());
mMonitorObjects->Add(newObject);
mUpdateServiceDiscovery = true;
mPublicationPoliciesForMOs[newObject] = publicationPolicy;
}

void ObjectsManager::updateServiceDiscovery()
{
if (!mUpdateServiceDiscovery || mServiceDiscovery == nullptr) {
return;
}
// prepare the string of comma separated objects and publish it
string objects;
for (auto tobj : *mMonitorObjects) {
auto* mo = dynamic_cast<MonitorObject*>(tobj);
if (mo) {
objects += mo->getPath() + ",";
} else {
ILOG(Error, Devel) << "ObjectsManager::updateServiceDiscovery : dynamic_cast returned nullptr." << ENDM;
}
}
objects.pop_back();
mServiceDiscovery->_register(objects);
mUpdateServiceDiscovery = false;
}

void ObjectsManager::removeAllFromServiceDiscovery()
{
if (mServiceDiscovery == nullptr) {
return;
}
mServiceDiscovery->_register("");
mUpdateServiceDiscovery = true;
}

void ObjectsManager::stopPublishing(TObject* object)
{
if (!object) {
Expand Down Expand Up @@ -161,7 +121,6 @@ void ObjectsManager::stopPublishing(PublicationPolicy policy)

void ObjectsManager::stopPublishingAll()
{
removeAllFromServiceDiscovery();
mMonitorObjects->Clear();
mPublicationPoliciesForMOs.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/PostProcessingRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void PostProcessingRunner::init(const PostProcessingRunnerConfig& runnerConfig,
mSourceDatabase = configureDatabase(mRunnerConfig.sourceDatabase, "Source");
mDestinationDatabase = configureDatabase(mRunnerConfig.destinationDatabase, "Destination");

mObjectManager = std::make_shared<ObjectsManager>(mTaskConfig.taskName, mTaskConfig.className, mTaskConfig.detectorName, mRunnerConfig.consulUrl);
mObjectManager = std::make_shared<ObjectsManager>(mTaskConfig.taskName, mTaskConfig.className, mTaskConfig.detectorName);
mObjectManager->setActivity(mActivity);
mServices.registerService<DatabaseInterface>(mSourceDatabase.get());
if (mPublicationCallback == nullptr) {
Expand Down
Loading
Loading