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.

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 }

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

◆ ~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.

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 }

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

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

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.

lumi::service::DBService::m_svc
std::unique_ptr< coral::ConnectionService > m_svc
Definition: DBService.h:36
l1RCTOmdsFedVectorProducer_cfi.authpath
authpath
Definition: l1RCTOmdsFedVectorProducer_cfi.py:5
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CommonMethods.lock
def lock()
Definition: CommonMethods.py:81
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
lumi::service::DBService::m_dbconfig
std::unique_ptr< lumi::DBConfig > m_dbconfig
Definition: DBService.h:37
lumi::service::DBService::m_mutex
std::mutex m_mutex
Definition: DBService.h:38