diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index b6569d0ce9833a5094489c6fd321bc82c9371757..70b1404e77730d3e0f85e047c9516beed1e774a7 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -11,22 +11,20 @@ #include "GaudiKernel/ClassID.h" #include "GaudiKernel/FileIncident.h" -#include "GaudiKernel/IChronoStatSvc.h" + #include "GaudiKernel/IOpaqueAddress.h" #include "GaudiKernel/IJobOptionsSvc.h" #include "GaudiKernel/IIncidentSvc.h" #include "GaudiKernel/AttribStringParser.h" -#include "AthenaKernel/IAthenaIPCTool.h" #include "AthenaKernel/IAthenaSerializeSvc.h" -#include "AthenaKernel/IClassIDSvc.h" #include "AthenaKernel/IAthenaOutputStreamTool.h" #include "AthenaKernel/IMetadataTransition.h" #include "PersistentDataModel/Placement.h" #include "PersistentDataModel/Token.h" #include "PersistentDataModel/TokenAddress.h" #include "PersistentDataModel/DataHeader.h" -#include "PoolSvc/IPoolSvc.h" + #include "StorageSvc/DbReflex.h" @@ -1140,34 +1138,9 @@ void AthenaPoolCnvSvc::handle(const Incident& incident) { } //______________________________________________________________________________ AthenaPoolCnvSvc::AthenaPoolCnvSvc(const std::string& name, ISvcLocator* pSvcLocator) : - ::AthCnvSvc(name, pSvcLocator, POOL_StorageType), - m_dbType(pool::ROOTTREEINDEX_StorageType), - m_lastInputFileName(), - m_poolSvc("PoolSvc", name), - m_chronoStatSvc("ChronoStatSvc", name), - m_clidSvc("ClassIDSvc", name), - m_serializeSvc("AthenaRootSerializeSvc", name), - m_inputStreamingTool("", this), - m_outputStreamingTool(this), - m_streamServer(0), - m_metadataClient(0), - m_domainMaxFileSize(15000000000LL), - m_doChronoStat(true) { - declareProperty("UseDetailChronoStat", m_useDetailChronoStat = false); - declareProperty("PoolContainerPrefix", m_containerPrefixProp = "ROOTTREEINDEX:CollectionTree"); - declareProperty("TopLevelContainerName", m_containerNameHintProp = ""); - declareProperty("SubLevelBranchName", m_branchNameHintProp = "<type>/<key>"); - declareProperty("PoolAttributes", m_poolAttr); - declareProperty("InputPoolAttributes", m_inputPoolAttr); - declareProperty("OutputPoolFileAllocator", m_streamClientFilesProp); - declareProperty("PrintInputAttrPerEvt", m_inputPoolAttrPerEvent); - declareProperty("MaxFileSizes", m_maxFileSizes); - declareProperty("PersSvcPerOutput", m_persSvcPerOutput = true); - declareProperty("SkipFirstChronoCommit", m_skipFirstChronoCommit = false); - declareProperty("InputStreamingTool", m_inputStreamingTool); + ::AthCnvSvc(name, pSvcLocator, POOL_StorageType) { declareProperty("OutputStreamingTool", m_outputStreamingTool); - declareProperty("OutputMetadataContainer", m_metadataContainerProp); -} + } //______________________________________________________________________________ AthenaPoolCnvSvc::~AthenaPoolCnvSvc() { } diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h index ae898846295c06d0806079fcdabb2135ab0b1fee..291806cc2762bfb05097a275e060a4125b3455b2 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h @@ -17,17 +17,17 @@ #include "GaudiKernel/ToolHandle.h" #include "StorageSvc/DbType.h" #include "AthenaBaseComps/AthCnvSvc.h" +#include "AthenaKernel/IAthenaIPCTool.h" +#include "GaudiKernel/IChronoStatSvc.h" +#include "PoolSvc/IPoolSvc.h" +#include "AthenaKernel/IClassIDSvc.h" #include <vector> #include <map> #include <mutex> // Forward declarations -class IAthenaIPCTool; class IAthenaSerializeSvc; -class IChronoStatSvc; -class IClassIDSvc; -class IPoolSvc; class Guid; template <class TYPE> class SvcFactory; @@ -42,6 +42,7 @@ class ATLAS_CHECK_THREAD_SAFETY AthenaPoolCnvSvc : public ::AthCnvSvc, friend class SvcFactory<AthenaPoolCnvSvc>; public: + /// Required of all Gaudi Services StatusCode initialize(); /// Required of all Gaudi Services @@ -176,66 +177,68 @@ private: // member functions bool doClear = true) const; private: // data - pool::DbType m_dbType; + pool::DbType m_dbType{pool::ROOTTREEINDEX_StorageType}; std::string m_lastInputFileName; - ServiceHandle<IPoolSvc> m_poolSvc; - ServiceHandle<IChronoStatSvc> m_chronoStatSvc; - ServiceHandle<IClassIDSvc> m_clidSvc; - ServiceHandle<IAthenaSerializeSvc> m_serializeSvc; - ToolHandle<IAthenaIPCTool> m_inputStreamingTool; + ServiceHandle<IPoolSvc> m_poolSvc{this,"PoolSvc","PoolSvc"}; + ServiceHandle<IChronoStatSvc> m_chronoStatSvc{this,"ChronoStatSvc","ChronoStatSvc"}; + ServiceHandle<IClassIDSvc> m_clidSvc{this,"ClassIDSvc","ClassIDSvc"}; + ServiceHandle<IAthenaSerializeSvc> m_serializeSvc{this,"AthenaRootSerializeSvc","AthenaRootSerializeSvc"}; + ToolHandle<IAthenaIPCTool> m_inputStreamingTool{this,"InputStreamingTool"}; ToolHandleArray<IAthenaIPCTool> m_outputStreamingTool; - std::size_t m_streamServer; - int m_metadataClient; + //The following doesn't work because of Gaudi issue #122 + //ToolHandleArray<IAthenaIPCTool> m_outputStreamingTool{this,"OutputStreamingTool", {} }; + std::size_t m_streamServer=0; + int m_metadataClient=0; private: // properties /// UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: /// default = false. - BooleanProperty m_useDetailChronoStat; + BooleanProperty m_useDetailChronoStat{this,"UseDetailChronoStat",false}; /// PoolContainerPrefix, prefix for top level POOL container: default = "POOLContainer" - StringProperty m_containerPrefixProp; + StringProperty m_containerPrefixProp{this,"PoolContainerPrefix","ROOTTREEINDEX:CollectionTree"}; /// TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>" - StringProperty m_containerNameHintProp; + StringProperty m_containerNameHintProp{this,"TopLevelContainerName",""}; /// SubLevelBranchName, naming hint policy for POOL branching: default = "" (no branching) - StringProperty m_branchNameHintProp; + StringProperty m_branchNameHintProp{this,"SubLevelBranchName", "<type>/<key>"}; /// Output PoolAttributes, vector with names and values of technology specific attributes for POOL - StringArrayProperty m_poolAttr; + StringArrayProperty m_poolAttr{this,"PoolAttributes",{},"Pool Attributes","Set<std::string>"}; std::vector<std::vector<std::string> > m_domainAttr; std::vector<std::vector<std::string> > m_databaseAttr; std::vector<std::vector<std::string> > m_containerAttr; std::vector<unsigned int> m_contextAttr; /// Input PoolAttributes, vector with names and values of technology specific attributes for POOL - StringArrayProperty m_inputPoolAttr; + StringArrayProperty m_inputPoolAttr{this,"InputPoolAttributes",{}}; std::vector<std::vector<std::string> > m_inputAttr; /// Print input PoolAttributes per event, vector with names of technology specific attributes for POOL /// to be printed each event - StringArrayProperty m_inputPoolAttrPerEvent; + StringArrayProperty m_inputPoolAttrPerEvent{this,"PrintInputAttrPerEvt",{}}; std::vector<std::vector<std::string> > m_inputAttrPerEvent; /// Output FileNames to be associated with Stream Clients - StringArrayProperty m_streamClientFilesProp; + StringArrayProperty m_streamClientFilesProp{this,"OutputPoolFileAllocator",{}}; std::vector<std::string> m_streamClientFiles; /// MaxFileSizes, vector with maximum file sizes for Athena POOL output files - StringArrayProperty m_maxFileSizes; - long long m_domainMaxFileSize; + StringArrayProperty m_maxFileSizes{this,"MaxFileSizes",{}}; + long long m_domainMaxFileSize=15000000000LL; std::map<std::string, long long> m_databaseMaxFileSize; /// PersSvcPerOutput,boolean property to use multiple persistency services, one per output stream. /// default = false. - BooleanProperty m_persSvcPerOutput; + BooleanProperty m_persSvcPerOutput{this,"PersSvcPerOutput",true}; unsigned outputContextId(const std::string& outputConnection); std::mutex m_mutex; /// SkipFirstChronoCommit, boolean property to skip the first commit in the chrono stats so the first /// container being committed to disk is not 'tainted' with the POOL overhead - BooleanProperty m_skipFirstChronoCommit; + BooleanProperty m_skipFirstChronoCommit{this,"SkipFirstChronoCommit",false}; /// bool to activate the chrono stats, depending on the m_skipFirstChronoCommit data member - bool m_doChronoStat; + bool m_doChronoStat=true; /// For SharedWriter to use MetadataSvc to merge data placed in a certain container - StringProperty m_metadataContainerProp; + StringProperty m_metadataContainerProp{this,"OutputMetadataContainer",""}; }; #endif