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()) {
406 if (token.compare(0, 4,
"PFN:") == 0) {
408 }
else if (token.compare(0, 4,
"LFN:") == 0) {
409 m_catalog->lookupFileByLFN(token.substr(4), dbID);
410 }
else if (token.compare(0, 4,
"FID:") == 0) {
411 dbID = token.substr(4);
423 std::string dbID,
type;
438 const std::string& connection,
439 const std::string& collectionName,
440 unsigned int contextId)
const {
441 ATH_MSG_DEBUG(
"createCollection() type="<< collectionType <<
", connection=" << connection
442 <<
", name=" << collectionName <<
", contextID=" << contextId);
443 std::string collection(collectionName);
444 if (collectionType ==
"RootCollection") {
445 if (collectionName.find(
"PFN:") == std::string::npos
446 && collectionName.find(
"LFN:") == std::string::npos
447 && collectionName.find(
"FID:") == std::string::npos) {
448 collection =
"PFN:" + collectionName;
452 ATH_MSG_WARNING(
"createCollection: Using default input Stream instead of id = " << contextId);
457 bool insertFile =
false;
458 if (connection.compare(0, 4,
"PFN:") == 0) {
459 std::string fid, fileType;
460 m_catalog->lookupFileByPFN(connection.substr(4), fid, fileType);
463 ATH_MSG_INFO(
"File is not in Catalog! Attempt to open it anyway.");
467 if (collectionType ==
"ImplicitCollection") {
468 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
469 if (dbH ==
nullptr) {
470 ATH_MSG_INFO(
"Failed to get Session/DatabaseHandle to create POOL collection.");
475 dbH->connectForRead();
477 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
478 if (maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
479 const Guid guid(dbH->fid());
480 m_guidLists[contextId].remove(guid);
481 m_guidLists[contextId].push_back(guid);
482 while (m_guidLists[contextId].size() > maxFileIter->second + 1) {
483 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
487 if (contH ==
nullptr) {
488 ATH_MSG_INFO(
"Failed to find container " << collection <<
" to create POOL collection.");
494 }
catch(std::exception& e) {
495 ATH_MSG_INFO(
"Failed to open container to check POOL collection - trying.");
503 if (collectionType ==
"RootCollection" &&
505 ATH_MSG_INFO(
"Writing RootCollection - do not pass session pointer");
507 collPtr = collSvc.handle(collection, collectionType,
"",
true);
511 std::string tree_error, rntuple_error;
513 collPtr = collSvc.handle(collection, collectionType, collectionType ==
"ImplicitCollection" ? connection :
"",
true, &
m_persistencySvcVec[contextId]->session());
514 }
catch (std::exception &e) {
515 tree_error = e.what();
518 collPtr = collSvc.handle(collection,
"RNTCollection", collectionType ==
"ImplicitCollection" ? connection :
"",
true, &
m_persistencySvcVec[contextId]->session());
519 }
catch (std::exception &e) {
521 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
522 if (dbH !=
nullptr) {
523 if (!dbH->fid().empty()) {
528 rntuple_error = e.what();
530 if( !collPtr )
throw std::runtime_error(
"Failed to open APR Collection as RootCollection or RNTCollection: "
531 + tree_error +
" | " + rntuple_error +
"PoolSvc::createCollection" );
534 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
535 if (dbH ==
nullptr) {
537 }
else if (dbH->fid().empty()) {
538 ATH_MSG_INFO(
"Cannot retrieve the FID of an existing POOL database: '"
539 << connection <<
"' - FileCatalog will NOT be updated.");
546 if (
m_useROOTMaxTree && Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1) {
558 std::string fid = dbH.
fid();
560 catalog_locked->registerPFN(pfn,
"ROOT_All", fid);
564 const std::string& collection,
565 const unsigned long ientry)
const {
568 if (dbH ==
nullptr) {
572 dbH->connectForRead();
575 if (contH ==
nullptr) {
580 for (
unsigned long ipos = 0; ipos < ientry; ipos++) {
581 delete thisToken; thisToken = tokenIter->
next();
583 delete tokenIter; tokenIter =
nullptr;
590 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
595 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
598 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
603 return(StatusCode::FAILURE);
609 return(StatusCode::SUCCESS);
613 return(StatusCode::FAILURE);
616 return(StatusCode::SUCCESS);
621 return(StatusCode::FAILURE);
628 return(StatusCode::FAILURE);
634 return(StatusCode::SUCCESS);
639 return(StatusCode::FAILURE);
646 return(StatusCode::FAILURE);
649 return(StatusCode::SUCCESS);
653 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
655 return(StatusCode::SUCCESS);
660 if (!
commit(contextId).isSuccess()) {
662 return(StatusCode::FAILURE);
667 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
668 return(StatusCode::FAILURE);
671 return(StatusCode::SUCCESS);
676 return(StatusCode::SUCCESS);
679 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
680 if (dbH ==
nullptr) {
682 return(StatusCode::FAILURE);
684 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
686 m_guidLists[contextId].remove(
Guid(dbH->fid()));
689 return(StatusCode::SUCCESS);
694 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
695 if (dbH ==
nullptr) {
696 ATH_MSG_DEBUG(
"getFileSize: Failed to get Session/DatabaseHandle to get POOL FileSize property.");
701 dbH->setTechnology(tech);
702 dbH->connectForWrite();
704 dbH->connectForRead();
707 return(dbH->technologySpecificAttributes().attribute<
long long int>(
"FILE_SIZE"));
713 unsigned int contextId)
const {
715 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
720 std::ostringstream oss;
721 if (
data ==
"DbLonglong") {
723 }
else if (
data ==
"double") {
730 return(StatusCode::SUCCESS);
736 const std::string& dbName,
737 const std::string& contName,
738 unsigned int contextId)
const {
740 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
741 if (dbH ==
nullptr) {
742 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
743 return(StatusCode::FAILURE);
747 dbH->setTechnology(tech);
748 dbH->connectForWrite();
750 dbH->connectForRead();
753 std::ostringstream oss;
754 if (contName.empty()) {
755 if (
data ==
"DbLonglong") {
756 oss << std::dec << dbH->technologySpecificAttributes().attribute<
long long int>(optName);
757 }
else if (
data ==
"double") {
758 oss << std::dec << dbH->technologySpecificAttributes().attribute<
double>(optName);
759 }
else if (
data ==
"string") {
760 oss << dbH->technologySpecificAttributes().attribute<
char*>(optName);
762 oss << std::dec << dbH->technologySpecificAttributes().attribute<
int>(optName);
764 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
767 if (contH ==
nullptr) {
768 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
769 return(StatusCode::FAILURE);
771 if (
data ==
"DbLonglong") {
772 oss << std::dec << contH->technologySpecificAttributes().attribute<
long long int>(optName);
773 }
else if (
data ==
"double") {
774 oss << std::dec << contH->technologySpecificAttributes().attribute<
double>(optName);
776 oss << std::dec << contH->technologySpecificAttributes().attribute<
int>(optName);
778 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
781 return(StatusCode::SUCCESS);
785 const std::string&
data,
787 unsigned int contextId)
const {
789 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
797 return(StatusCode::FAILURE);
802 return(StatusCode::FAILURE);
805 return(StatusCode::SUCCESS);
809 const std::string&
data,
811 const std::string& dbName,
812 const std::string& contName,
813 unsigned int contextId)
const {
815 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
819 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
820 if (dbH ==
nullptr) {
821 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
822 return(StatusCode::FAILURE);
826 dbH->setTechnology(tech);
827 dbH->connectForWrite();
829 dbH->connectForRead();
832 bool retError =
false;
834 bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6,
"TTree=") == 0);
836 objName = hasTTreeName ? contName.substr(6) : contName;
838 retError = dbH->technologySpecificAttributes().setAttribute(optName,
data.c_str(), objName);
839 }
else if(
data[
data.size() - 1] ==
'L' ) {
840 retError = dbH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
842 retError = dbH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
846 return(StatusCode::FAILURE);
850 if (contH ==
nullptr) {
851 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
852 return(StatusCode::FAILURE);
854 if (
auto p = contName.find(
'('); p != std::string::npos) {
855 objName = contName.substr(p + 1);
856 objName.erase(objName.find(
')'));
857 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
858 objName = contName.substr(p + 2);
859 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
860 objName = contName.substr(p + 1);
861 objName.erase(objName.find(
'/'));
863 std::string::size_type off = 0;
864 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
868 retError = contH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
870 retError = contH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
873 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " <<
data);
874 return(StatusCode::FAILURE);
877 return(StatusCode::SUCCESS);
885 std::vector<std::string> physcons;
886 if (conn.find(
':') == std::string::npos) {
889 const std::string lookSvcStr(
"CORAL/Services/XMLLookupService");
890 coral::IHandle<coral::ILookupService> lookSvcH =
m_context->query<coral::ILookupService>();
891 if (!lookSvcH.isValid()) {
893 lookSvcH =
m_context->query<coral::ILookupService>();
895 if (!lookSvcH.isValid()) {
897 return(StatusCode::FAILURE);
899 coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
900 if (dbset !=
nullptr) {
901 for (
int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
902 const std::string pcon = dbset->replica(irep).connectionString();
903 if (pcon.compare(0, 9,
"frontier:") == 0) {
904 physcons.push_back(std::move(pcon));
907 delete dbset; dbset =
nullptr;
909 ATH_MSG_DEBUG(
"setFrontierCache: Could not find any replicas for " << conn);
911 }
else if (conn.compare(0, 9,
"frontier:") == 0) {
912 physcons.push_back(conn);
915 if (physcons.size() == 0) {
916 return(StatusCode::SUCCESS);
918 coral::ConnectionService conSvcH;
922 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
923 for (
const auto& physcon : physcons) {
925 if (std::find(refreshList.begin(), refreshList.end(), physcon) == refreshList.end()
926 && std::find(refreshList.begin(), refreshList.end(), conn) == refreshList.end()) {
929 webCache.refreshTable(physcon,
"DUMMYTABLE");
932 webCache.refreshSchemaInfo(physcon);
934 ATH_MSG_DEBUG(
"Cache flag for connection " << physcon <<
" set to " << webCache.webCacheInfo(physcon).isSchemaInfoCached());
936 return(StatusCode::SUCCESS);
944 if (
catalog.compare(0, 8,
"apcfile:") == 0 ||
catalog.compare(0, 7,
"prfile:") == 0) {
945 std::string::size_type cpos =
catalog.find(
':');
960 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
971 }
catch(std::exception& e) {
972 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
982std::unique_ptr<pool::IDatabase>
PoolSvc::getDbHandle(
unsigned int contextId,
const std::string& dbName)
const {
984 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
999 if (dbName.compare(0, 4,
"PFN:") == 0) {
1001 }
else if (dbName.compare(0, 4,
"LFN:") == 0) {
1003 }
else if (dbName.compare(0, 4,
"FID:") == 0) {
1011 if (dbH ==
nullptr) {
1018 if (contName.find(
"DataHeader") != std::string::npos) {
1019 contH = dbH->
containerHandle(contName.substr(0, contName.find(
"_p")));
1023 return(std::unique_ptr<pool::IContainer>(contH));
1029 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
1030 if (cpath && strcmp(cpath,
"") != 0) {
1031 const std::string testpath = std::string(cpath) +
"/" + leaf;
1035 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.
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 const std::map< std::string, unsigned int > & getInputContextMap() const override
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 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)