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

[O2B-1010] Hide protobuf internals #2255

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
2 changes: 1 addition & 1 deletion Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ target_link_libraries(O2QualityControlTypes
ROOT::Hist
AliceO2::Common
O2::DataFormatsQualityControl
AliceO2::BookkeepingProtoApi
AliceO2::BookkeepingApi
)

add_root_dictionary(O2QualityControlTypes
Expand Down
6 changes: 3 additions & 3 deletions Framework/include/QualityControl/Bookkeeping.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define QC_CORE_BOOKKEEPING_H

#include <string>
#include "BookkeepingApi/BkpProtoClient.h"
#include "BookkeepingApi/BkpClient.h"

namespace o2::quality_control::core
{
Expand All @@ -37,14 +37,14 @@ class Bookkeeping
Bookkeeping(const Bookkeeping&) = delete;

void init(const std::string& url);
void registerProcess(int runNumber, const std::string& name, const std::string& detector, bookkeeping::DplProcessType type, const std::string& args);
void registerProcess(int runNumber, const std::string& name, const std::string& detector, bkp::DplProcessType type, const std::string& args);

private:
Bookkeeping() = default;

bool mInitialized = false;
std::string mUrl;
std::unique_ptr<bkp::api::proto::BkpProtoClient> mClient;
std::unique_ptr<bkp::api::BkpClient> mClient;
};

} // namespace o2::quality_control::core
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/AggregatorRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void AggregatorRunner::start(ServiceRegistryRef services)
if (gSystem->Getenv("O2_QC_REGISTER_IN_BK")) { // until we are sure it works, we have to turn it on
ILOG(Debug, Devel) << "Registering aggregator to BookKeeping" << ENDM;
try {
Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, AggregatorRunner::getDetectorName(mAggregators), bookkeeping::DPL_PROCESS_TYPE_QC_AGGREGATOR, "");
Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, AggregatorRunner::getDetectorName(mAggregators), bkp::DplProcessType::QC_AGGREGATOR, "");
} catch (std::runtime_error& error) {
ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM;
}
Expand Down
10 changes: 5 additions & 5 deletions Framework/src/Bookkeeping.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#include "QualityControl/Bookkeeping.h"
#include "QualityControl/QcInfoLogger.h"
#include "QualityControl/Activity.h"
#include "BookkeepingApi/BkpProtoClientFactory.h"
#include "BookkeepingApi/BkpProtoClient.h"
#include "BookkeepingApi/BkpClientFactory.h"
#include "BookkeepingApi/BkpClient.h"
#include <unistd.h>

using namespace o2::bkp::api::proto;
using namespace o2::bkp::api;

namespace o2::quality_control::core
{
Expand All @@ -43,7 +43,7 @@ void Bookkeeping::init(const std::string& url)
}

try {
mClient = BkpProtoClientFactory::create(url);
mClient = BkpClientFactory::create(url);
} catch (std::runtime_error& error) {
ILOG(Warning, Support) << "Error connecting to Bookkeeping: " << error.what() << ENDM;
return;
Expand All @@ -68,7 +68,7 @@ std::string getHostName()
}
}

void Bookkeeping::registerProcess(int runNumber, const std::string& name, const std::string& detector, bookkeeping::DplProcessType type, const std::string& args)
void Bookkeeping::registerProcess(int runNumber, const std::string& name, const std::string& detector, bkp::DplProcessType type, const std::string& args)
{
if (!mInitialized) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/CheckRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ void CheckRunner::start(ServiceRegistryRef services)
if (gSystem->Getenv("O2_QC_REGISTER_IN_BK")) { // until we are sure it works, we have to turn it on
ILOG(Debug, Devel) << "Registering checkRunner to BookKeeping" << ENDM;
try {
Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, mDetectorName, bookkeeping::DPL_PROCESS_TYPE_QC_CHECKER, "");
Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, mDetectorName, bkp::DplProcessType::QC_CHECKER, "");
} catch (std::runtime_error& error) {
ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM;
}
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/PostProcessingRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void PostProcessingRunner::start(framework::ServiceRegistryRef dplServices)
if (gSystem->Getenv("O2_QC_REGISTER_IN_BK")) { // until we are sure it works, we have to turn it on
ILOG(Debug, Devel) << "Registering pp task to BookKeeping" << ENDM;
try {
Bookkeeping::getInstance().registerProcess(mActivity.mId, mRunnerConfig.taskName, mRunnerConfig.detectorName, bookkeeping::DPL_PROCESS_TYPE_QC_POSTPROCESSING, "");
Bookkeeping::getInstance().registerProcess(mActivity.mId, mRunnerConfig.taskName, mRunnerConfig.detectorName, bkp::DplProcessType::QC_POSTPROCESSING, "");
} catch (std::runtime_error& error) {
ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM;
}
Expand Down
4 changes: 2 additions & 2 deletions Framework/src/TaskRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ void TaskRunner::registerToBookkeeping()
// register ourselves to the BK at the first cycle
ILOG(Debug, Devel) << "Registering taskRunner to BookKeeping" << ENDM;
try {
Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bookkeeping::DPL_PROCESS_TYPE_QC_TASK, "");
Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bkp::DplProcessType::QC_TASK, "");
if (gSystem->Getenv("O2_QC_REGISTER_IN_BK_X_TIMES")) {
ILOG(Debug, Devel) << "O2_QC_REGISTER_IN_BK_X_TIMES set to " << gSystem->Getenv("O2_QC_REGISTER_IN_BK_X_TIMES") << ENDM;
int iterations = std::stoi(gSystem->Getenv("O2_QC_REGISTER_IN_BK_X_TIMES"));
for (int i = 1; i < iterations; i++) { // start at 1 because we already did it once
Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bookkeeping::DPL_PROCESS_TYPE_QC_TASK, "");
Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bkp::DplProcessType::QC_TASK, "");
}
}
} catch (std::runtime_error& error) {
Expand Down
5 changes: 2 additions & 3 deletions Framework/src/runBookkeepingBenchmark.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
#include "QualityControl/Bookkeeping.h"
#include <iostream>
#include <boost/program_options.hpp>
#include "BookkeepingApi/BkpProtoClientFactory.h"
#include "BookkeepingApi/BkpClientFactory.h"
#include "QualityControl/Activity.h"
#include <Common/Timer.h>
#include "QualityControl/QcInfoLogger.h"

using namespace std;
namespace bpo = boost::program_options;
using namespace o2::bkp::api;
using namespace o2::bkp::api::proto;
using namespace o2::quality_control::core;

/**
Expand Down Expand Up @@ -73,7 +72,7 @@ int main(int argc, const char* argv[])
totalNumberOfExecutions++;
triggerTimer.reset(minDelay * 1000);
timer.reset();
Bookkeeping::getInstance().registerProcess(123, "asdf", "ITS", o2::bookkeeping::DPL_PROCESS_TYPE_NULL, "");
Bookkeeping::getInstance().registerProcess(123, "asdf", "ITS", o2::bkp::DplProcessType::_NULL, "");
auto duration = timer.getTime();
totalDuration += duration;
cycleDuration += duration;
Expand Down
Loading