CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
lumi::service::DBService Class Reference

#include <DBService.h>

Public Member Functions

ISessionProxyPtr connectReadOnly (const std::string &connectstring)
 
 DBService (const edm::ParameterSet &iConfig)
 
 ~DBService ()
 

Private Attributes

std::unique_ptr< lumi::DBConfigm_dbconfig
 
std::mutex m_mutex
 
std::unique_ptr< coral::ConnectionService > m_svc
 

Detailed Description

Definition at line 28 of file DBService.h.

Constructor & Destructor Documentation

◆ DBService()

lumi::service::DBService::DBService ( const edm::ParameterSet iConfig)

Definition at line 9 of file DBService.cc.

References l1RCTOmdsFedVectorProducer_cfi::authpath, edm::ParameterSet::getUntrackedParameter(), m_dbconfig, and AlCaHLTBitMon_QueryRunRegistry::string.

10  : m_svc(std::make_unique<coral::ConnectionService>()), m_dbconfig(std::make_unique<lumi::DBConfig>(*m_svc)) {
11  std::string authpath = iConfig.getUntrackedParameter<std::string>("authPath", "");
12  if (!authpath.empty()) {
13  m_dbconfig->setAuthentication(authpath);
14  }
15 }
std::unique_ptr< lumi::DBConfig > m_dbconfig
Definition: DBService.h:37
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< coral::ConnectionService > m_svc
Definition: DBService.h:36

◆ ~DBService()

lumi::service::DBService::~DBService ( )

Definition at line 17 of file DBService.cc.

17 {}

Member Function Documentation

◆ connectReadOnly()

lumi::service::ISessionProxyPtr lumi::service::DBService::connectReadOnly ( const std::string &  connectstring)

Definition at line 19 of file DBService.cc.

References CommonMethods::lock(), and eostools::move().

Referenced by LumiProducer::beginRun(), DIPLumiProducer::filldetailcache(), ExpressLumiProducer::fillLSCache(), LumiProducer::fillLSCache(), and DIPLumiProducer::fillsummarycache().

19  {
20  std::unique_lock<std::mutex> lock(m_mutex);
21 
22  return ISessionProxyPtr(std::unique_ptr<coral::ISessionProxy>(m_svc->connect(connectstring, coral::ReadOnly)),
23  std::move(lock));
24 }
std::unique_ptr< coral::ConnectionService > m_svc
Definition: DBService.h:36
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ m_dbconfig

std::unique_ptr<lumi::DBConfig> lumi::service::DBService::m_dbconfig
private

Definition at line 37 of file DBService.h.

Referenced by DBService().

◆ m_mutex

std::mutex lumi::service::DBService::m_mutex
private

Definition at line 38 of file DBService.h.

◆ m_svc

std::unique_ptr<coral::ConnectionService> lumi::service::DBService::m_svc
private

Definition at line 36 of file DBService.h.