12#include "GaudiKernel/IIoComponentMgr.h"
13#include "GaudiKernel/ConcurrencyFlags.h"
17#include "CoralKernel/Context.h"
35#include "RelationalAccess/ConnectionService.h"
36#include "RelationalAccess/IConnectionServiceConfiguration.h"
37#include "RelationalAccess/IWebCacheControl.h"
38#include "RelationalAccess/IWebCacheInfo.h"
39#include "RelationalAccess/ILookupService.h"
40#include "RelationalAccess/IDatabaseServiceSet.h"
41#include "RelationalAccess/IDatabaseServiceDescription.h"
53 return !s.empty() && (std::isdigit(s[0]) || s[0] ==
'+' || s[0] ==
'-');
67 if (
catalog.starts_with(
"xmlcatalog_file:")) {
68 const std::string fileName =
catalog.substr(16);
69 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::READ, fileName, fileName).isSuccess()) {
79 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::WRITE, fileName, fileName).isSuccess()) {
87 return(StatusCode::FAILURE);
92 return(StatusCode::FAILURE);
94 coral::ConnectionService conSvcH;
95 coral::IConnectionServiceConfiguration& csConfig = conSvcH.configuration();
99 csConfig.enablePoolAutomaticCleanUp();
100 csConfig.setConnectionTimeOut(
m_timeOut);
102 csConfig.disablePoolAutomaticCleanUp();
103 csConfig.setConnectionTimeOut(0);
105 ATH_MSG_INFO(
"Set connectionsvc retry/timeout/IDLE timeout to "
111 <<
" seconds with connection cleanup "
112 << (csConfig.isPoolAutomaticCleanUpEnabled() ?
"enabled" :
"disabled"));
114 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
116 ATH_MSG_INFO(
"Frontier compression level set to " << webCache.compressionLevel());
120 if (replicasvc.retrieve().isSuccess()) {
121 csConfig.setReplicaSortingAlgorithm(*replicasvc);
122 ATH_MSG_INFO(
"Successfully setup replica sorting algorithm");
127 MSG::Level athLvl =
msg().level();
137 if (!iomgr.retrieve().isSuccess()) {
139 return(StatusCode::FAILURE);
141 if (!iomgr->io_hasitem(
this)) {
142 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
143 return(StatusCode::FAILURE);
146 for (std::size_t icat = 0,
imax = readcat.size(); icat <
imax; icat++) {
147 if (readcat[icat].compare(0, 16,
"xmlcatalog_file:") == 0) {
148 std::string fileName = readcat[icat].substr(16);
149 if (iomgr->io_contains(
this, fileName)) {
150 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
151 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
152 return(StatusCode::FAILURE);
154 readcat[icat] =
"xmlcatalog_file:" + fileName;
160 if (
m_writeCatalog.value().compare(0, 16,
"xmlcatalog_file:") == 0) {
162 if (iomgr->io_contains(
this, fileName)) {
163 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
164 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
165 return(StatusCode::FAILURE);
183 return(StatusCode::FAILURE);
189 ATH_MSG_FATAL(
"Failed to enable thread safety in ROOT via PersistencySvc.");
190 return(StatusCode::FAILURE);
195 return(StatusCode::FAILURE);
207 ATH_MSG_FATAL(
"Failed to set ROOT default container type via PersistencySvc.");
208 return(StatusCode::FAILURE);
211 return(StatusCode::SUCCESS);
216 if (
m_useROOTIMT && Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
218 ATH_MSG_FATAL(
"Failed to enable implicit multithreading in ROOT via PersistencySvc.");
219 return(StatusCode::FAILURE);
221 ATH_MSG_INFO(
"Enabled implicit multithreading in ROOT via PersistencySvc to: " << Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1);
223 return(StatusCode::SUCCESS);
228 bool retError =
false;
235 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
243 delete persistencySvc;
246 for (
const auto& persistencyMutex :
m_pers_mut) {
247 delete persistencyMutex;
261 return(::AthService::finalize());
273 return(StatusCode::SUCCESS);
280 const std::string& auxString = placement->
auxString();
281 if (!auxString.empty()) {
282 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
283 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
284 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
288 ATH_MSG_WARNING(
"registerForWrite: Using default output Stream instead of id = " << contextId);
292 std::lock_guard<CallMutex> lock(*
m_pers_mut[contextId]);
294 if (token ==
nullptr) {
302 const std::string& auxString = token->
auxString();
303 if (!auxString.empty()) {
304 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
305 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
306 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
310 ATH_MSG_WARNING(
"setObjPtr: Using default input Stream instead of id = " << contextId);
314 ATH_MSG_VERBOSE(
"setObjPtr: token=" << token->
toString() <<
", auxString=" << auxString <<
", contextID=" << contextId);
316 std::lock_guard<CallMutex> lock(*
m_pers_mut[contextId]);
318 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
320 m_guidLists[contextId].remove(token->
dbID());
321 m_guidLists[contextId].push_back(token->
dbID());
322 while (m_guidLists[contextId].size() > maxFileIter->second) {
323 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
339 return(contextIter->second);
352 ATH_MSG_WARNING(
"Failed to set ROOT default container type via PersistencySvc for id " <<
id);
361 if (!
label.empty()) {
367 return(contextIter->second);
377 if (!
label.empty()) {
412 if (token.compare(0, 4,
"PFN:") == 0) {
414 }
else if (token.compare(0, 4,
"LFN:") == 0) {
415 m_catalog->lookupFileByLFN(token.substr(4), dbID);
416 }
else if (token.compare(0, 4,
"FID:") == 0) {
417 dbID = token.substr(4);
429 std::string dbID,
type;
444 const std::string& connection,
445 const std::string& collectionName,
446 unsigned int contextId)
const {
447 ATH_MSG_DEBUG(
"createCollection() type="<< collectionType <<
", connection=" << connection
448 <<
", name=" << collectionName <<
", contextID=" << contextId);
449 std::string collection(collectionName);
450 if (collectionType ==
"RootCollection") {
451 if (collectionName.find(
"PFN:") == std::string::npos
452 && collectionName.find(
"LFN:") == std::string::npos
453 && collectionName.find(
"FID:") == std::string::npos) {
454 collection =
"PFN:" + collectionName;
458 ATH_MSG_WARNING(
"createCollection: Using default input Stream instead of id = " << contextId);
463 bool insertFile =
false;
464 if (connection.compare(0, 4,
"PFN:") == 0) {
465 std::string fid, fileType;
466 m_catalog->lookupFileByPFN(connection.substr(4), fid, fileType);
469 ATH_MSG_INFO(
"File is not in Catalog! Attempt to open it anyway.");
473 if (collectionType ==
"ImplicitCollection") {
474 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
475 if (dbH ==
nullptr) {
476 ATH_MSG_INFO(
"Failed to get Session/DatabaseHandle to create POOL collection.");
481 dbH->connectForRead();
483 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
484 if (maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
485 const Guid guid(dbH->fid());
486 m_guidLists[contextId].remove(guid);
487 m_guidLists[contextId].push_back(guid);
488 while (m_guidLists[contextId].size() > maxFileIter->second + 1) {
489 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
493 if (contH ==
nullptr) {
494 ATH_MSG_INFO(
"Failed to find container " << collection <<
" to create POOL collection.");
500 }
catch(std::exception& e) {
501 ATH_MSG_INFO(
"Failed to open container to check POOL collection - trying.");
509 if (collectionType ==
"RootCollection" &&
511 ATH_MSG_INFO(
"Writing RootCollection - do not pass session pointer");
513 collPtr = collSvc.handle(collection, collectionType,
"",
true);
517 std::string tree_error, rntuple_error;
519 collPtr = collSvc.handle(collection, collectionType, collectionType ==
"ImplicitCollection" ? connection :
"",
true, &
m_persistencySvcVec[contextId]->session());
520 }
catch (std::exception &e) {
521 tree_error = e.what();
524 collPtr = collSvc.handle(collection,
"RNTCollection", collectionType ==
"ImplicitCollection" ? connection :
"",
true, &
m_persistencySvcVec[contextId]->session());
525 }
catch (std::exception &e) {
527 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
528 if (dbH !=
nullptr) {
529 if (!dbH->fid().empty()) {
534 rntuple_error = e.what();
536 if( !collPtr )
throw std::runtime_error(
"Failed to open APR Collection as RootCollection or RNTCollection: "
537 + tree_error +
" | " + rntuple_error +
"PoolSvc::createCollection" );
540 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
541 if (dbH ==
nullptr) {
543 }
else if (dbH->fid().empty()) {
544 ATH_MSG_INFO(
"Cannot retrieve the FID of an existing POOL database: '"
545 << connection <<
"' - FileCatalog will NOT be updated.");
552 if (
m_useROOTMaxTree && Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1) {
564 std::string fid = dbH.
fid();
566 catalog_locked->registerPFN(pfn,
"ROOT_All", fid);
570 const std::string& collection,
571 const unsigned long ientry)
const {
574 if (dbH ==
nullptr) {
578 dbH->connectForRead();
581 if (contH ==
nullptr) {
586 for (
unsigned long ipos = 0; ipos < ientry; ipos++) {
587 delete thisToken; thisToken = tokenIter->
next();
589 delete tokenIter; tokenIter =
nullptr;
596 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
601 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
604 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
609 return(StatusCode::FAILURE);
615 return(StatusCode::SUCCESS);
619 return(StatusCode::FAILURE);
622 return(StatusCode::SUCCESS);
627 return(StatusCode::FAILURE);
634 return(StatusCode::FAILURE);
640 return(StatusCode::SUCCESS);
645 return(StatusCode::FAILURE);
652 return(StatusCode::FAILURE);
655 return(StatusCode::SUCCESS);
659 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
661 return(StatusCode::SUCCESS);
666 if (!
commit(contextId).isSuccess()) {
668 return(StatusCode::FAILURE);
673 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
674 return(StatusCode::FAILURE);
677 return(StatusCode::SUCCESS);
682 return(StatusCode::SUCCESS);
685 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
686 if (dbH ==
nullptr) {
688 return(StatusCode::FAILURE);
690 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
692 m_guidLists[contextId].remove(
Guid(dbH->fid()));
695 return(StatusCode::SUCCESS);
700 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
701 if (dbH ==
nullptr) {
702 ATH_MSG_DEBUG(
"getFileSize: Failed to get Session/DatabaseHandle to get POOL FileSize property.");
707 dbH->setTechnology(tech);
708 dbH->connectForWrite();
710 dbH->connectForRead();
713 return(dbH->technologySpecificAttributes().attribute<
long long int>(
"FILE_SIZE"));
719 unsigned int contextId)
const {
721 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
726 std::ostringstream oss;
727 if (
data ==
"DbLonglong") {
729 }
else if (
data ==
"double") {
736 return(StatusCode::SUCCESS);
742 const std::string& dbName,
743 const std::string& contName,
744 unsigned int contextId)
const {
746 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
747 if (dbH ==
nullptr) {
748 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
749 return(StatusCode::FAILURE);
753 dbH->setTechnology(tech);
754 dbH->connectForWrite();
756 dbH->connectForRead();
759 std::ostringstream oss;
760 if (contName.empty()) {
761 if (
data ==
"DbLonglong") {
762 oss << std::dec << dbH->technologySpecificAttributes().attribute<
long long int>(optName);
763 }
else if (
data ==
"double") {
764 oss << std::dec << dbH->technologySpecificAttributes().attribute<
double>(optName);
765 }
else if (
data ==
"string") {
766 oss << dbH->technologySpecificAttributes().attribute<
char*>(optName);
768 oss << std::dec << dbH->technologySpecificAttributes().attribute<
int>(optName);
770 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
773 if (contH ==
nullptr) {
774 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
775 return(StatusCode::FAILURE);
777 if (
data ==
"DbLonglong") {
778 oss << std::dec << contH->technologySpecificAttributes().attribute<
long long int>(optName);
779 }
else if (
data ==
"double") {
780 oss << std::dec << contH->technologySpecificAttributes().attribute<
double>(optName);
782 oss << std::dec << contH->technologySpecificAttributes().attribute<
int>(optName);
784 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
787 return(StatusCode::SUCCESS);
791 const std::string&
data,
793 unsigned int contextId)
const {
795 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
803 return(StatusCode::FAILURE);
808 return(StatusCode::FAILURE);
811 return(StatusCode::SUCCESS);
815 const std::string&
data,
817 const std::string& dbName,
818 const std::string& contName,
819 unsigned int contextId)
const {
821 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
825 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
826 if (dbH ==
nullptr) {
827 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
828 return(StatusCode::FAILURE);
832 dbH->setTechnology(tech);
833 dbH->connectForWrite();
835 dbH->connectForRead();
838 bool retError =
false;
840 bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6,
"TTree=") == 0);
842 objName = hasTTreeName ? contName.substr(6) : contName;
844 retError = dbH->technologySpecificAttributes().setAttribute(optName,
data.c_str(), objName);
845 }
else if(
data[
data.size() - 1] ==
'L' ) {
846 retError = dbH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
848 retError = dbH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
852 return(StatusCode::FAILURE);
856 if (contH ==
nullptr) {
857 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
858 return(StatusCode::FAILURE);
860 if (
auto p = contName.find(
'('); p != std::string::npos) {
861 objName = contName.substr(p + 1);
862 objName.erase(objName.find(
')'));
863 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
864 objName = contName.substr(p + 2);
865 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
866 objName = contName.substr(p + 1);
867 objName.erase(objName.find(
'/'));
869 std::string::size_type off = 0;
870 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
874 retError = contH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
876 retError = contH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
879 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " <<
data);
880 return(StatusCode::FAILURE);
883 return(StatusCode::SUCCESS);
891 std::vector<std::string> physcons;
892 if (conn.find(
':') == std::string::npos) {
895 const std::string lookSvcStr(
"CORAL/Services/XMLLookupService");
896 coral::IHandle<coral::ILookupService> lookSvcH =
m_context->query<coral::ILookupService>();
897 if (!lookSvcH.isValid()) {
899 lookSvcH =
m_context->query<coral::ILookupService>();
901 if (!lookSvcH.isValid()) {
903 return(StatusCode::FAILURE);
905 coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
906 if (dbset !=
nullptr) {
907 for (
int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
908 const std::string pcon = dbset->replica(irep).connectionString();
909 if (pcon.compare(0, 9,
"frontier:") == 0) {
910 physcons.push_back(std::move(pcon));
913 delete dbset; dbset =
nullptr;
915 ATH_MSG_DEBUG(
"setFrontierCache: Could not find any replicas for " << conn);
917 }
else if (conn.compare(0, 9,
"frontier:") == 0) {
918 physcons.push_back(conn);
921 if (physcons.size() == 0) {
922 return(StatusCode::SUCCESS);
924 coral::ConnectionService conSvcH;
928 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
929 for (
const auto& physcon : physcons) {
931 if (std::find(refreshList.begin(), refreshList.end(), physcon) == refreshList.end()
932 && std::find(refreshList.begin(), refreshList.end(), conn) == refreshList.end()) {
935 webCache.refreshTable(physcon,
"DUMMYTABLE");
938 webCache.refreshSchemaInfo(physcon);
940 ATH_MSG_DEBUG(
"Cache flag for connection " << physcon <<
" set to " << webCache.webCacheInfo(physcon).isSchemaInfoCached());
942 return(StatusCode::SUCCESS);
950 if (
catalog.compare(0, 8,
"apcfile:") == 0 ||
catalog.compare(0, 7,
"prfile:") == 0) {
951 std::string::size_type cpos =
catalog.find(
':');
966 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
977 }
catch(std::exception& e) {
978 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
988std::unique_ptr<pool::IDatabase>
PoolSvc::getDbHandle(
unsigned int contextId,
const std::string& dbName)
const {
990 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
1005 if (dbName.compare(0, 4,
"PFN:") == 0) {
1007 }
else if (dbName.compare(0, 4,
"LFN:") == 0) {
1009 }
else if (dbName.compare(0, 4,
"FID:") == 0) {
1017 if (dbH ==
nullptr) {
1024 if (contName.find(
"DataHeader") != std::string::npos) {
1025 contH = dbH->
containerHandle(contName.substr(0, contName.find(
"_p")));
1029 return(std::unique_ptr<pool::IContainer>(contH));
1035 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
1036 if (cpath && strcmp(cpath,
"") != 0) {
1037 const std::string testpath = std::string(cpath) +
"/" + leaf;
1041 if (FILE* fp = std::fopen(testpath.c_str(),
"r")) {
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
This file contains the class definition for the Placement class (migrated from POOL).
bool isNumber(const std::string &s)
This file contains the class definition for the PoolSvc class.
This file contains the class definition for the Token class (migrated from POOL).
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
static constexpr int stringSize()
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
This class holds all the necessary information to guide the writing of an object in a physical place.
const std::string & auxString() const
Access auxiliary string.
const std::string & containerName() const
Access container name.
virtual long long int getFileSize(const std::string &dbName, long tech, unsigned int contextId) const override
Get POOL FileSize attribute for database without logging a message.
virtual StatusCode io_reinit() override
pool::IFileCatalog * createCatalog()
virtual Token * registerForWrite(const Placement *placement, const void *obj, const RootType &classDesc) override
virtual ~PoolSvc()
Destructor.
virtual StatusCode connect(pool::ITransaction::Type type, unsigned int contextId=IPoolSvc::kInputStream) override
Connect to a logical database unit; PersistencySvc is chosen according to transaction type (accessmod...
Gaudi::Property< int > m_retrialTimeOut
ConnectionRetrialTimeOut, the retrial time out for CORAL Connection Service: default = 300 seconds.
Gaudi::Property< int > m_timeOut
ConnectionTimeOut, the time out for CORAL Connection Service: default = 5 seconds.
virtual void renamePfn(const std::string &pf, const std::string &newpf) override
Gaudi::Property< int > m_retrialPeriod
ConnectionRetrialPeriod, retry period for CORAL Connection Service: default = 30 seconds.
virtual const coral::Context * context() const override
pool::IFileCatalog * m_catalog
Gaudi::Property< std::vector< std::string > > m_frontierRefresh
std::string poolCondPath(const std::string &leaf)
Resolve a file using ATLAS_POOLCOND_PATH.
virtual unsigned int getInputContextMapSize() const override
void patchCatalog(const std::string &pfn, pool::IDatabase &dbH) const
virtual unsigned int getInputContext(const std::string &label, unsigned int maxFile=0) override
Gaudi::Property< bool > m_sortReplicas
Use DBReplicaSvc to sort database connections, default = true.
std::recursive_mutex CallMutex
Gaudi::Property< std::string > m_defaultROOTContainerType
Default ROOT container type.
virtual void lookupBestPfn(const std::string &token, std::string &pfn, std::string &type) const override
virtual StatusCode setAttribute(const std::string &optName, const std::string &data, long tech, unsigned int contextId=IPoolSvc::kOutputStream) const override
Set POOL attributes - domain.
Gaudi::Property< bool > m_connClean
ConnectionCleanUp - whether to use CORAL connection management thread: default = false.
Gaudi::Property< bool > m_useROOTIMT
Use ROOT Implicit MultiThreading, default = true.
virtual StatusCode commit(unsigned int contextId=IPoolSvc::kInputStream) const override
Commit data for a given contextId and flush buffer.
std::unique_ptr< pool::IContainer > getContainerHandle(pool::IDatabase *dbH, const std::string &contName) const
Get Container handle.
virtual Token * getToken(const std::string &connection, const std::string &collection, const unsigned long ientry) const override
virtual StatusCode start() override
Required of all Gaudi services:
Gaudi::Property< int > m_frontierComp
Frontier proprties, compression level and list of schemas to be refreshed: default = 5.
StatusCode setupPersistencySvc()
virtual StatusCode io_finalize() override
Gaudi::Property< int > m_dbAgeLimit
MaxFilesOpen, option to have PoolSvc limit the number of open Input Files: default = 0 (No files are ...
Gaudi::Property< bool > m_useROOTMaxTree
Increase virtual TTree size to avoid backreads in multithreading, default = false.
std::map< std::string, unsigned int > m_outputContextLabel
std::vector< pool::IPersistencySvc * > m_persistencySvcVec
virtual StatusCode disconnectDb(const std::string &connection, unsigned int contextId=IPoolSvc::kInputStream) const override
Disconnect single Database.
std::vector< CallMutex * > m_pers_mut
std::map< std::string, unsigned int > m_inputContextLabel
virtual void setObjPtr(void *&obj, const Token *token) override
virtual void loadComponent(const std::string &compName) override
Gaudi::Property< std::vector< std::string > > m_readCatalog
ReadCatalog, the list of additional POOL input file catalogs to consult: default = empty vector.
std::string m_mainOutputLabel
virtual const pool::IFileCatalog * catalog() const override
std::map< unsigned int, unsigned int > m_contextMaxFile
virtual pool::ICollection * createCollection(const std::string &collectionType, const std::string &connection, const std::string &collectionName, unsigned int contextId=IPoolSvc::kInputStream) const override
virtual void setShareMode(bool shareCat) override
std::unique_ptr< pool::IDatabase > getDbHandle(unsigned int contextId, const std::string &dbName) const
Get Database handle.
coral::Context * m_context
virtual StatusCode commitAndHold(unsigned int contextId=IPoolSvc::kInputStream) const override
Commit data for a given contextId and hold buffer.
virtual StatusCode disconnect(unsigned int contextId=IPoolSvc::kInputStream) const override
Disconnect PersistencySvc associated with a contextId.
virtual StatusCode finalize() override
Required of all Gaudi services:
virtual StatusCode initialize() override
Required of all Gaudi services:
virtual StatusCode setFrontierCache(const std::string &conn) override
Setup Frontier cache for given logical or physical connection name.
virtual std::map< std::string, unsigned int > getInputContextMap() const override
virtual unsigned int getOutputContext(const std::string &label) override
Gaudi::Property< std::string > m_writeCatalog
WriteCatalog, the file catalog to be used to register output files (also default input catalog): defa...
virtual StatusCode stop() override
Gaudi::Property< bool > m_attemptCatalogPatch
AttemptCatalogPatch, option to create catalog: default = false.
std::map< unsigned int, std::list< Guid > > m_guidLists ATLAS_THREAD_SAFE
virtual StatusCode getAttribute(const std::string &optName, std::string &data, long tech, unsigned int contextId=IPoolSvc::kInputStream) const override
Get POOL attributes - domain.
Gaudi::Property< std::string > m_fileOpen
FileOpen, the open mode for the file ("append" or "overwrite").
This class provides a token that identifies in a unique way objects on the persistent storage.
const std::string & auxString() const
Access auxiliary string.
virtual const std::string toString() const
Retrieve the string representation of the token.
Token & fromString(const std::string_view from)
Build from the string representation of a token.
const Guid & dbID() const
Access database identifier.
A service for creating, accessing and managing an ensemble of collections of event references.
DatabaseConnectionPolicy is a class holding information on the policy to be followed whenever a datab...
bool setWriteModeForExisting(Mode mode)
Sets the opening mode when an existing database is opened for writing.
bool setWriteModeForNonExisting(Mode mode)
Sets the opening mode when a non existing database is opened for writing Acceptable values are RAISE_...
static DbType getType(const std::string &name)
Access known storage type object by name.
An interface to a storage technology specific collection of event references and attributes.
IContainer is the base class for container objects.
IDatabase is the base class for database objects.
virtual OpenMode openMode() const =0
Returns the opening mode. It can be used to check whether the database is connected.
virtual bool setTechnology(long technology)=0
Sets the technology identifier for this database.
virtual const std::string & fid()=0
Returns the file identifier of this database.
virtual void connectForRead()=0
Connects explicitly to the database for read operations.
virtual IContainer * containerHandle(const std::string &name)=0
Returns a pointer to a container object. The user acquires ownership of that object.
void addReadCatalog(const std::string &connect)
Add new catalog identified by name to the existing ones.
void removeCatalog(const std::string &connect)
Add new catalog identified by reference to the existing ones.
void setWriteCatalog(const std::string &connect)
Access to the (first) writable file catalog.
IPersistencySvc is the abstract interface for all services which execute the conversion between trans...
virtual ISession & session()=0
Returns the underlying global session.
static std::unique_ptr< IPersistencySvc > create(IFileCatalog &catalog)
Factory for PersistencySvc.
ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a...
virtual std::unique_ptr< IDatabase > databaseHandle(const std::string &dbName, DatabaseSpecification::NameType dbNameType)=0
Returns a pointer to a database object. The user acquires ownership of that object.
virtual ITransaction & transaction()=0
Returns the transaction object.
virtual const ITechnologySpecificAttributes & technologySpecificAttributes(long technology) const =0
Returns the object holding the technology specific attributes for a given technology domain.
virtual bool disconnectAll()=0
Explicitly disconnects all the databases.
T attribute(const std::string &attributeName, const std::string &option="")
Templated method to retrieve an attribute.
bool setAttribute(const std::string &attributeName, const T &atttibuteValue, const std::string &option="")
Templated method to set an attribute.
ITokenIterator is the interface class for iterators of tokens.
virtual Token * next()=0
Returns the pointer to next token.
virtual bool commitAndHold()=0
Commits the holds transaction.
Type
Transaction type enumeration.
virtual bool commit()=0
Commits the transaction.
virtual Type type() const =0
Returns the transaction type.
virtual bool start(Type type=READ)=0
Starts a new transaction. Returns the success of the operation.
virtual bool isActive() const =0
Checks if the transaction is active.
std::string label(const std::string &format, int i)
static const DbType ROOT_StorageType
static void setLevel(MSG::Level l)