diff --git a/Database/APR/FileCatalog/FileCatalog/IFileCatalog.h b/Database/APR/FileCatalog/FileCatalog/IFileCatalog.h index 8c1f1e2eb848dc8cc25832ff7e1064ee73abbe69..756b3f6bfd982a4ba5175377539659027aed142f 100644 --- a/Database/APR/FileCatalog/FileCatalog/IFileCatalog.h +++ b/Database/APR/FileCatalog/FileCatalog/IFileCatalog.h @@ -55,7 +55,7 @@ namespace pool { /// Get all FIDs void getFIDs( Strings& fids ) const { return _fc->getFID(fids); } - /// Dump all LFNames of the catalog and their attributes associate to the FileID + /// Get all logical names for a given FID. Return pairs <LFN,FID> void getLFNs( const std::string& fid, Files& files ) const { return _fc->getLFN(fid, files); } /// Dump all PFNames of the catalog and their attributes associate to the FileID diff --git a/Database/APR/FileCatalog/FileCatalog/URIParser.h b/Database/APR/FileCatalog/FileCatalog/URIParser.h index 45afb0472dae18078c2b9a25b2148ba928d19764..0bcd8a0bd29d3c2fec9d335b6ef51f9228edfe4d 100755 --- a/Database/APR/FileCatalog/FileCatalog/URIParser.h +++ b/Database/APR/FileCatalog/FileCatalog/URIParser.h @@ -29,10 +29,11 @@ namespace pool{ ///Print the parsing result void dump() const; void setURI(const std::string& contactstr); - const std::string contactstring() const; - const std::string prefix() const; - const std::string url() const; + const std::string& contactstring() const; + const std::string& prefix() const; + const std::string& url() const; void parse(); + private: std::string m_contactstr; std::string m_prefix; diff --git a/Database/APR/FileCatalog/src/IFileCatalog.cpp b/Database/APR/FileCatalog/src/IFileCatalog.cpp index 0d2e9ada096bd4248f94dd9d04dc3a490666d12a..1a283ffd02691010f2147fad528ba665da587ea5 100644 --- a/Database/APR/FileCatalog/src/IFileCatalog.cpp +++ b/Database/APR/FileCatalog/src/IFileCatalog.cpp @@ -170,7 +170,13 @@ void pool::IFileCatalog::addCatalog( const std::string& connect ) { return p.url() == f->connectInfo(); } ); if( i==cats.end() ) { // add a new catalog - _mgr->addCatalog(connect); + const std::string checkstr = "file:"; + std::string fullconnectstr = connect; + if( connect.compare(0, checkstr.size(), checkstr) == 0 ) { + fullconnectstr = "xmlcatalog_" + connect; + } + ATH_MSG_DEBUG("addCatalog(\"" << fullconnectstr << "\")" ); + _mgr->addCatalog( fullconnectstr ); } } diff --git a/Database/APR/FileCatalog/src/URIParser.cpp b/Database/APR/FileCatalog/src/URIParser.cpp index 029790832ac4591d2dcecb100ce8383673fca677..ab9fc7a37ca5c27078975726fdfc52f3697c1ccd 100755 --- a/Database/APR/FileCatalog/src/URIParser.cpp +++ b/Database/APR/FileCatalog/src/URIParser.cpp @@ -47,10 +47,11 @@ namespace pool{ size_t prefixpos=m_contactstr.find_first_of('_'); size_t startpos=0; - if(prefixpos == m_contactstr.npos || prefixpos>tmppos){ + if(prefixpos == m_contactstr.npos || prefixpos>tmppos) { m_url=m_contactstr; if(tmppos != m_contactstr.npos && m_contactstr.substr(0,5)!="file:"){ - throw Exception("only file: protocol is allowed for PFC contactstring with no prefix.", "URIParser::parse", "APR"); + throw Exception("only file: protocol is allowed for PFC contactstring with no prefix.", + "URIParser::parse", "APR"); } }else{ //have prefix @@ -63,18 +64,18 @@ namespace pool{ }//end prefix lookup } - const std::string URIParser::contactstring() const{ + const std::string& URIParser::contactstring() const{ return m_contactstr; } - const std::string URIParser::prefix() const{ + const std::string& URIParser::prefix() const{ return m_prefix; } - const std::string URIParser::url() const{ + const std::string& URIParser::url() const{ return m_url; } - URIParser::~URIParser(){ - } + + URIParser::~URIParser() { } }//ns pool diff --git a/Database/APR/FileCatalog/utilities/FClistLFN.cpp b/Database/APR/FileCatalog/utilities/FClistLFN.cpp index e81ec89ff94261e9e7c5499b37f14c95a2185cf7..6452d8827acf60a4ad6dc2af5c0e46a592a40ea8 100755 --- a/Database/APR/FileCatalog/utilities/FClistLFN.cpp +++ b/Database/APR/FileCatalog/utilities/FClistLFN.cpp @@ -108,7 +108,7 @@ int main(int argc, char** argv) pool::IFileCatalog::Files files; mycatalog->getLFNs( fid, files ); for( const auto& file: files ) { - std::cout<< file.first <<std::endl; + std::cout << file.first << " , " << file.second << std::endl; } } diff --git a/Database/APR/POOLCore/src/SystemTools.cpp b/Database/APR/POOLCore/src/SystemTools.cpp index 3c4e665d24e62d8a054efaca6793ad59b3cd7bf9..c701f1d1567dce130a10b7d55f1b62347f664327 100755 --- a/Database/APR/POOLCore/src/SystemTools.cpp +++ b/Database/APR/POOLCore/src/SystemTools.cpp @@ -131,14 +131,14 @@ namespace pool log << DbPrintLvl::Warning << "Gaudi framework failed to initialize" << endmsg; return false; } - SmartIF<ISvcManager> svcMgr(iface); SmartIF<IAppMgrUI> appMgr(iface); SmartIF<IProperty> propMgr(iface); - SmartIF<ISvcLocator> svcLoc(iface); propMgr->setProperty( "JobOptionsType", "NONE" ) .ignore(); - // prevents some output from the AppMgr - propMgr->setProperty( "OutputLeveL", "5" ) .ignore(); + // prevents unwanted output from the AppMgr + propMgr->setProperty( "OutputLeveL", "4" ) .ignore(); + // minimal configuration + propMgr->setProperty( "EventLoop", "MinimalEventLoopMgr" ) .ignore(); // this prevents AppMgr "welcome" output propMgr->setProperty( "AppName", "" ) .ignore(); @@ -150,5 +150,3 @@ namespace pool } } // ns pool - - diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx index 44205a6a42dc56dbb309f089a2bd24e7c9ace488..5be656dfa9a1ec604194d1bafa8e8aa8aa63049f 100644 --- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx +++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx @@ -22,7 +22,7 @@ #include "CollectionBase/CollectionDescription.h" #include "FileCatalog/IFileCatalog.h" - +#include "POOLCore/DbPrint.h" #include "PersistencySvc/IPersistencySvc.h" #include "PersistencySvc/ISession.h" #include "PersistencySvc/IDatabase.h" diff --git a/Database/AthenaRoot/AthenaRootComps/src/RootSvc.cxx b/Database/AthenaRoot/AthenaRootComps/src/RootSvc.cxx index 47d38be346ff7978ac36745dc60f17f31403ae94..94dd01fb2920dbab70a4ce7af262a58fa5ea284b 100755 --- a/Database/AthenaRoot/AthenaRootComps/src/RootSvc.cxx +++ b/Database/AthenaRoot/AthenaRootComps/src/RootSvc.cxx @@ -124,13 +124,13 @@ void RootSvc::destructObject(const RootType& /*type*/, void* /*pObj*/) const { /// Open the file `fname` with open mode `mode` StatusCode RootSvc::open(const std::string& fname, const std::string& /*mode*/) { // Catalog to get fid... + Guid fid = Guid::null(); if (m_catalog != 0) { std::string fidString, ftype; m_catalog->lookupFileByPFN(fname, fidString, ftype); if( fidString.empty() ) { m_catalog->registerPFN(fname, "ROOT_All", fidString); } - Guid fid; fid.fromString(fidString); } Athena::RootConnection* conn = 0; @@ -199,13 +199,13 @@ StatusCode RootSvc::disconnect(const std::string& fname) { /// @returns NULL if no such file is known to this service Athena::RootConnection* RootSvc::connection(const std::string& fname) { // Catalog to get fid... + Guid fid = Guid::null(); if (m_catalog != 0) { std::string fidString, ftype; m_catalog->lookupFileByPFN(fname, fidString, ftype); if( fidString.empty() ) { m_catalog->registerPFN(fname, "ROOT_All", fidString); } - Guid fid; fid.fromString(fidString); } Athena::RootConnection* conn = 0; diff --git a/Database/CoolConvUtilities/src/AtlCoolCopy.cxx b/Database/CoolConvUtilities/src/AtlCoolCopy.cxx index 0395b55ae3ac86150be17ca226475334fc185d6f..5e34ed8a26a4a95a77586b361cb43c3b3f319afd 100755 --- a/Database/CoolConvUtilities/src/AtlCoolCopy.cxx +++ b/Database/CoolConvUtilities/src/AtlCoolCopy.cxx @@ -3050,10 +3050,10 @@ int AtlCoolCopy::resolvePoolRefs() { ipool!=m_poolrefs.end();++ipool) { pool::FileCatalog::FileID guid=ipool->first; pool::IFileCatalog::Files lfns; - catalog->getLFNs( lfns ); - if (mylfn.hasNext()) { + catalog->getLFNs( guid, lfns ); + if( !lfns.empty() ) { // file found in cataloge - print LFN and usage count - const std::string lfn=mylfn.Next().lfname(); + const std::string lfn = lfns[0].first; ipool->second.setlfn(lfn); std::cout << "LFN: " << lfn << " (" << ipool->second.count() << ")" << std::endl; @@ -3064,10 +3064,9 @@ int AtlCoolCopy::resolvePoolRefs() { if (!m_listpfn) ipool->second.setErrorBit(0); } if (m_listpfn || m_poolopen) { - pool::PFNContainer mypfn(catalog,100); - lookup.lookupPFN(guid,mypfn); - if (mypfn.hasNext()) { - const std::string pfn=mypfn.Next().pfname(); + std::string pfn, tech; + catalog->getFirstPFN( guid, pfn, tech ); + if( !pfn.empty() ) { ipool->second.setpfn(pfn); std::cout << "PFN: " << pfn << " (" << ipool->second.count() << ")" << std::endl; @@ -3119,8 +3118,6 @@ int AtlCoolCopy::resolvePoolRefs() { // put in the output dataset definition catalog=setupCatalog(m_mergecat); if (catalog==0) return 110; - pool::FClookup lookup; - catalog->setAction(lookup); const std::string dssname="register.sh"; std::cout << "Write DQ2 registerFileInDataset commands to " << dssname << " for registration in dataset " << m_newdataset << std::endl; @@ -3129,12 +3126,11 @@ int AtlCoolCopy::resolvePoolRefs() { itr!=dsfound.end();++itr) { const std::string& lfn=itr->first; const std::string& guid=itr->second; - pool::FileCatalog::FileID pguid=guid; - pool::LFNContainer mylfn(catalog,100); - lookup.lookupLFN(pguid,mylfn); - if (mylfn.hasNext()) { + pool::IFileCatalog::Files lfns; + catalog->getLFNs( guid, lfns ); + if( !lfns.empty() ) { // file is already registered - check logical names are consistent - const std::string lfn2=mylfn.Next().lfname(); + const std::string lfn2 = lfns[0].first; if (lfn2!=lfn) std::cout << "WARNING: LFNs for GUID " << guid << " differ in input/merge datasets: " << lfn << " vs " << lfn2 << std::endl; diff --git a/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolHistSvc.cxx b/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolHistSvc.cxx index f754177617657405bbc964ba10d3883a10767c31..2c2aa680114682bb65819801a1576433112421b4 100755 --- a/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolHistSvc.cxx +++ b/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolHistSvc.cxx @@ -22,8 +22,6 @@ #include "TError.h" #include "TObjString.h" #include "FileCatalog/IFileCatalog.h" -#include "FileCatalog/IFCAction.h" -#include "FileCatalog/IFCContainer.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "CoolHistSvc.h" @@ -303,18 +301,11 @@ StatusCode CoolHistSvc::getHist_i(const std::string& folder, TFile* CoolHistSvc::getFile(const std::string& sguid) { ATH_MSG_DEBUG("getFile - lookup PFN for GUID "+sguid); - // get the POOL file catalogue service - pool::IFileCatalog* catalog= - const_cast<pool::IFileCatalog*>(m_poolsvc->catalog()); - pool::FClookup lookup; - catalog->setAction(lookup); - pool::FileCatalog::FileID guid=sguid; - pool::PFNContainer mypfn(catalog,10); - lookup.lookupPFN(guid,mypfn); - if (mypfn.hasNext()) { + std::string pfname, tech; + m_poolsvc->catalog()->getFirstPFN( sguid, pfname, tech ); + if( !pfname.empty() ) { // check not about to exceed max number of open files, close if needed if (m_filemap.size()>=m_par_maxfiles) closeFiles(); - const std::string pfname=mypfn.Next().pfname(); ATH_MSG_INFO("Opening "+pfname+" for read"); // now try to open file TFile* tfile; diff --git a/Event/ByteStreamCnvSvc/test/AtlCopyBSEvent.cxx b/Event/ByteStreamCnvSvc/test/AtlCopyBSEvent.cxx index e38ac6fdd6d192f2d0956efe92006f70a11e21fb..70fed2d77daa49f58e37d2eb8bd32a987ca410f0 100644 --- a/Event/ByteStreamCnvSvc/test/AtlCopyBSEvent.cxx +++ b/Event/ByteStreamCnvSvc/test/AtlCopyBSEvent.cxx @@ -39,9 +39,6 @@ #include "CollectionBase/CollectionRowBuffer.h" #include "FileCatalog/IFileCatalog.h" -#include "FileCatalog/FCLeaf.h" -#include "FileCatalog/FCImpl.h" -#include "FileCatalog/IFCAction.h" void eventLoop(DataReader*, EventStorage::DataWriter*, unsigned&, const std::vector<uint32_t>*, uint32_t, bool, bool, bool, const std::vector<long long int>* = 0); @@ -230,9 +227,7 @@ int main (int argc, char *argv[]) { if (guidPfn.count(guid) == 0) { // first instance of this guid std::string pfn; std::string type; - pool::FCregister action; - ctlg->setAction(action); - action.lookupBestPFN(guid.toString(), pool::FileCatalog::READ, pool::FileCatalog::SEQUENTIAL, pfn, type); + ctlg->getFirstPFN(guid.toString(), pfn, type); // fill map of guid to pfn guidPfn.insert(std::pair<Guid, std::string>(guid, pfn)); // add pfn to list