CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
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 23 of file SiteLocalConfigService.h.

Constructor & Destructor Documentation

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

Definition at line 108 of file SiteLocalConfigService.cc.

References computeStatisticsDestination(), 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.

108  :
109  m_url("/SITECONF/local/JobConfig/site-local-config.xml"),
110  m_dataCatalog(),
113  m_rfioType("castor"),
114  m_connected(false),
115  m_cacheTempDir(),
116  m_cacheTempDirPtr(nullptr),
117  m_cacheMinFree(),
118  m_cacheMinFreePtr(nullptr),
119  m_cacheHint(),
120  m_cacheHintPtr(nullptr),
122  m_cloneCacheHintPtr(nullptr),
123  m_readHint(),
124  m_readHintPtr(nullptr),
125  m_ttreeCacheSize(0U),
126  m_ttreeCacheSizePtr(nullptr),
127  m_timeout(0U),
128  m_timeoutPtr(nullptr),
129  m_debugLevel(0U),
130  m_enablePrefetching(false),
131  m_enablePrefetchingPtr(nullptr),
133  m_nativeProtocolsPtr(nullptr),
135  m_statisticsAddrInfo(nullptr),
136  m_statisticsInfoAvail(false),
137  m_siteName() {
138 
139  char* tmp = getenv("CMS_PATH");
140 
141  if (tmp) {
142  m_url = tmp + m_url;
143  }
144 
145  this->parse(m_url);
146 
147  //apply overrides
148  overrideFromPSet("overrideSourceCacheTempDir", pset, m_cacheTempDir, m_cacheTempDirPtr);
149  overrideFromPSet("overrideSourceCacheMinFree", pset, m_cacheMinFree, m_cacheMinFreePtr);
150  overrideFromPSet("overrideSourceCacheHintDir", pset, m_cacheHint, m_cacheHintPtr);
151  overrideFromPSet("overrideSourceCloneCacheHintDir", pset, m_cloneCacheHint, m_cloneCacheHintPtr);
152  overrideFromPSet("overrideSourceReadHint", pset, m_readHint, m_readHintPtr);
153  overrideFromPSet("overrideSourceNativeProtocols", pset, m_nativeProtocols, m_nativeProtocolsPtr);
154  overrideFromPSet("overrideSourceTTreeCacheSize", pset, m_ttreeCacheSize, m_ttreeCacheSizePtr);
155  overrideFromPSet("overrideSourceTimeout", pset, m_timeout, m_timeoutPtr);
156  overrideFromPSet("overridePrefetching", pset, m_enablePrefetching, m_enablePrefetchingPtr);
157  const std::string * tmpStringPtr = nullptr;
158  overrideFromPSet("overrideStatisticsDestination", pset, m_statisticsDestination, tmpStringPtr);
160  std::vector<std::string> tmpStatisticsInfo; std::vector<std::string> const *tmpStatisticsInfoPtr = nullptr;
161  overrideFromPSet("overrideStatisticsInfo", pset, tmpStatisticsInfo, tmpStatisticsInfoPtr);
162  if (tmpStatisticsInfoPtr) {
163  m_statisticsInfoAvail = true;
164  m_statisticsInfo.clear();
165  for (auto &entry : tmpStatisticsInfo) {m_statisticsInfo.insert(std::move(entry));}
166  }
167 
168  if(pset.exists("debugLevel")) {
169  m_debugLevel = pset.getUntrackedParameter<unsigned int>("debugLevel");
170  }
171 
172  }
std::vector< std::string > const * m_nativeProtocolsPtr
def move
Definition: eostools.py:510
std::vector< std::string > m_nativeProtocols
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::service::SiteLocalConfigService::~SiteLocalConfigService ( )

Definition at line 174 of file SiteLocalConfigService.cc.

References m_statisticsAddrInfo.

174  {
175  if (m_statisticsAddrInfo) {
176  freeaddrinfo(m_statisticsAddrInfo);
177  m_statisticsAddrInfo = nullptr;
178  }
179  }

Member Function Documentation

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

Definition at line 553 of file SiteLocalConfigService.cc.

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

Referenced by SiteLocalConfigService().

553  {
554  std::vector<std::string> inputStrings;
555  boost::split(inputStrings, m_statisticsDestination, boost::is_any_of(":"));
556  const std::string &host=inputStrings[0];
557  const std::string &port = (inputStrings.size() > 1) ? inputStrings[1] : m_statisticsDefaultPort;
558  struct addrinfo *res;
559  struct addrinfo hints;
560  memset(&hints, '\0', sizeof(hints));
561  hints.ai_socktype = SOCK_DGRAM;
562  hints.ai_flags = AI_ADDRCONFIG;
563  hints.ai_family = AF_UNSPEC;
564  int e = getaddrinfo(host.c_str(), port.c_str(), &hints, &res);
565  if (e != 0) {
566  // Silent failure - there's no way to report non-fatal failures from here.
567  return;
568  }
569  m_statisticsAddrInfo = res;
570  }
static const std::string m_statisticsDefaultPort
int port
Definition: query.py:115
string host
Definition: query.py:114
double split
Definition: MVATrainer.cc:139
std::string const edm::service::SiteLocalConfigService::dataCatalog ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 182 of file SiteLocalConfigService.cc.

References Exception, m_connected, m_dataCatalog, and m_url.

182  {
183  if (!m_connected) {
184  //throw cms::Exception("Incomplete configuration")
185  // << "Valid site-local-config not found at " << m_url;
186  // Return PoolFileCatalog.xml for now
187  return "file:PoolFileCatalog.xml";
188  }
189 
190  if (m_dataCatalog == "") {
191  throw cms::Exception("Incomplete configuration")
192  << "Did not find catalog in event-data section in " << m_url;
193  }
194 
195  return m_dataCatalog;
196  }
unsigned int edm::service::SiteLocalConfigService::debugLevel ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 327 of file SiteLocalConfigService.cc.

References m_debugLevel.

327  {
328  return m_debugLevel;
329  }
bool edm::service::SiteLocalConfigService::enablePrefetching ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 322 of file SiteLocalConfigService.cc.

References m_enablePrefetchingPtr.

322  {
324  }
std::string const edm::service::SiteLocalConfigService::fallbackDataCatalog ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 199 of file SiteLocalConfigService.cc.

References m_connected, and m_fallbackDataCatalog.

199  {
200  if (!m_connected) {
201  //throw cms::Exception("Incomplete configuration")
202  // << "Valid site-local-config not found at " << m_url;
203  // Return PoolFileCatalog.xml for now
204  return "file:PoolFileCatalog.xml";
205  }
206 
207  // Note: Unlike the dataCatalog, the fallbackDataCatalog may be empty!
208  return m_fallbackDataCatalog;
209  }
void edm::service::SiteLocalConfigService::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 573 of file SiteLocalConfigService.cc.

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

573  {
575  desc.setComment("Service to translate logical file names to physical file names.");
576 
577  desc.addOptionalUntracked<std::string>("overrideSourceCacheTempDir");
578  desc.addOptionalUntracked<double>("overrideSourceCacheMinFree");
579  desc.addOptionalUntracked<std::string>("overrideSourceCacheHintDir");
580  desc.addOptionalUntracked<std::string>("overrideSourceCloneCacheHintDir")
581  ->setComment("Provide an alternate cache hint for fast cloning.");
582  desc.addOptionalUntracked<std::string>("overrideSourceReadHint");
583  desc.addOptionalUntracked<std::vector<std::string> >("overrideSourceNativeProtocols");
584  desc.addOptionalUntracked<unsigned int>("overrideSourceTTreeCacheSize");
585  desc.addOptionalUntracked<unsigned int>("overrideSourceTimeout");
586  desc.addOptionalUntracked<unsigned int>("debugLevel");
587  desc.addOptionalUntracked<bool>("overridePrefetching")
588  ->setComment("Request ROOT to asynchronously prefetch I/O during computation.");
589  desc.addOptionalUntracked<std::string>("overrideStatisticsDestination")
590  ->setComment("Provide an alternate network destination for I/O statistics (must be in the form of host:port).");
591  desc.addOptionalUntracked<std::vector<std::string> >("overrideStatisticsInfo")
592  ->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).");
593 
594  descriptions.add("SiteLocalConfigService", desc);
595  }
std::string const edm::service::SiteLocalConfigService::frontierConnect ( std::string const &  servlet) const
private

Definition at line 212 of file SiteLocalConfigService.cc.

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

Referenced by lookupCalibConnect(), and parse().

212  {
213  if (!m_connected) {
214  throw cms::Exception("Incomplete configuration")
215  << "Valid site-local-config not found at " << m_url;
216  }
217 
218  if (m_frontierConnect == "") {
219  throw cms::Exception("Incomplete configuration")
220  << "Did not find frontier-connect in calib-data section in " << m_url;
221  }
222 
223  if (servlet == "") {
224  return m_frontierConnect;
225  }
226 
227  // Replace the last component of every "serverurl=" piece (up to the
228  // next close-paren) with the servlet
229  std::string::size_type nextparen = 0;
230  std::string::size_type serverurl, lastslash;
231  std::string complexstr = "";
232  while ((serverurl = m_frontierConnect.find("(serverurl=", nextparen)) != std::string::npos) {
233  complexstr.append(m_frontierConnect, nextparen, serverurl - nextparen);
234  nextparen = m_frontierConnect.find(')', serverurl);
235  lastslash = m_frontierConnect.rfind('/', nextparen);
236  complexstr.append(m_frontierConnect, serverurl, lastslash - serverurl + 1);
237  complexstr.append(servlet);
238  }
239  complexstr.append(m_frontierConnect, nextparen, m_frontierConnect.length()-nextparen);
240 
241  return complexstr;
242  }
uint16_t size_type
std::string const edm::service::SiteLocalConfigService::lookupCalibConnect ( std::string const &  input) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 245 of file SiteLocalConfigService.cc.

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

245  {
246  static std::string const proto = "frontier://";
247 
248  if (input.substr(0,proto.length()) == proto) {
249  // Replace the part after the frontier:// and before either an open-
250  // parentheses (which indicates user-supplied options) or the last
251  // slash (which indicates start of the schema) with the complex
252  // parenthesized string returned from frontierConnect() (which
253  // contains all the information needed to connect to frontier),
254  // if that part is a simple servlet name (non-empty and not
255  // containing special characters)
256  // Example connect strings where servlet is replaced:
257  // frontier://cms_conditions_data/CMS_COND_ECAL
258  // frontier://FrontierInt/CMS_COND_ECAL
259  // frontier://FrontierInt(retrieve-ziplevel=0)/CMS_COND_ECAL
260  // Example connect strings left untouched:
261  // frontier://cmsfrontier.cern.ch:8000/FrontierInt/CMS_COND_ECAL
262  // frontier://(serverurl=cmsfrontier.cern.ch:8000/FrontierInt)/CMS_COND_ECAL
263  std::string::size_type startservlet = proto.length();
264  // if user supplied extra parenthesized options, stop servlet there
265  std::string::size_type endservlet = input.find("(", startservlet);
266  if (endservlet == std::string::npos) {
267  endservlet = input.rfind('/', input.length());
268  }
269  std::string servlet = input.substr(startservlet, endservlet - startservlet);
270  if ((servlet != "") && (servlet.find_first_of(":/)[]") == std::string::npos)) {
271  if (servlet == "cms_conditions_data") {
272  // use the default servlet from site-local-config.xml
273  servlet = "";
274  }
275  return proto + frontierConnect(servlet) + input.substr(endservlet);
276  }
277  }
278  return input;
279  }
uint16_t size_type
static std::string const input
Definition: EdmProvDump.cc:43
std::string const frontierConnect(std::string const &servlet) const
void edm::service::SiteLocalConfigService::parse ( std::string const &  url)
private

Definition at line 352 of file SiteLocalConfigService.cc.

References _toDOMS(), _toString(), validate_alignment_devdb10_cfg::catalog, alignCSCRings::e, frontierConnect(), 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, geometryXMLtoCSV::parser, cmsHarvester::sites, split, AlCaHLTBitMon_QueryRunRegistry::string, and cms::concurrency::xercesInitialize().

Referenced by SiteLocalConfigService().

352  {
354  std::auto_ptr<XercesDOMParser> parser(new XercesDOMParser);
355  try {
356  parser->setValidationScheme(XercesDOMParser::Val_Auto);
357  parser->setDoNamespaces(false);
358 
359  parser->parse(url.c_str());
360  DOMDocument* doc = parser->getDocument();
361  if (!doc) {
362  return;
363  }
364 
365  // The Site Config has the following format
366  // <site-local-config>
367  // <site name="FNAL">
368  // <event-data>
369  // <catalog url="trivialcatalog_file:/x/y/z.xml"/>
370  // <rfiotype value="castor"/>
371  // </event-data>
372  // <calib-data>
373  // <catalog url="trivialcatalog_file:/x/y/z.xml"/>
374  // <frontier-connect>
375  // ... frontier-interpreted server/proxy xml ...
376  // </frontier-connect>
377  // </calib-data>
378  // <source-config>
379  // <cache-temp-dir name="/a/b/c"/>
380  // <cache-hint value="..."/>
381  // <read-hint value="..."/>
382  // <ttree-cache-size value="0"/>
383  // <native-protocols>
384  // <protocol prefix="dcache"/>
385  // <protocol prefix="file"/>
386  // </native-protocols>
387  // </source-config>
388  // </site>
389  // </site-local-config>
390 
391  // FIXME: should probably use the parser for validating the XML.
392 
393  DOMNodeList *sites = doc->getElementsByTagName(_toDOMS("site"));
394  unsigned int numSites = sites->getLength();
395  for (unsigned int i = 0; i < numSites; ++i) {
396  DOMElement *site = static_cast<DOMElement *>(sites->item(i));
397 
398  // Parse the site name
399  m_siteName = _toString(site->getAttribute(_toDOMS("name")));
400 
401  // Parsing of the event data section
402  {
403  DOMNodeList *eventDataList = site->getElementsByTagName(_toDOMS("event-data"));
404  if (eventDataList->getLength() > 0) {
405  DOMElement *eventData = static_cast<DOMElement *>(eventDataList->item(0));
406 
407  DOMNodeList *catalogs = eventData->getElementsByTagName(_toDOMS("catalog"));
408 
409  if (catalogs->getLength() > 0) {
410  DOMElement * catalog = static_cast<DOMElement *>(catalogs->item(0));
411  m_dataCatalog = _toString(catalog->getAttribute(_toDOMS("url")));
412  }
413 
414  if (catalogs->getLength() > 1) {
415  DOMElement * catalog = static_cast<DOMElement *>(catalogs->item(1));
416  m_fallbackDataCatalog = _toString(catalog->getAttribute(_toDOMS("url")));
417  }
418 
419  DOMNodeList* rfiotypes = eventData->getElementsByTagName(_toDOMS("rfiotype"));
420 
421  if (rfiotypes->getLength() > 0) {
422  DOMElement* rfiotype = static_cast<DOMElement *>(rfiotypes->item(0));
423  m_rfioType = _toString(rfiotype->getAttribute(_toDOMS("value")));
424  }
425  }
426  }
427 
428  // Parsing of the calib-data section
429  {
430  DOMNodeList *calibDataList = site->getElementsByTagName(_toDOMS("calib-data"));
431 
432  if (calibDataList->getLength() > 0) {
433  DOMElement *calibData = static_cast<DOMElement *>(calibDataList->item(0));
434  DOMNodeList *frontierConnectList = calibData->getElementsByTagName(_toDOMS("frontier-connect"));
435 
436  if (frontierConnectList->getLength() > 0) {
437  DOMElement *frontierConnect = static_cast<DOMElement *>(frontierConnectList->item(0));
438  m_frontierConnect = _toParenString(*frontierConnect);
439  }
440  }
441  }
442  // Parsing of the source config section
443  {
444  DOMNodeList *sourceConfigList = site->getElementsByTagName(_toDOMS("source-config"));
445 
446  if (sourceConfigList->getLength() > 0) {
447  DOMElement *sourceConfig = static_cast<DOMElement *>(sourceConfigList->item(0));
448  DOMNodeList *cacheTempDirList = sourceConfig->getElementsByTagName(_toDOMS("cache-temp-dir"));
449 
450  if (cacheTempDirList->getLength() > 0) {
451  DOMElement *cacheTempDir = static_cast<DOMElement *>(cacheTempDirList->item(0));
452  m_cacheTempDir = _toString(cacheTempDir->getAttribute(_toDOMS("name")));
454  }
455 
456  DOMNodeList *cacheMinFreeList = sourceConfig->getElementsByTagName(_toDOMS("cache-min-free"));
457 
458  if (cacheMinFreeList->getLength() > 0) {
459  DOMElement *cacheMinFree = static_cast<DOMElement *>(cacheMinFreeList->item(0));
460  m_cacheMinFree = _toDouble(cacheMinFree->getAttribute(_toDOMS("value")));
462  }
463 
464  DOMNodeList *cacheHintList = sourceConfig->getElementsByTagName(_toDOMS("cache-hint"));
465 
466  if (cacheHintList->getLength() > 0) {
467  DOMElement *cacheHint = static_cast<DOMElement *>(cacheHintList->item(0));
468  m_cacheHint = _toString(cacheHint->getAttribute(_toDOMS("value")));
470  }
471 
472  DOMNodeList *cloneCacheHintList = sourceConfig->getElementsByTagName(_toDOMS("clone-cache-hint"));
473 
474  if (cloneCacheHintList->getLength() > 0) {
475  DOMElement *cloneCacheHint = static_cast<DOMElement *>(cloneCacheHintList->item(0));
476  m_cloneCacheHint = _toString(cloneCacheHint->getAttribute(_toDOMS("value")));
478  }
479 
480  DOMNodeList *readHintList = sourceConfig->getElementsByTagName(_toDOMS("read-hint"));
481 
482  if (readHintList->getLength() > 0) {
483  DOMElement *readHint = static_cast<DOMElement *>(readHintList->item(0));
484  m_readHint = _toString(readHint->getAttribute(_toDOMS("value")));
486  }
487 
488  DOMNodeList *ttreeCacheSizeList = sourceConfig->getElementsByTagName(_toDOMS("ttree-cache-size"));
489 
490  if (ttreeCacheSizeList->getLength() > 0) {
491  DOMElement *ttreeCacheSize = static_cast<DOMElement *>(ttreeCacheSizeList->item(0));
492  m_ttreeCacheSize = _toUInt(ttreeCacheSize->getAttribute(_toDOMS("value")));
494  }
495 
496  DOMNodeList *timeoutList = sourceConfig->getElementsByTagName(_toDOMS("timeout-in-seconds"));
497 
498  if (timeoutList->getLength() > 0) {
499  DOMElement *timeout = static_cast<DOMElement *>(timeoutList->item(0));
500  m_timeout = _toUInt(timeout->getAttribute(_toDOMS("value")));
502  }
503 
504  DOMNodeList *statsDestList = sourceConfig->getElementsByTagName(_toDOMS("statistics-destination"));
505 
506  if (statsDestList->getLength() > 0) {
507  DOMElement *statsDest = static_cast<DOMElement *>(statsDestList->item(0));
508  m_statisticsDestination = _toString(statsDest->getAttribute(_toDOMS("endpoint")));
509  if (!m_statisticsDestination.size()) {
510  m_statisticsDestination = _toString(statsDest->getAttribute(_toDOMS("name")));
511  }
512  std::string tmpStatisticsInfo = _toString(statsDest->getAttribute(_toDOMS("info")));
513  boost::split(m_statisticsInfo, tmpStatisticsInfo, boost::is_any_of("\t ,"));
514  m_statisticsInfoAvail = !tmpStatisticsInfo.empty();
515  }
516 
517  DOMNodeList *prefetchingList = sourceConfig->getElementsByTagName(_toDOMS("prefetching"));
518 
519  if (prefetchingList->getLength() > 0) {
520  DOMElement *prefetching = static_cast<DOMElement *>(prefetchingList->item(0));
521  m_enablePrefetching = _toBool(prefetching->getAttribute(_toDOMS("value")));
523  }
524 
525  DOMNodeList *nativeProtocolsList = sourceConfig->getElementsByTagName(_toDOMS("native-protocols"));
526 
527  if (nativeProtocolsList->getLength() > 0) {
528  DOMElement *nativeProtocol = static_cast<DOMElement *>(nativeProtocolsList->item(0));
529  DOMNodeList *childList = nativeProtocol->getChildNodes();
530 
531  XMLCh* prefixXMLCh = _toDOMS("prefix");
532  unsigned int numNodes = childList->getLength();
533  for (unsigned int i = 0; i < numNodes; ++i) {
534  DOMNode *childNode = childList->item(i);
535  if (childNode->getNodeType() != DOMNode::ELEMENT_NODE) {
536  continue;
537  }
538  DOMElement *child = static_cast<DOMElement *>(childNode);
539  m_nativeProtocols.push_back(_toString(child->getAttribute(prefixXMLCh)));
540  }
542  }
543  }
544  }
545  }
546  m_connected = true;
547  }
548  catch (xercesc::DOMException const& e) {
549  }
550  }
int i
Definition: DBlmapReader.cc:9
std::string _toString(const XMLCh *toTranscode)
void xercesInitialize()
Definition: Xerces.cc:17
std::vector< std::string > const * m_nativeProtocolsPtr
std::vector< std::string > m_nativeProtocols
XMLCh * _toDOMS(std::string temp)
std::string const frontierConnect(std::string const &servlet) const
double split
Definition: MVATrainer.cc:139
std::string const edm::service::SiteLocalConfigService::rfioType ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 282 of file SiteLocalConfigService.cc.

References m_rfioType.

282  {
283  return m_rfioType;
284  }
std::string const & edm::service::SiteLocalConfigService::siteName ( void  ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 347 of file SiteLocalConfigService.cc.

References m_siteName.

347  {
348  return m_siteName;
349  }
std::string const * edm::service::SiteLocalConfigService::sourceCacheHint ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 297 of file SiteLocalConfigService.cc.

References m_cacheHintPtr.

297  {
298  return m_cacheHintPtr;
299  }
double const * edm::service::SiteLocalConfigService::sourceCacheMinFree ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 292 of file SiteLocalConfigService.cc.

References m_cacheMinFreePtr.

292  {
293  return m_cacheMinFreePtr;
294  }
std::string const * edm::service::SiteLocalConfigService::sourceCacheTempDir ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 287 of file SiteLocalConfigService.cc.

References m_cacheTempDirPtr.

287  {
288  return m_cacheTempDirPtr;
289  }
std::string const * edm::service::SiteLocalConfigService::sourceCloneCacheHint ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 302 of file SiteLocalConfigService.cc.

References m_cloneCacheHintPtr.

302  {
303  return m_cloneCacheHintPtr;
304  }
std::vector< std::string > const * edm::service::SiteLocalConfigService::sourceNativeProtocols ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 332 of file SiteLocalConfigService.cc.

References m_nativeProtocolsPtr.

332  {
333  return m_nativeProtocolsPtr;
334  }
std::vector< std::string > const * m_nativeProtocolsPtr
std::string const * edm::service::SiteLocalConfigService::sourceReadHint ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 307 of file SiteLocalConfigService.cc.

References m_readHintPtr.

307  {
308  return m_readHintPtr;
309  }
unsigned int const * edm::service::SiteLocalConfigService::sourceTimeout ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 317 of file SiteLocalConfigService.cc.

References m_timeoutPtr.

317  {
318  return m_timeoutPtr;
319  }
unsigned int const * edm::service::SiteLocalConfigService::sourceTTreeCacheSize ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 312 of file SiteLocalConfigService.cc.

References m_ttreeCacheSizePtr.

312  {
313  return m_ttreeCacheSizePtr;
314  }
struct addrinfo const * edm::service::SiteLocalConfigService::statisticsDestination ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 337 of file SiteLocalConfigService.cc.

References m_statisticsAddrInfo.

337  {
338  return m_statisticsAddrInfo;
339  }
std::set< std::string > const * edm::service::SiteLocalConfigService::statisticsInfo ( ) const
overridevirtual

Implements edm::SiteLocalConfig.

Definition at line 342 of file SiteLocalConfigService.cc.

References m_statisticsInfo, and m_statisticsInfoAvail.

342  {
343  return m_statisticsInfoAvail ? &m_statisticsInfo : nullptr;
344  }

Member Data Documentation

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

Definition at line 66 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 67 of file SiteLocalConfigService.h.

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

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

Definition at line 64 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 65 of file SiteLocalConfigService.h.

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

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

Definition at line 62 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 63 of file SiteLocalConfigService.h.

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

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

Definition at line 68 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 69 of file SiteLocalConfigService.h.

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

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

Definition at line 61 of file SiteLocalConfigService.h.

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

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

Definition at line 57 of file SiteLocalConfigService.h.

Referenced by dataCatalog(), and parse().

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

Definition at line 76 of file SiteLocalConfigService.h.

Referenced by debugLevel(), and SiteLocalConfigService().

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

Definition at line 77 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 78 of file SiteLocalConfigService.h.

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

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

Definition at line 58 of file SiteLocalConfigService.h.

Referenced by fallbackDataCatalog(), and parse().

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

Definition at line 59 of file SiteLocalConfigService.h.

Referenced by frontierConnect(), and parse().

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

Definition at line 79 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 80 of file SiteLocalConfigService.h.

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

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

Definition at line 70 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 71 of file SiteLocalConfigService.h.

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

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

Definition at line 60 of file SiteLocalConfigService.h.

Referenced by parse(), and rfioType().

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

Definition at line 86 of file SiteLocalConfigService.h.

Referenced by parse(), and siteName().

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

Definition at line 83 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 84 of file SiteLocalConfigService.h.

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

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

Definition at line 85 of file SiteLocalConfigService.h.

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

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

Definition at line 74 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 75 of file SiteLocalConfigService.h.

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

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

Definition at line 72 of file SiteLocalConfigService.h.

Referenced by parse(), and SiteLocalConfigService().

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

Definition at line 73 of file SiteLocalConfigService.h.

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

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

Definition at line 56 of file SiteLocalConfigService.h.

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