Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-30 22:38:53

0001 #ifndef FWCore_Services_SiteLocalConfigService_H
0002 #define FWCore_Services_SiteLocalConfigService_H
0003 
0004 ///////////////////////////////////////////////////////////////////////
0005 //
0006 // dataCatalogs(unsigned catType) returns multiple data catalogs in site-local-config.xml.
0007 //    catType=TrivialCatalog: returns trivial catalogs defined in <event-data> blocks
0008 //    catType=RucioCatalog: returns catalogs defined in <data-access> blocks
0009 //    (the "enum" is defined in FWCore/Catalog/interface/SiteLocalConfig.h)
0010 ///////////////////////////////////////////////////////////////////////
0011 //<<<<<< INCLUDES                                                       >>>>>>
0012 #include <string>
0013 #include <list>
0014 #include <vector>
0015 #include "FWCore/Catalog/interface/SiteLocalConfig.h"
0016 #include "FWCore/Utilities/interface/propagate_const.h"
0017 #include "tinyxml2.h"
0018 
0019 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
0020 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
0021 //<<<<<< PUBLIC TYPES                                                   >>>>>>
0022 namespace edm {
0023   class ParameterSet;
0024 }
0025 
0026 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
0027 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
0028 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
0029 
0030 namespace edm {
0031   class ConfigurationDescriptions;
0032   namespace service {
0033 
0034     class SiteLocalConfigService : public SiteLocalConfig {
0035     public:
0036       explicit SiteLocalConfigService(ParameterSet const& pset);
0037 
0038       std::vector<std::string> const& trivialDataCatalogs() const override;
0039       std::vector<edm::CatalogAttributes> const& dataCatalogs() const override;
0040       std::filesystem::path const storageDescriptionPath(edm::CatalogAttributes const& aDataCatalog) const override;
0041       std::string const lookupCalibConnect(std::string const& input) const override;
0042       std::string const rfioType(void) const override;
0043 
0044       std::string const* sourceCacheTempDir() const override;
0045       double const* sourceCacheMinFree() const override;
0046       std::string const* sourceCacheHint() const override;
0047       std::string const* sourceCloneCacheHint() const override;
0048       std::string const* sourceReadHint() const override;
0049       unsigned int const* sourceTTreeCacheSize() const override;
0050       unsigned int const* sourceTimeout() const override;
0051       bool enablePrefetching() const override;
0052       unsigned int debugLevel() const override;
0053       std::vector<std::string> const* sourceNativeProtocols() const override;
0054       struct addrinfo const* statisticsDestination() const override;
0055       std::set<std::string> const* statisticsInfo() const override;
0056       std::string const& siteName() const override;
0057       std::string const& subSiteName() const override;
0058       bool useLocalConnectString() const override;
0059       std::string const& localConnectPrefix() const override;
0060       std::string const& localConnectSuffix() const override;
0061 
0062       // implicit copy constructor
0063       // implicit assignment operator
0064       ~SiteLocalConfigService() override;
0065 
0066       static void fillDescriptions(ConfigurationDescriptions& descriptions);
0067 
0068     private:
0069       void getCatalog(tinyxml2::XMLElement const& cat, std::string site, std::string subSite);
0070       void parse(std::string const& url);
0071       void computeStatisticsDestination();
0072       std::string const frontierConnect(std::string const& servlet) const;
0073       std::string m_url;
0074       std::vector<std::string> m_trivialDataCatalogs;
0075       std::vector<edm::CatalogAttributes> m_dataCatalogs;
0076       std::string m_frontierConnect;
0077       std::string m_rfioType;
0078       bool m_connected;
0079       std::string m_cacheTempDir;
0080       std::string const* m_cacheTempDirPtr;
0081       double m_cacheMinFree;
0082       double const* m_cacheMinFreePtr;
0083       std::string m_cacheHint;
0084       std::string const* m_cacheHintPtr;
0085       std::string m_cloneCacheHint;
0086       std::string const* m_cloneCacheHintPtr;
0087       std::string m_readHint;
0088       std::string const* m_readHintPtr;
0089       unsigned int m_ttreeCacheSize;
0090       unsigned int const* m_ttreeCacheSizePtr;
0091       unsigned int m_timeout;
0092       unsigned int const* m_timeoutPtr;
0093       unsigned int m_debugLevel;
0094       bool m_enablePrefetching;
0095       bool const* m_enablePrefetchingPtr;
0096       std::vector<std::string> m_nativeProtocols;
0097       std::vector<std::string> const* m_nativeProtocolsPtr;
0098       std::string m_statisticsDestination;
0099       edm::propagate_const<struct addrinfo*> m_statisticsAddrInfo;
0100       static const std::string m_statisticsDefaultPort;
0101       std::set<std::string> m_statisticsInfo;
0102       bool m_statisticsInfoAvail;
0103       std::string m_siteName;
0104       std::string m_subSiteName;
0105       bool m_useLocalConnectString = false;
0106       std::string m_localConnectPrefix;
0107       std::string m_localConnectSuffix;
0108     };
0109 
0110     inline bool isProcessWideService(SiteLocalConfigService const*) { return true; }
0111   }  // namespace service
0112 }  // namespace edm
0113 
0114 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
0115 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
0116 
0117 #endif  // FRAMEWORK_SITE_LOCAL_CONFIG_H