13#include "GaudiKernel/IIoComponentMgr.h"
14#include "GaudiKernel/ConcurrencyFlags.h"
15#include "GaudiKernel/Bootstrap.h"
16#include "GaudiKernel/ISvcLocator.h"
17#include "GaudiKernel/IMessageSvc.h"
43 return !s.empty() && (std::isdigit(s[0]) || s[0] ==
'+' || s[0] ==
'-');
57 if (catalog.starts_with(
"xmlcatalog_file:")) {
58 const std::string fileName = catalog.substr(16);
59 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::READ, fileName, fileName).isSuccess()) {
60 ATH_MSG_FATAL(
"could not register [" << catalog <<
"] for input !");
63 ATH_MSG_INFO(
"io_register[" << this->name() <<
"](" << catalog <<
") [ok]");
69 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::WRITE, fileName, fileName).isSuccess()) {
77 return(StatusCode::FAILURE);
80 MSG::Level athLvl =
msg().level();
90 if (!iomgr.retrieve().isSuccess()) {
92 return(StatusCode::FAILURE);
94 if (!iomgr->io_hasitem(
this)) {
96 return(StatusCode::FAILURE);
99 for (std::size_t icat = 0,
imax = readcat.size(); icat <
imax; icat++) {
100 if (readcat[icat].starts_with(
"xmlcatalog_file:")) {
101 std::string fileName = readcat[icat].substr(16);
102 if (iomgr->io_contains(
this, fileName)) {
103 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
104 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
105 return(StatusCode::FAILURE);
107 readcat[icat] =
"xmlcatalog_file:" + fileName;
115 if (iomgr->io_contains(
this, fileName)) {
116 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
117 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
118 return(StatusCode::FAILURE);
133 return(StatusCode::FAILURE);
139 const bool& atttibuteValue =
true;
141 ATH_MSG_FATAL(
"Failed to enable thread safety in ROOT via PersistencySvc.");
142 return(StatusCode::FAILURE);
147 return(StatusCode::FAILURE);
152 return(StatusCode::SUCCESS);
157 if (
m_useROOTIMT && Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
158 const int& atttibuteValue = Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1;
160 ATH_MSG_FATAL(
"Failed to enable implicit multithreading in ROOT via PersistencySvc.");
161 return(StatusCode::FAILURE);
163 ATH_MSG_INFO(
"Enabled implicit multithreading in ROOT via PersistencySvc to: " << Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1);
165 return(StatusCode::SUCCESS);
170 bool retError =
false;
177 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
186 session->closeSession();
189 for (
const auto& persistencyMutex :
m_pers_mut) {
190 delete persistencyMutex;
198 m_catalog = SmartIF<Gaudi::IFileCatalog>();
205 return(::AthService::finalize());
217 return(StatusCode::SUCCESS);
224 const std::string& auxString = placement->
auxString();
225 if (!auxString.empty()) {
226 if (auxString.starts_with(
"[CTXT=")) {
227 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
228 }
else if (auxString.starts_with(
"[CLABEL=")) {
232 ATH_MSG_WARNING(
"registerForWrite: Using default output Stream instead of id = " << contextId);
238 if (token ==
nullptr) {
246 const std::string& auxString = token->
auxString();
247 bool allowAging =
true;
248 if (!auxString.empty()) {
249 if (auxString.starts_with(
"[CTXT=")) {
250 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
252 ATH_MSG_DEBUG(
"setObjPtr: On-demand creating new input Stream id = " << contextId);
255 }
else if (auxString.starts_with(
"[CLABEL=")) {
259 ATH_MSG_WARNING(
"setObjPtr: Using default input Stream instead of id = " << contextId);
264 ATH_MSG_VERBOSE(
"setObjPtr: token=" << token->
toString() <<
", auxString=" << auxString <<
", contextID=" << contextId);
268 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
269 if (allowAging && maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0) {
270 m_guidLists[contextId].remove(token->
dbID());
271 m_guidLists[contextId].push_back(token->
dbID());
272 while (m_guidLists[contextId].
size() > maxFileIter->second) {
289 return(contextIter->second);
293 ATH_MSG_WARNING(
"getOutputContext: Failed to create new output Stream id = " <<
id <<
". Using default output Stream instead.");
303 if (!
label.empty()) {
309 return(contextIter->second);
314 ATH_MSG_WARNING(
"getInputContext: Failed to create new input Stream id = " <<
id <<
". Using default input Stream instead.");
318 if (!
connect(Io::READ,
id).isSuccess()) {
322 if (!
label.empty()) {
340 const std::string& connection) {
342 ATH_MSG_DEBUG(
"getInputFileDescriptor: On-demand creating new input Stream id = " << contextId);
346 ATH_MSG_WARNING(
"getInputFileDescriptor: Using default input Stream instead of id = " << contextId);
350 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
352 throw std::runtime_error(
"Could not retrieve a database handle to '" + connection +
"'");
356 throw std::runtime_error(
"Could not retrieve connection info from DB '" + connection +
"'");
382 const std::string& collectionName,
383 unsigned int contextId)
385 ATH_MSG_DEBUG(
"connectCollection() connection=" << connection
386 <<
", name=" << collectionName <<
", contextID=" << contextId);
388 ATH_MSG_WARNING(
"connectCollection: Using default input Stream instead of id = " << contextId);
394 bool insertFile =
false;
395 if (connection.starts_with(
"PFN:")) {
396 std::string fid, fileType;
400 ATH_MSG_INFO(
"File is not in Catalog! Attempt to open it anyway.");
405 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
407 ATH_MSG_INFO(
"connectCollection(): Failed to get Database Handle for: " << connection);
408 return StatusCode::FAILURE;
411 if (dbH->openMode() == Io::INVALID) {
412 dbH->connectForRead();
414 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
415 if (maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
416 const Guid guid(dbH->fid());
417 m_guidLists[contextId].remove(guid);
418 m_guidLists[contextId].push_back(guid);
419 while (m_guidLists[contextId].
size() > maxFileIter->second + 1) {
423 }
catch (std::exception& e) {
424 ATH_MSG_INFO(
"connectCollection() failed to open '" << connection <<
"' - trying.");
429 ATH_MSG_DEBUG(
"connectCollection(): Increasing virtual TTree size for: " << connection);
431 ATH_MSG_DEBUG(
"Failed to increase maximum virtual TTree size.");
434 if (insertFile)
return(StatusCode::RECOVERABLE);
436 return(StatusCode::SUCCESS);
440 unsigned int contextId,
443 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
444 if (dbH !=
nullptr && !dbH->fid().empty()) {
446 return(StatusCode::SUCCESS);
451 return(StatusCode::SUCCESS);
453 return(StatusCode::FAILURE);
459 std::string fid = dbH.
fid();
465 const std::string& collection,
466 const unsigned long ientry) {
469 if (dbH ==
nullptr) {
472 if (dbH->openMode() == Io::INVALID) {
473 dbH->connectForRead();
476 if (contH ==
nullptr) {
479 auto tokenIter = std::unique_ptr<pool::ITokenIterator>(contH->tokens());
481 return tokenIter->seek(ientry)? tokenIter->next() :
nullptr;
485 if (
type != Io::READ) {
487 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
492 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
495 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
500 return StatusCode::FAILURE;
505 if( session->openMode() == Io::INVALID && !session->start(
type) ) {
507 return StatusCode::FAILURE;
509 return StatusCode::SUCCESS;
514 return StatusCode::FAILURE;
518 if( session->openMode() != Io::INVALID && !session->commit() ) {
520 return StatusCode::FAILURE;
522 if (session->openMode() == Io::READ) {
523 session->disconnectAll();
525 return StatusCode::SUCCESS;
530 return StatusCode::FAILURE;
534 if( session->openMode() != Io::INVALID && !session->commitAndHold() ) {
536 return StatusCode::FAILURE;
538 return StatusCode::SUCCESS;
542 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
544 return StatusCode::SUCCESS;
548 if( session->openMode() != Io::INVALID ) {
549 if( !
commit(contextId).isSuccess() ) {
551 return StatusCode::FAILURE;
553 if( session->disconnectAll() ) {
556 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
557 return StatusCode::FAILURE;
560 return StatusCode::SUCCESS;
565 return (StatusCode::SUCCESS);
568 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
569 if (dbH ==
nullptr) {
571 return(StatusCode::FAILURE);
573 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
575 m_guidLists[contextId].remove(
Guid(dbH->fid()));
578 return(StatusCode::SUCCESS);
584 unsigned int contextId) {
586 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
591 std::ostringstream oss;
592 if (data ==
"DbLonglong") {
593 long long int attr_data;
594 oss << std::dec << sesH->microSessionManager(tech).attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
long long int),
"");
595 }
else if (data ==
"double") {
597 oss << std::dec << sesH->microSessionManager(tech).attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
double),
"");
600 oss << std::dec << sesH->microSessionManager(tech).attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
int),
"");
603 ATH_MSG_INFO(
"Domain attribute [" << optName <<
"]" <<
": " << data);
604 return(StatusCode::SUCCESS);
610 const std::string& dbName,
611 const std::string& contName,
612 unsigned int contextId) {
614 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
615 if (dbH ==
nullptr) {
616 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
617 return(StatusCode::FAILURE);
619 if (dbH->openMode() == Io::INVALID) {
621 dbH->setTechnology(tech);
622 dbH->connectForWrite();
624 dbH->connectForRead();
627 std::ostringstream oss;
628 if (contName.empty()) {
629 if (data ==
"DbLonglong") {
630 long long int attr_data;
631 oss << std::dec << dbH->attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
long long int),
"");
632 }
else if (data ==
"double") {
634 oss << std::dec << dbH->attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
double),
"");
635 }
else if (data ==
"string") {
637 oss << std::dec << dbH->attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
char*),
"");
640 oss << std::dec << dbH->attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
int),
"");
642 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
645 if (contH ==
nullptr) {
646 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
647 return(StatusCode::FAILURE);
649 if (data ==
"DbLonglong") {
650 long long int attr_data;
651 oss << std::dec << contH->attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
long long int),
"");
652 }
else if (data ==
"double") {
654 oss << std::dec << contH->attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
double),
"");
657 oss << std::dec << contH->attributeOfType(optName,
static_cast<void*
>(&attr_data),
typeid(
int),
"");
659 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
662 return(StatusCode::SUCCESS);
666 const std::string& data,
668 unsigned int contextId) {
670 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
675 if (data[data.size() - 1] ==
'L') {
676 const long long int& atttibuteValue = atoll(data.c_str());
677 if (!sesH->microSessionManager(tech).setAttributeOfType(optName,
static_cast<const void*
>(&atttibuteValue),
typeid(
long long int),
"")) {
678 ATH_MSG_DEBUG(
"Failed to set POOL property, " << optName <<
" to " << data);
679 return(StatusCode::FAILURE);
682 const int& atttibuteValue = atoi(data.c_str());
683 if (!sesH->microSessionManager(tech).setAttributeOfType(optName,
static_cast<const void*
>(&atttibuteValue),
typeid(
int),
"")) {
684 ATH_MSG_DEBUG(
"Failed to set POOL property, " << optName <<
" to " << data);
685 return(StatusCode::FAILURE);
688 return(StatusCode::SUCCESS);
692 const std::string& data,
694 const std::string& dbName,
695 const std::string& contName,
696 unsigned int contextId) {
698 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
702 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
703 if (dbH ==
nullptr) {
704 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
705 return(StatusCode::FAILURE);
707 if (dbH->openMode() == Io::INVALID) {
709 dbH->setTechnology(tech);
710 dbH->connectForWrite();
712 dbH->connectForRead();
715 bool retError =
false;
717 bool hasTTreeName = contName.starts_with(
"TTree=");
718 if (contName.empty() || hasTTreeName ||
m_dbSessionVec[contextId]->openMode() == Io::READ) {
719 objName = hasTTreeName ? contName.substr(6) : contName;
721 const char* atttibuteValue = data.c_str();
722 retError = dbH->setAttributeOfType(optName,
static_cast<const void*
>(&atttibuteValue),
typeid(
char*), objName);
723 }
else if( data[data.size() - 1] ==
'L' ) {
724 const long long int& atttibuteValue = atoll(data.c_str());
725 retError = dbH->setAttributeOfType(optName,
static_cast<const void*
>(&atttibuteValue),
typeid(
long long int), objName);
727 const int& atttibuteValue = atoi(data.c_str());
728 retError = dbH->setAttributeOfType(optName,
static_cast<const void*
>(&atttibuteValue),
typeid(
int), objName);
731 ATH_MSG_DEBUG(
"Failed to set POOL property, " << optName <<
" to " << data);
732 return(StatusCode::FAILURE);
736 if (contH ==
nullptr) {
737 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
738 return(StatusCode::FAILURE);
740 if (
auto p = contName.find(
'('); p != std::string::npos) {
741 objName = contName.substr(p + 1);
742 objName.erase(objName.find(
')'));
743 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
744 objName = contName.substr(p + 2);
745 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
746 objName = contName.substr(p + 1);
747 objName.erase(objName.find(
'/'));
749 std::string::size_type off = 0;
750 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
753 if (data[data.size() - 1] ==
'L') {
754 const long long int& atttibuteValue = atoll(data.c_str());
755 retError = contH->setAttributeOfType(optName,
static_cast<const void*
>(&atttibuteValue),
typeid(
long long int), objName);
757 const int& atttibuteValue = atoi(data.c_str());
758 retError = contH->setAttributeOfType(optName,
static_cast<const void*
>(&atttibuteValue),
typeid(
int), objName);
761 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " << data);
762 return(StatusCode::FAILURE);
765 return(StatusCode::SUCCESS);
770 m_catalogMgr = Gaudi::svcLocator()->service<Gaudi::IFileCatalogMgr>(
"Gaudi::MultiFileCatalog");
776 Gaudi::svcLocator()->service<IMessageSvc>(
"MessageSvc")
781 if (catalog.starts_with(
"apcfile:") || catalog.starts_with(
"prfile:")) {
782 std::string::size_type cpos = catalog.find(
':');
797 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
807 }
catch(std::exception& e) {
808 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
820 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
828 if (sesH->openMode() == Io::INVALID) {
829 Io::IoFlag transMode = Io::READ;
831 if (!sesH->start(transMode)) {
836 if (dbName.starts_with(
"PFN:")) {
838 }
else if (dbName.starts_with(
"LFN:")) {
840 }
else if (dbName.starts_with(
"FID:")) {
848 if (dbH ==
nullptr) {
852 if (contName.find(
"DataHeader") != std::string::npos) {
857 return(std::unique_ptr<pool::IContainer>(contH));
863 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
864 if (cpath && strcmp(cpath,
"") != 0) {
865 const std::string testpath = std::string(cpath) +
"/" + leaf;
869 if (FILE* fp = std::fopen(testpath.c_str(),
"r")) {
881 ToolHandle<SessionTool> session_tool = ToolHandle<SessionTool>(
"SessionTool/" + sessionName,
this);
883 session_tool->setupFC( *
m_catalog, dbAgeLimit );
885 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
std::string toString(const float number)
Pipe a number to a string.
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.
size_t size() const
Number of registered mappings.
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).
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 StatusCode io_reinit() override
virtual Token * registerForWrite(const Placement *placement, const void *obj, const RootType &classDesc) override
std::vector< ToolHandle< SessionTool > > m_dbSessionVec
virtual ~PoolSvc()
Destructor.
std::unique_ptr< pool::IDatabase > getDbHandle(unsigned int contextId, const std::string &dbName)
Get Database handle.
virtual void startCatalog() override
StatusCode createSession(const std::string &sessionName, int ageLimit=-1)
Create a new session for a given session name and age limit.
SmartIF< Gaudi::IFileCatalog > m_catalog
std::unique_ptr< pool::IContainer > getContainerHandle(pool::IDatabase *dbH, const std::string &contName)
Get Container handle.
virtual StatusCode connect(Io::IoFlag type, unsigned int contextId=IPoolSvc::kInputStream) override
Connect to a logical database unit; PersistencySvc is chosen according to transaction type (accessmod...
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
virtual StatusCode disconnectDb(const std::string &connection, unsigned int contextId=IPoolSvc::kInputStream) override
Disconnect single Database.
SmartIF< Gaudi::IFileCatalogMgr > m_catalogMgr
virtual StatusCode checkCollection(const std::string &connection, unsigned int contextId, bool noContainer) override
Gaudi::Property< bool > m_useROOTIMT
Use ROOT Implicit MultiThreading, default = true.
virtual StatusCode start() override
Required of all Gaudi services:
StatusCode setupPersistencySvc()
virtual StatusCode commit(unsigned int contextId=IPoolSvc::kInputStream) override
Commit data for a given contextId and flush buffer.
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 ...
virtual void lookupBestPfn(const std::string &dbID, std::string &pfn, std::string &type) const override
virtual Token * getToken(const std::string &connection, const std::string &collection, const unsigned long ientry) override
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::recursive_mutex CallMutex
virtual void commitCatalog() override
std::vector< CallMutex * > m_pers_mut
std::map< std::string, unsigned int > m_inputContextLabel
virtual void setObjPtr(void *&obj, const Token *token) override
virtual StatusCode connectCollection(const std::string &connection, const std::string &collectionName, unsigned int contextId=IPoolSvc::kInputStream) 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
std::map< unsigned int, unsigned int > m_contextMaxFile
virtual void setShareMode(bool shareCat) override
virtual StatusCode finalize() override
Required of all Gaudi services:
virtual StatusCode initialize() override
Required of all Gaudi services:
virtual StatusCode getAttribute(const std::string &optName, std::string &data, long tech, unsigned int contextId=IPoolSvc::kInputStream) override
Get POOL attributes - domain.
virtual StatusCode setAttribute(const std::string &optName, const std::string &data, long tech, unsigned int contextId=IPoolSvc::kOutputStream) override
Set POOL attributes - domain.
virtual StatusCode commitAndHold(unsigned int contextId=IPoolSvc::kInputStream) override
Commit data for a given contextId and hold buffer.
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 disconnect(unsigned int contextId=IPoolSvc::kInputStream) override
Disconnect PersistencySvc associated with a contextId.
virtual pool::FileDescriptor getInputFileDescriptor(unsigned int contextId, const std::string &connection) override
This class provides a token that identifies in a unique way objects on the persistent storage.
const std::string & auxString() const
Access auxiliary string.
const std::string toString() const
Retrieve the string representation of the token.
const Guid & dbID() const
Access database identifier.
static MSG::Level getOutputLvl()
IContainer is the base class for container objects.
IDatabase is the base class for database objects.
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 IContainer * containerHandle(const std::string &name)=0
Returns a pointer to a container object. The user acquires ownership of that object.
std::string label(const std::string &format, int i)
void registerPFN(Gaudi::IFileCatalog &fc, const std::string &pfn, const std::string &ftype, std::string &fid)
Register PFN, assign new FID if not given. Throws if the PFN is already registered.
std::string addCatalog(Gaudi::IFileCatalogMgr &mgr, const std::string &connect, bool forWriting=false)
Add new catalog, identified by name, to the existing ones, optionally as the write catalog.
void lookupFileByPFN(const Gaudi::IFileCatalog &fc, const std::string &pfn, std::string &fid, std::string &tech)
Get FID and filetype for a given PFN.
void getFirstPFN(const Gaudi::IFileCatalog &fc, const std::string &fid, std::string &pfn, std::string &tech)
Get the first PFN + filetype for the given FID.
static const DbType ROOT_StorageType
static void setLevel(MSG::Level l)