CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
edm::service::SiteLocalConfigService Class Reference

#include <SiteLocalConfigService.h>

Inheritance diagram for edm::service::SiteLocalConfigService:
edm::SiteLocalConfig

Public Member Functions

std::string const dataCatalog (void) const override
 
unsigned int debugLevel () const override
 
bool enablePrefetching () const override
 
std::string const fallbackDataCatalog (void) const override
 
std::string const lookupCalibConnect (std::string const &input) const override
 
std::string const rfioType (void) const override
 
 SiteLocalConfigService (ParameterSet const &pset)
 
std::string const & siteName () const override
 
std::string const * sourceCacheHint () const override
 
double const * sourceCacheMinFree () const override
 
std::string const * sourceCacheTempDir () const override
 
std::string const * sourceCloneCacheHint () const override
 
std::vector< std::string > const * sourceNativeProtocols () const override
 
std::string const * sourceReadHint () const override
 
unsigned int const * sourceTimeout () const override
 
unsigned int const * sourceTTreeCacheSize () const override
 
struct addrinfo const * statisticsDestination () const override
 
std::set< std::string > const * statisticsInfo () const override
 
 ~SiteLocalConfigService ()
 
- Public Member Functions inherited from edm::SiteLocalConfig
 SiteLocalConfig ()
 
virtual ~SiteLocalConfig ()
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void computeStatisticsDestination ()
 
std::string const frontierConnect (std::string const &servlet) const
 
void parse (std::string const &url)
 

Private Attributes

std::string m_cacheHint
 
std::string const * m_cacheHintPtr
 
double m_cacheMinFree
 
double const * m_cacheMinFreePtr
 
std::string m_cacheTempDir
 
std::string const * m_cacheTempDirPtr
 
std::string m_cloneCacheHint
 
std::string const * m_cloneCacheHintPtr
 
bool m_connected
 
std::string m_dataCatalog
 
unsigned int m_debugLevel
 
bool m_enablePrefetching
 
bool const * m_enablePrefetchingPtr
 
std::string m_fallbackDataCatalog
 
std::string m_frontierConnect
 
std::vector< std::string > m_nativeProtocols
 
std::vector< std::string > const * m_nativeProtocolsPtr
 
std::string m_readHint
 
std::string const * m_readHintPtr
 
std::string m_rfioType
 
std::string m_siteName
 
edm::propagate_const< struct addrinfo * > m_statisticsAddrInfo
 
std::string m_statisticsDestination
 
std::set< std::string > m_statisticsInfo
 
bool m_statisticsInfoAvail
 
unsigned int m_timeout
 
unsigned int const * m_timeoutPtr
 
unsigned int m_ttreeCacheSize
 
unsigned int const * m_ttreeCacheSizePtr
 
std::string m_url
 

Static Private Attributes

static const std::string m_statisticsDefaultPort = "3334"
 

Detailed Description

Definition at line 24 of file SiteLocalConfigService.h.

Constructor & Destructor Documentation

edm::service::SiteLocalConfigService::SiteLocalConfigService ( ParameterSet const &  pset)
explicit

Definition at line 79 of file SiteLocalConfigService.cc.

References computeStatisticsDestination(), mps_splice::entry, edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameter(), m_cacheHint, m_cacheHintPtr, m_cacheMinFree, m_cacheMinFreePtr, m_cacheTempDir, m_cacheTempDirPtr, m_cloneCacheHint, m_cloneCacheHintPtr, m_debugLevel, m_enablePrefetching, m_enablePrefetchingPtr, m_nativeProtocols, m_nativeProtocolsPtr, m_readHint, m_readHintPtr, m_statisticsDestination, m_statisticsInfo, m_statisticsInfoAvail, m_timeout, m_timeoutPtr, m_ttreeCacheSize, m_ttreeCacheSizePtr, m_url, eostools::move(), parse(), AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

79  :
80  m_url("/SITECONF/local/JobConfig/site-local-config.xml"),
81  m_dataCatalog(),
84  m_rfioType("castor"),
85  m_connected(false),
87  m_cacheTempDirPtr(nullptr),
89  m_cacheMinFreePtr(nullptr),
90  m_cacheHint(),
91  m_cacheHintPtr(nullptr),
93  m_cloneCacheHintPtr(nullptr),
94  m_readHint(),
95  m_readHintPtr(nullptr),
97  m_ttreeCacheSizePtr(nullptr),
98  m_timeout(0U),
99  m_timeoutPtr(nullptr),
100  m_debugLevel(0U),
101  m_enablePrefetching(false),
102  m_enablePrefetchingPtr(nullptr),
104  m_nativeProtocolsPtr(nullptr),
106  m_statisticsAddrInfo(nullptr),
107  m_statisticsInfoAvail(false),
108  m_siteName()
109  {
110  char* tmp = getenv("CMS_PATH");
111 
112  if (tmp) {
113  m_url = tmp + m_url;
114  }
115 
116  this->parse(m_url);
117 
118  //apply overrides
119  overrideFromPSet("overrideSourceCacheTempDir", pset, m_cacheTempDir, m_cacheTempDirPtr);
120  overrideFromPSet("overrideSourceCacheMinFree", pset, m_cacheMinFree, m_cacheMinFreePtr);
121  overrideFromPSet("overrideSourceCacheHintDir", pset, m_cacheHint, m_cacheHintPtr);
122  overrideFromPSet("overrideSourceCloneCacheHintDir", pset, m_cloneCacheHint, m_cloneCacheHintPtr);
123  overrideFromPSet("overrideSourceReadHint", pset, m_readHint, m_readHintPtr);
124  overrideFromPSet("overrideSourceNativeProtocols", pset, m_nativeProtocols, m_nativeProtocolsPtr);
125  overrideFromPSet("overrideSourceTTreeCacheSize", pset, m_ttreeCacheSize, m_ttreeCacheSizePtr);
126  overrideFromPSet("overrideSourceTimeout", pset, m_timeout, m_timeoutPtr);
127  overrideFromPSet("overridePrefetching", pset, m_enablePrefetching, m_enablePrefetchingPtr);
128  const std::string * tmpStringPtr = nullptr;
129  overrideFromPSet("overrideStatisticsDestination", pset, m_statisticsDestination, tmpStringPtr);
131  std::vector<std::string> tmpStatisticsInfo; std::vector<std::string> const *tmpStatisticsInfoPtr = nullptr;
132  overrideFromPSet("overrideStatisticsInfo", pset, tmpStatisticsInfo, tmpStatisticsInfoPtr);
133  if (tmpStatisticsInfoPtr) {
134  m_statisticsInfoAvail = true;
135  m_statisticsInfo.clear();
136  for (auto &entry : tmpStatisticsInfo) {m_statisticsInfo.insert(std::move(entry));}
137  }
138 
139  if(pset.exists("debugLevel")) {
140  m_debugLevel = pset.getUntrackedParameter<unsigned int>("debugLevel");
141  }
142 
143  }
std::vector< std::string > const * m_nativeProtocolsPtr
edm::propagate_const< struct addrinfo * > m_statisticsAddrInfo
std::vector< std::string > m_nativeProtocols
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
def move(src, dest)
Definition: eostools.py:510
edm::service::SiteLocalConfigService::~SiteLocalConfigService ( )

Definition at line 145 of file SiteLocalConfigService.cc.

References m_statisticsAddrInfo, and AlCaHLTBitMon_QueryRunRegistry::string.

145  {
146  if (m_statisticsAddrInfo) {
147  freeaddrinfo(m_statisticsAddrInfo);
148  m_statisticsAddrInfo = nullptr;
149  }
150  }
edm::propagate_const< struct addrinfo * > m_statisticsAddrInfo

Member Function Documentation

void edm::service::SiteLocalConfigService::computeStatisticsDestination ( )
private

Definition at line 528 of file SiteLocalConfigService.cc.

References MillePedeFileConverter_cfg::e, query::host, m_statisticsAddrInfo, m_statisticsDefaultPort, m_statisticsDestination, query::port, split, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiteLocalConfigService().

528  {
529  std::vector<std::string> inputStrings;
530  boost::split(inputStrings, m_statisticsDestination, boost::is_any_of(":"));
531  const std::string &host=inputStrings[0];
532  const std::string &port = (inputStrings.size() > 1) ? inputStrings[1] : m_statisticsDefaultPort;
533  struct addrinfo *res;
534  struct addrinfo hints;
535  memset(&hints, '\0', sizeof(hints));
536  hints.ai_socktype = SOCK_DGRAM;
537  hints.ai_flags = AI_ADDRCONFIG;
538  hints.ai_family = AF_UNSPEC;
539  int e = getaddrinfo(host.c_str(), port.c_str(), &hints, &res);
540  if (e != 0) {
541  // Silent failure - there's no way to report non-fatal failures from here.
542  return;
543  }
544  m_statisticsAddrInfo = res;
545  }
host
Definition: query.py:114
static const std::string m_statisticsDefaultPort
port
Definition: query.py:115
Definition: Electron.h:4
edm::propagate_const< struct addrinfo * > m_statisticsAddrInfo
double split
Definition: MVATrainer.cc:139
std::string const edm::service::SiteLocalConfigService::dataCatalog ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 153 of file SiteLocalConfigService.cc.

References Exception, m_connected, m_dataCatalog, m_url, and AlCaHLTBitMon_QueryRunRegistry::string.

153  {
154  if (!m_connected) {
155  //throw cms::Exception("Incomplete configuration")
156  // << "Valid site-local-config not found at " << m_url;
157  // Return PoolFileCatalog.xml for now
158  return "file:PoolFileCatalog.xml";
159  }
160 
161  if (m_dataCatalog == "") {
162  throw cms::Exception("Incomplete configuration")
163  << "Did not find catalog in event-data section in " << m_url;
164  }
165 
166  return m_dataCatalog;
167  }
unsigned int edm::service::SiteLocalConfigService::debugLevel ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 298 of file SiteLocalConfigService.cc.

References m_debugLevel.

298  {
299  return m_debugLevel;
300  }
bool edm::service::SiteLocalConfigService::enablePrefetching ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 293 of file SiteLocalConfigService.cc.

References m_enablePrefetchingPtr.

293  {
295  }
std::string const edm::service::SiteLocalConfigService::fallbackDataCatalog ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 170 of file SiteLocalConfigService.cc.

References m_connected, m_fallbackDataCatalog, and AlCaHLTBitMon_QueryRunRegistry::string.

170  {
171  if (!m_connected) {
172  //throw cms::Exception("Incomplete configuration")
173  // << "Valid site-local-config not found at " << m_url;
174  // Return PoolFileCatalog.xml for now
175  return "file:PoolFileCatalog.xml";
176  }
177 
178  // Note: Unlike the dataCatalog, the fallbackDataCatalog may be empty!
179  return m_fallbackDataCatalog;
180  }
void edm::service::SiteLocalConfigService::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 548 of file SiteLocalConfigService.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addOptionalUntracked(), edm::ParameterSetDescription::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

548  {
550  desc.setComment("Service to translate logical file names to physical file names.");
551 
552  desc.addOptionalUntracked<std::string>("overrideSourceCacheTempDir");
553  desc.addOptionalUntracked<double>("overrideSourceCacheMinFree");
554  desc.addOptionalUntracked<std::string>("overrideSourceCacheHintDir");
555  desc.addOptionalUntracked<std::string>("overrideSourceCloneCacheHintDir")
556  ->setComment("Provide an alternate cache hint for fast cloning.");
557  desc.addOptionalUntracked<std::string>("overrideSourceReadHint");
558  desc.addOptionalUntracked<std::vector<std::string> >("overrideSourceNativeProtocols");
559  desc.addOptionalUntracked<unsigned int>("overrideSourceTTreeCacheSize");
560  desc.addOptionalUntracked<unsigned int>("overrideSourceTimeout");
561  desc.addOptionalUntracked<unsigned int>("debugLevel");
562  desc.addOptionalUntracked<bool>("overridePrefetching")
563  ->setComment("Request ROOT to asynchronously prefetch I/O during computation.");
564  desc.addOptionalUntracked<std::string>("overrideStatisticsDestination")
565  ->setComment("Provide an alternate network destination for I/O statistics (must be in the form of host:port).");
566  desc.addOptionalUntracked<std::vector<std::string> >("overrideStatisticsInfo")
567  ->setComment("Provide an alternate listing of statistics to send (comma separated list; current options are 'dn' or 'nodn'). If left blank, all information is snet (including DNs).");
568 
569  descriptions.add("SiteLocalConfigService", desc);
570  }
std::string const edm::service::SiteLocalConfigService::frontierConnect ( std::string const &  servlet) const
private

Definition at line 183 of file SiteLocalConfigService.cc.

References Exception, m_connected, m_frontierConnect, m_url, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by lookupCalibConnect(), and parse().

183  {
184  if (!m_connected) {
185  throw cms::Exception("Incomplete configuration")
186  << "Valid site-local-config not found at " << m_url;
187  }
188 
189  if (m_frontierConnect == "") {
190  throw cms::Exception("Incomplete configuration")
191  << "Did not find frontier-connect in calib-data section in " << m_url;
192  }
193 
194  if (servlet == "") {
195  return m_frontierConnect;
196  }
197 
198  // Replace the last component of every "serverurl=" piece (up to the
199  // next close-paren) with the servlet
200  std::string::size_type nextparen = 0;
201  std::string::size_type serverurl, lastslash;
202  std::string complexstr = "";
203  while ((serverurl = m_frontierConnect.find("(serverurl=", nextparen)) != std::string::npos) {
204  complexstr.append(m_frontierConnect, nextparen, serverurl - nextparen);
205  nextparen = m_frontierConnect.find(')', serverurl);
206  lastslash = m_frontierConnect.rfind('/', nextparen);
207  complexstr.append(m_frontierConnect, serverurl, lastslash - serverurl + 1);
208  complexstr.append(servlet);
209  }
210  complexstr.append(m_frontierConnect, nextparen, m_frontierConnect.length()-nextparen);
211 
212  return complexstr;
213  }
uint16_t size_type
std::string const edm::service::SiteLocalConfigService::lookupCalibConnect ( std::string const &  input) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 216 of file SiteLocalConfigService.cc.

References frontierConnect(), input, and AlCaHLTBitMon_QueryRunRegistry::string.

216  {
217  static std::string const proto = "frontier://";
218 
219  if (input.substr(0,proto.length()) == proto) {
220  // Replace the part after the frontier:// and before either an open-
221  // parentheses (which indicates user-supplied options) or the last
222  // slash (which indicates start of the schema) with the complex
223  // parenthesized string returned from frontierConnect() (which
224  // contains all the information needed to connect to frontier),
225  // if that part is a simple servlet name (non-empty and not
226  // containing special characters)
227  // Example connect strings where servlet is replaced:
228  // frontier://cms_conditions_data/CMS_COND_ECAL
229  // frontier://FrontierInt/CMS_COND_ECAL
230  // frontier://FrontierInt(retrieve-ziplevel=0)/CMS_COND_ECAL
231  // Example connect strings left untouched:
232  // frontier://cmsfrontier.cern.ch:8000/FrontierInt/CMS_COND_ECAL
233  // frontier://(serverurl=cmsfrontier.cern.ch:8000/FrontierInt)/CMS_COND_ECAL
234  std::string::size_type startservlet = proto.length();
235  // if user supplied extra parenthesized options, stop servlet there
236  std::string::size_type endservlet = input.find("(", startservlet);
237  if (endservlet == std::string::npos) {
238  endservlet = input.rfind('/', input.length());
239  }
240  std::string servlet = input.substr(startservlet, endservlet - startservlet);
241  if ((servlet != "") && (servlet.find_first_of(":/)[]") == std::string::npos)) {
242  if (servlet == "cms_conditions_data") {
243  // use the default servlet from site-local-config.xml
244  servlet = "";
245  }
246  return proto + frontierConnect(servlet) + input.substr(endservlet);
247  }
248  }
249  return input;
250  }
uint16_t size_type
static std::string const input
Definition: EdmProvDump.cc:44
std::string const frontierConnect(std::string const &servlet) const
void edm::service::SiteLocalConfigService::parse ( std::string const &  url)
private

Definition at line 323 of file SiteLocalConfigService.cc.

References getEcalConditions_orcoffint2r_cff::catalog, MillePedeFileConverter_cfg::e, frontierConnect(), mps_fire::i, m_cacheHint, m_cacheHintPtr, m_cacheMinFree, m_cacheMinFreePtr, m_cacheTempDir, m_cacheTempDirPtr, m_cloneCacheHint, m_cloneCacheHintPtr, m_connected, m_dataCatalog, m_enablePrefetching, m_enablePrefetchingPtr, m_fallbackDataCatalog, m_frontierConnect, m_nativeProtocols, m_nativeProtocolsPtr, m_readHint, m_readHintPtr, m_rfioType, m_siteName, m_statisticsDestination, m_statisticsInfo, m_statisticsInfoAvail, m_timeout, m_timeoutPtr, m_ttreeCacheSize, m_ttreeCacheSizePtr, createfilelist::parser, split, AlCaHLTBitMon_QueryRunRegistry::string, cms::xerces::toBool(), cms::xerces::toDouble(), toolbox::toString(), cms::xerces::toUInt(), cms::xerces::uStr(), cms::concurrency::xercesInitialize(), and cms::concurrency::xercesTerminate().

Referenced by SiteLocalConfigService().

323  {
325  {
326  auto parser = std::make_unique<XercesDOMParser>();
327  try {
328  parser->setValidationScheme(XercesDOMParser::Val_Auto);
329  parser->setDoNamespaces(false);
330 
331  parser->parse(url.c_str());
332  DOMDocument* doc = parser->getDocument();
333  if (!doc) {
334  return;
335  }
336 
337  // The Site Config has the following format
338  // <site-local-config>
339  // <site name="FNAL">
340  // <event-data>
341  // <catalog url="trivialcatalog_file:/x/y/z.xml"/>
342  // <rfiotype value="castor"/>
343  // </event-data>
344  // <calib-data>
345  // <catalog url="trivialcatalog_file:/x/y/z.xml"/>
346  // <frontier-connect>
347  // ... frontier-interpreted server/proxy xml ...
348  // </frontier-connect>
349  // </calib-data>
350  // <source-config>
351  // <cache-temp-dir name="/a/b/c"/>
352  // <cache-hint value="..."/>
353  // <read-hint value="..."/>
354  // <ttree-cache-size value="0"/>
355  // <native-protocols>
356  // <protocol prefix="dcache"/>
357  // <protocol prefix="file"/>
358  // </native-protocols>
359  // </source-config>
360  // </site>
361  // </site-local-config>
362 
363  // FIXME: should probably use the parser for validating the XML.
364 
365  DOMNodeList *sites = doc->getElementsByTagName(uStr("site").ptr());
366  XMLSize_t numSites = sites->getLength();
367  for (XMLSize_t i = 0; i < numSites; ++i) {
368  DOMElement *site = static_cast<DOMElement *>(sites->item(i));
369 
370  // Parse the site name
371  m_siteName = toString(site->getAttribute(uStr("name").ptr()));
372 
373  // Parsing of the event data section
374  {
375  DOMNodeList *eventDataList = site->getElementsByTagName(uStr("event-data").ptr());
376  if (eventDataList->getLength() > 0) {
377  DOMElement *eventData = static_cast<DOMElement *>(eventDataList->item(0));
378 
379  DOMNodeList *catalogs = eventData->getElementsByTagName(uStr("catalog").ptr());
380 
381  if (catalogs->getLength() > 0) {
382  DOMElement * catalog = static_cast<DOMElement *>(catalogs->item(0));
383  m_dataCatalog = toString(catalog->getAttribute(uStr("url").ptr()));
384  }
385 
386  if (catalogs->getLength() > 1) {
387  DOMElement * catalog = static_cast<DOMElement *>(catalogs->item(1));
388  m_fallbackDataCatalog = toString(catalog->getAttribute(uStr("url").ptr()));
389  }
390 
391  DOMNodeList* rfiotypes = eventData->getElementsByTagName(uStr("rfiotype").ptr());
392 
393  if (rfiotypes->getLength() > 0) {
394  DOMElement* rfiotype = static_cast<DOMElement *>(rfiotypes->item(0));
395  m_rfioType = toString(rfiotype->getAttribute(uStr("value").ptr()));
396  }
397  }
398  }
399 
400  // Parsing of the calib-data section
401  {
402  DOMNodeList *calibDataList = site->getElementsByTagName(uStr("calib-data").ptr());
403 
404  if (calibDataList->getLength() > 0) {
405  DOMElement *calibData = static_cast<DOMElement *>(calibDataList->item(0));
406  DOMNodeList *frontierConnectList = calibData->getElementsByTagName(uStr("frontier-connect").ptr());
407 
408  if (frontierConnectList->getLength() > 0) {
409  DOMElement *frontierConnect = static_cast<DOMElement *>(frontierConnectList->item(0));
410  m_frontierConnect = _toParenString(*frontierConnect);
411  }
412  }
413  }
414  // Parsing of the source config section
415  {
416  DOMNodeList *sourceConfigList = site->getElementsByTagName(uStr("source-config").ptr());
417 
418  if (sourceConfigList->getLength() > 0) {
419  DOMElement *sourceConfig = static_cast<DOMElement *>(sourceConfigList->item(0));
420  DOMNodeList *cacheTempDirList = sourceConfig->getElementsByTagName(uStr("cache-temp-dir").ptr());
421 
422  if (cacheTempDirList->getLength() > 0) {
423  DOMElement *cacheTempDir = static_cast<DOMElement *>(cacheTempDirList->item(0));
424  m_cacheTempDir = toString(cacheTempDir->getAttribute(uStr("name").ptr()));
426  }
427 
428  DOMNodeList *cacheMinFreeList = sourceConfig->getElementsByTagName(uStr("cache-min-free").ptr());
429 
430  if (cacheMinFreeList->getLength() > 0) {
431  DOMElement *cacheMinFree = static_cast<DOMElement *>(cacheMinFreeList->item(0));
432  m_cacheMinFree = toDouble(cacheMinFree->getAttribute(uStr("value").ptr()));
434  }
435 
436  DOMNodeList *cacheHintList = sourceConfig->getElementsByTagName(uStr("cache-hint").ptr());
437 
438  if (cacheHintList->getLength() > 0) {
439  DOMElement *cacheHint = static_cast<DOMElement *>(cacheHintList->item(0));
440  m_cacheHint = toString(cacheHint->getAttribute(uStr("value").ptr()));
442  }
443 
444  DOMNodeList *cloneCacheHintList = sourceConfig->getElementsByTagName(uStr("clone-cache-hint").ptr());
445 
446  if (cloneCacheHintList->getLength() > 0) {
447  DOMElement *cloneCacheHint = static_cast<DOMElement *>(cloneCacheHintList->item(0));
448  m_cloneCacheHint = toString(cloneCacheHint->getAttribute(uStr("value").ptr()));
450  }
451 
452  DOMNodeList *readHintList = sourceConfig->getElementsByTagName(uStr("read-hint").ptr());
453 
454  if (readHintList->getLength() > 0) {
455  DOMElement *readHint = static_cast<DOMElement *>(readHintList->item(0));
456  m_readHint = toString(readHint->getAttribute(uStr("value").ptr()));
458  }
459 
460  DOMNodeList *ttreeCacheSizeList = sourceConfig->getElementsByTagName(uStr("ttree-cache-size").ptr());
461 
462  if (ttreeCacheSizeList->getLength() > 0) {
463  DOMElement *ttreeCacheSize = static_cast<DOMElement *>(ttreeCacheSizeList->item(0));
464  m_ttreeCacheSize = toUInt(ttreeCacheSize->getAttribute(uStr("value").ptr()));
466  }
467 
468  DOMNodeList *timeoutList = sourceConfig->getElementsByTagName(uStr("timeout-in-seconds").ptr());
469 
470  if (timeoutList->getLength() > 0) {
471  DOMElement *timeout = static_cast<DOMElement *>(timeoutList->item(0));
472  m_timeout = toUInt(timeout->getAttribute(uStr("value").ptr()));
474  }
475 
476  DOMNodeList *statsDestList = sourceConfig->getElementsByTagName(uStr("statistics-destination").ptr());
477 
478  if (statsDestList->getLength() > 0) {
479  DOMElement *statsDest = static_cast<DOMElement *>(statsDestList->item(0));
480  m_statisticsDestination = toString(statsDest->getAttribute(uStr("endpoint").ptr()));
481  if (!m_statisticsDestination.size()) {
482  m_statisticsDestination = toString(statsDest->getAttribute(uStr("name").ptr()));
483  }
484  std::string tmpStatisticsInfo = toString(statsDest->getAttribute(uStr("info").ptr()));
485  boost::split(m_statisticsInfo, tmpStatisticsInfo, boost::is_any_of("\t ,"));
486  m_statisticsInfoAvail = !tmpStatisticsInfo.empty();
487  }
488 
489  DOMNodeList *prefetchingList = sourceConfig->getElementsByTagName(uStr("prefetching").ptr());
490 
491  if (prefetchingList->getLength() > 0) {
492  DOMElement *prefetching = static_cast<DOMElement *>(prefetchingList->item(0));
493  m_enablePrefetching = toBool(prefetching->getAttribute(uStr("value").ptr()));
495  }
496 
497  DOMNodeList *nativeProtocolsList = sourceConfig->getElementsByTagName(uStr("native-protocols").ptr());
498 
499  if (nativeProtocolsList->getLength() > 0) {
500  DOMElement *nativeProtocol = static_cast<DOMElement *>(nativeProtocolsList->item(0));
501  DOMNodeList *childList = nativeProtocol->getChildNodes();
502 
503  XMLSize_t numNodes = childList->getLength();
504  for (XMLSize_t i = 0; i < numNodes; ++i) {
505  DOMNode *childNode = childList->item(i);
506  if (childNode->getNodeType() != DOMNode::ELEMENT_NODE) {
507  continue;
508  }
509  DOMElement *child = static_cast<DOMElement *>(childNode);
510  m_nativeProtocols.push_back(toString(child->getAttribute(uStr("prefix").ptr())));
511  }
513  }
514  }
515  }
516  }
517  m_connected = true;
518  }
519  catch (xercesc::DOMException const& e) {
520  }
521  } // The extra pair of braces ensures that
522  // all implicit destructors are called
523  // *before* terminating Xerces-C++.
525  }
void xercesTerminate()
Definition: Xerces.cc:23
double toDouble(XMLCh const *toTranscode)
void xercesInitialize()
Definition: Xerces.cc:18
std::vector< std::string > const * m_nativeProtocolsPtr
unsigned int toUInt(XMLCh const *toTranscode)
std::string toString(const char *format,...)
Definition: xdaq_compat.cc:4
ZStr< XMLCh > uStr(char const *str)
std::vector< std::string > m_nativeProtocols
std::string const frontierConnect(std::string const &servlet) const
bool toBool(XMLCh const *toTranscode)
double split
Definition: MVATrainer.cc:139
std::string const edm::service::SiteLocalConfigService::rfioType ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 253 of file SiteLocalConfigService.cc.

References m_rfioType, and AlCaHLTBitMon_QueryRunRegistry::string.

253  {
254  return m_rfioType;
255  }
std::string const & edm::service::SiteLocalConfigService::siteName ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 318 of file SiteLocalConfigService.cc.

References m_siteName.

318  {
319  return m_siteName;
320  }
std::string const * edm::service::SiteLocalConfigService::sourceCacheHint ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 268 of file SiteLocalConfigService.cc.

References m_cacheHintPtr, and AlCaHLTBitMon_QueryRunRegistry::string.

268  {
269  return m_cacheHintPtr;
270  }
double const * edm::service::SiteLocalConfigService::sourceCacheMinFree ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 263 of file SiteLocalConfigService.cc.

References m_cacheMinFreePtr, and AlCaHLTBitMon_QueryRunRegistry::string.

263  {
264  return m_cacheMinFreePtr;
265  }
std::string const * edm::service::SiteLocalConfigService::sourceCacheTempDir ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 258 of file SiteLocalConfigService.cc.

References m_cacheTempDirPtr.

258  {
259  return m_cacheTempDirPtr;
260  }
std::string const * edm::service::SiteLocalConfigService::sourceCloneCacheHint ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 273 of file SiteLocalConfigService.cc.

References m_cloneCacheHintPtr, and AlCaHLTBitMon_QueryRunRegistry::string.

273  {
274  return m_cloneCacheHintPtr;
275  }
std::vector< std::string > const * edm::service::SiteLocalConfigService::sourceNativeProtocols ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 303 of file SiteLocalConfigService.cc.

References m_nativeProtocolsPtr.

303  {
304  return m_nativeProtocolsPtr;
305  }
std::vector< std::string > const * m_nativeProtocolsPtr
std::string const * edm::service::SiteLocalConfigService::sourceReadHint ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 278 of file SiteLocalConfigService.cc.

References m_readHintPtr.

278  {
279  return m_readHintPtr;
280  }
unsigned int const * edm::service::SiteLocalConfigService::sourceTimeout ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 288 of file SiteLocalConfigService.cc.

References m_timeoutPtr.

288  {
289  return m_timeoutPtr;
290  }
unsigned int const * edm::service::SiteLocalConfigService::sourceTTreeCacheSize ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 283 of file SiteLocalConfigService.cc.

References m_ttreeCacheSizePtr.

283  {
284  return m_ttreeCacheSizePtr;
285  }
struct addrinfo const * edm::service::SiteLocalConfigService::statisticsDestination ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 308 of file SiteLocalConfigService.cc.

References m_statisticsAddrInfo.

308  {
309  return m_statisticsAddrInfo;
310  }
edm::propagate_const< struct addrinfo * > m_statisticsAddrInfo
std::set< std::string > const * edm::service::SiteLocalConfigService::statisticsInfo ( ) const
overridevirtual

Member Data Documentation

std::string edm::service::SiteLocalConfigService::m_cacheHint
private

Definition at line 67 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

std::string const* edm::service::SiteLocalConfigService::m_cacheHintPtr
private

Definition at line 68 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceCacheHint().

double edm::service::SiteLocalConfigService::m_cacheMinFree
private

Definition at line 65 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

double const* edm::service::SiteLocalConfigService::m_cacheMinFreePtr
private

Definition at line 66 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceCacheMinFree().

std::string edm::service::SiteLocalConfigService::m_cacheTempDir
private

Definition at line 63 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

std::string const* edm::service::SiteLocalConfigService::m_cacheTempDirPtr
private

Definition at line 64 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceCacheTempDir().

std::string edm::service::SiteLocalConfigService::m_cloneCacheHint
private

Definition at line 69 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

std::string const* edm::service::SiteLocalConfigService::m_cloneCacheHintPtr
private

Definition at line 70 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceCloneCacheHint().

bool edm::service::SiteLocalConfigService::m_connected
private

Definition at line 62 of file SiteLocalConfigService.h.

Referenced by dataCatalog(), fallbackDataCatalog(), frontierConnect(), and parse().

std::string edm::service::SiteLocalConfigService::m_dataCatalog
private

Definition at line 58 of file SiteLocalConfigService.h.

Referenced by dataCatalog(), and parse().

unsigned int edm::service::SiteLocalConfigService::m_debugLevel
private

Definition at line 77 of file SiteLocalConfigService.h.

Referenced by debugLevel(), and SiteLocalConfigService().

bool edm::service::SiteLocalConfigService::m_enablePrefetching
private

Definition at line 78 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

bool const* edm::service::SiteLocalConfigService::m_enablePrefetchingPtr
private

Definition at line 79 of file SiteLocalConfigService.h.

Referenced by enablePrefetching(), parse(), and SiteLocalConfigService().

std::string edm::service::SiteLocalConfigService::m_fallbackDataCatalog
private

Definition at line 59 of file SiteLocalConfigService.h.

Referenced by fallbackDataCatalog(), and parse().

std::string edm::service::SiteLocalConfigService::m_frontierConnect
private

Definition at line 60 of file SiteLocalConfigService.h.

Referenced by frontierConnect(), and parse().

std::vector<std::string> edm::service::SiteLocalConfigService::m_nativeProtocols
private

Definition at line 80 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

std::vector<std::string> const* edm::service::SiteLocalConfigService::m_nativeProtocolsPtr
private

Definition at line 81 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceNativeProtocols().

std::string edm::service::SiteLocalConfigService::m_readHint
private

Definition at line 71 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

std::string const* edm::service::SiteLocalConfigService::m_readHintPtr
private

Definition at line 72 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceReadHint().

std::string edm::service::SiteLocalConfigService::m_rfioType
private

Definition at line 61 of file SiteLocalConfigService.h.

Referenced by parse(), and rfioType().

std::string edm::service::SiteLocalConfigService::m_siteName
private

Definition at line 87 of file SiteLocalConfigService.h.

Referenced by parse(), and siteName().

edm::propagate_const<struct addrinfo*> edm::service::SiteLocalConfigService::m_statisticsAddrInfo
private
const std::string edm::service::SiteLocalConfigService::m_statisticsDefaultPort = "3334"
staticprivate

Definition at line 84 of file SiteLocalConfigService.h.

Referenced by computeStatisticsDestination().

std::string edm::service::SiteLocalConfigService::m_statisticsDestination
private
std::set<std::string> edm::service::SiteLocalConfigService::m_statisticsInfo
private

Definition at line 85 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and statisticsInfo().

bool edm::service::SiteLocalConfigService::m_statisticsInfoAvail
private

Definition at line 86 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and statisticsInfo().

unsigned int edm::service::SiteLocalConfigService::m_timeout
private

Definition at line 75 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

unsigned int const* edm::service::SiteLocalConfigService::m_timeoutPtr
private

Definition at line 76 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceTimeout().

unsigned int edm::service::SiteLocalConfigService::m_ttreeCacheSize
private

Definition at line 73 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

unsigned int const* edm::service::SiteLocalConfigService::m_ttreeCacheSizePtr
private

Definition at line 74 of file SiteLocalConfigService.h.

Referenced by parse(), SiteLocalConfigService(), and sourceTTreeCacheSize().

std::string edm::service::SiteLocalConfigService::m_url
private

Definition at line 57 of file SiteLocalConfigService.h.

Referenced by dataCatalog(), frontierConnect(), and SiteLocalConfigService().