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 31 of file DBService.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file DBService.cc.

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

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

Definition at line 19 of file DBService.cc.

19 {}

Member Function Documentation

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

Definition at line 22 of file DBService.cc.

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

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

22  {
23  std::unique_lock<std::mutex> lock(m_mutex);
24 
25  return ISessionProxyPtr(std::unique_ptr<coral::ISessionProxy>(m_svc->connect(connectstring, coral::ReadOnly)),
26  std::move(lock));
27 }
std::unique_ptr< coral::ConnectionService > m_svc
Definition: DBService.h:39
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 40 of file DBService.h.

Referenced by DBService().

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

Definition at line 41 of file DBService.h.

Referenced by connectReadOnly().

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

Definition at line 39 of file DBService.h.

Referenced by connectReadOnly().