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& collectionName,
446 unsigned int contextId)
const {
448 <<
", name=" << collectionName <<
", contextID=" << contextId);
450 ATH_MSG_WARNING(
"createCollection: Using default input Stream instead of id = " << contextId);
455 bool insertFile =
false;
456 if (connection.compare(0, 4,
"PFN:") == 0) {
457 std::string fid, fileType;
458 m_catalog->lookupFileByPFN(connection.substr(4), fid, fileType);
461 ATH_MSG_INFO(
"File is not in Catalog! Attempt to open it anyway.");
466 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
467 if (dbH ==
nullptr) {
468 ATH_MSG_INFO(
"Failed to get Session/DatabaseHandle to create POOL collection.");
473 dbH->connectForRead();
475 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
476 if (maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
477 const Guid guid(dbH->fid());
478 m_guidLists[contextId].remove(guid);
479 m_guidLists[contextId].push_back(guid);
480 while (m_guidLists[contextId].size() > maxFileIter->second + 1) {
481 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
484 }
catch (std::exception& e) {
485 ATH_MSG_INFO(
"Failed to open container to check POOL collection - trying.");
495 std::string error_text;
497 collPtr = collSvc.open(collectionName, collectionType, connection, &
m_persistencySvcVec[contextId]->session());
498 }
catch (std::exception &e) {
500 error_text = e.what();
503 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
504 if (dbH !=
nullptr && !dbH->fid().empty()) {
507 throw std::runtime_error(
"Failed to open APR Collection: " + error_text +
", PoolSvc::createCollection");
510 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
511 if (dbH ==
nullptr) {
513 }
else if (dbH->fid().empty()) {
514 ATH_MSG_INFO(
"Cannot retrieve the FID of an existing POOL database: '"
515 << connection <<
"' - FileCatalog will NOT be updated.");
522 if (
m_useROOTMaxTree && Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1) {
534 std::string fid = dbH.
fid();
536 catalog_locked->registerPFN(pfn,
"ROOT_All", fid);
540 const std::string& collection,
541 const unsigned long ientry)
const {
544 if (dbH ==
nullptr) {
548 dbH->connectForRead();
551 if (contH ==
nullptr) {
556 for (
unsigned long ipos = 0; ipos < ientry; ipos++) {
557 delete thisToken; thisToken = tokenIter->
next();
559 delete tokenIter; tokenIter =
nullptr;
566 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
571 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
574 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
579 return(StatusCode::FAILURE);
585 return(StatusCode::SUCCESS);
589 return(StatusCode::FAILURE);
592 return(StatusCode::SUCCESS);
597 return(StatusCode::FAILURE);
604 return(StatusCode::FAILURE);
610 return(StatusCode::SUCCESS);
615 return(StatusCode::FAILURE);
622 return(StatusCode::FAILURE);
625 return(StatusCode::SUCCESS);
629 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
631 return(StatusCode::SUCCESS);
636 if (!
commit(contextId).isSuccess()) {
638 return(StatusCode::FAILURE);
643 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
644 return(StatusCode::FAILURE);
647 return(StatusCode::SUCCESS);
652 return(StatusCode::SUCCESS);
655 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
656 if (dbH ==
nullptr) {
658 return(StatusCode::FAILURE);
660 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
662 m_guidLists[contextId].remove(
Guid(dbH->fid()));
665 return(StatusCode::SUCCESS);
670 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
671 if (dbH ==
nullptr) {
672 ATH_MSG_DEBUG(
"getFileSize: Failed to get Session/DatabaseHandle to get POOL FileSize property.");
677 dbH->setTechnology(tech);
678 dbH->connectForWrite();
680 dbH->connectForRead();
683 return(dbH->technologySpecificAttributes().attribute<
long long int>(
"FILE_SIZE"));
689 unsigned int contextId)
const {
691 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
696 std::ostringstream oss;
697 if (
data ==
"DbLonglong") {
699 }
else if (
data ==
"double") {
706 return(StatusCode::SUCCESS);
712 const std::string& dbName,
713 const std::string& contName,
714 unsigned int contextId)
const {
716 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
717 if (dbH ==
nullptr) {
718 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
719 return(StatusCode::FAILURE);
723 dbH->setTechnology(tech);
724 dbH->connectForWrite();
726 dbH->connectForRead();
729 std::ostringstream oss;
730 if (contName.empty()) {
731 if (
data ==
"DbLonglong") {
732 oss << std::dec << dbH->technologySpecificAttributes().attribute<
long long int>(optName);
733 }
else if (
data ==
"double") {
734 oss << std::dec << dbH->technologySpecificAttributes().attribute<
double>(optName);
735 }
else if (
data ==
"string") {
736 oss << dbH->technologySpecificAttributes().attribute<
char*>(optName);
738 oss << std::dec << dbH->technologySpecificAttributes().attribute<
int>(optName);
740 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
743 if (contH ==
nullptr) {
744 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
745 return(StatusCode::FAILURE);
747 if (
data ==
"DbLonglong") {
748 oss << std::dec << contH->technologySpecificAttributes().attribute<
long long int>(optName);
749 }
else if (
data ==
"double") {
750 oss << std::dec << contH->technologySpecificAttributes().attribute<
double>(optName);
752 oss << std::dec << contH->technologySpecificAttributes().attribute<
int>(optName);
754 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
757 return(StatusCode::SUCCESS);
761 const std::string&
data,
763 unsigned int contextId)
const {
765 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
773 return(StatusCode::FAILURE);
778 return(StatusCode::FAILURE);
781 return(StatusCode::SUCCESS);
785 const std::string&
data,
787 const std::string& dbName,
788 const std::string& contName,
789 unsigned int contextId)
const {
791 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
795 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
796 if (dbH ==
nullptr) {
797 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
798 return(StatusCode::FAILURE);
802 dbH->setTechnology(tech);
803 dbH->connectForWrite();
805 dbH->connectForRead();
808 bool retError =
false;
810 bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6,
"TTree=") == 0);
812 objName = hasTTreeName ? contName.substr(6) : contName;
814 retError = dbH->technologySpecificAttributes().setAttribute(optName,
data.c_str(), objName);
815 }
else if(
data[
data.size() - 1] ==
'L' ) {
816 retError = dbH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
818 retError = dbH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
822 return(StatusCode::FAILURE);
826 if (contH ==
nullptr) {
827 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
828 return(StatusCode::FAILURE);
830 if (
auto p = contName.find(
'('); p != std::string::npos) {
831 objName = contName.substr(p + 1);
832 objName.erase(objName.find(
')'));
833 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
834 objName = contName.substr(p + 2);
835 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
836 objName = contName.substr(p + 1);
837 objName.erase(objName.find(
'/'));
839 std::string::size_type off = 0;
840 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
844 retError = contH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
846 retError = contH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
849 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " <<
data);
850 return(StatusCode::FAILURE);
853 return(StatusCode::SUCCESS);
861 std::vector<std::string> physcons;
862 if (conn.find(
':') == std::string::npos) {
865 const std::string lookSvcStr(
"CORAL/Services/XMLLookupService");
866 coral::IHandle<coral::ILookupService> lookSvcH =
m_context->query<coral::ILookupService>();
867 if (!lookSvcH.isValid()) {
869 lookSvcH =
m_context->query<coral::ILookupService>();
871 if (!lookSvcH.isValid()) {
873 return(StatusCode::FAILURE);
875 coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
876 if (dbset !=
nullptr) {
877 for (
int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
878 const std::string pcon = dbset->replica(irep).connectionString();
879 if (pcon.compare(0, 9,
"frontier:") == 0) {
880 physcons.push_back(std::move(pcon));
883 delete dbset; dbset =
nullptr;
885 ATH_MSG_DEBUG(
"setFrontierCache: Could not find any replicas for " << conn);
887 }
else if (conn.compare(0, 9,
"frontier:") == 0) {
888 physcons.push_back(conn);
891 if (physcons.size() == 0) {
892 return(StatusCode::SUCCESS);
894 coral::ConnectionService conSvcH;
898 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
899 for (
const auto& physcon : physcons) {
901 if (std::find(refreshList.begin(), refreshList.end(), physcon) == refreshList.end()
902 && std::find(refreshList.begin(), refreshList.end(), conn) == refreshList.end()) {
905 webCache.refreshTable(physcon,
"DUMMYTABLE");
908 webCache.refreshSchemaInfo(physcon);
910 ATH_MSG_DEBUG(
"Cache flag for connection " << physcon <<
" set to " << webCache.webCacheInfo(physcon).isSchemaInfoCached());
912 return(StatusCode::SUCCESS);
920 if (
catalog.compare(0, 8,
"apcfile:") == 0 ||
catalog.compare(0, 7,
"prfile:") == 0) {
921 std::string::size_type cpos =
catalog.find(
':');
936 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
946 }
catch(std::exception& e) {
947 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
957std::unique_ptr<pool::IDatabase>
PoolSvc::getDbHandle(
unsigned int contextId,
const std::string& dbName)
const {
959 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
974 if (dbName.compare(0, 4,
"PFN:") == 0) {
976 }
else if (dbName.compare(0, 4,
"LFN:") == 0) {
978 }
else if (dbName.compare(0, 4,
"FID:") == 0) {
986 if (dbH ==
nullptr) {
993 if (contName.find(
"DataHeader") != std::string::npos) {
998 return(std::unique_ptr<pool::IContainer>(contH));
1004 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
1005 if (cpath && strcmp(cpath,
"") != 0) {
1006 const std::string testpath = std::string(cpath) +
"/" + leaf;
1010 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 pool::ICollection * createCollection(const std::string &connection, const std::string &collectionName, const pool::DbType &collectionType=pool::POOL_StorageType.type(), unsigned int contextId=IPoolSvc::kInputStream) const override
virtual const pool::IFileCatalog * catalog() const override
std::map< unsigned int, unsigned int > m_contextMaxFile
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_...
const std::string storageName() const
Human readable storage type.
int majorType() const
Access to major type.
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)
Remove catalog identified by name from the existing ones. * or '' removes all.
void setWriteCatalog(const std::string &connect)
Establish the writable catalog, identified by name.
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 const DbType POOL_StorageType
static void setLevel(MSG::Level l)