Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PoolSvc Class Reference

This class provides the interface to the LCG POOL persistency software. More...

#include <PoolSvc.h>

Inheritance diagram for PoolSvc:
Collaboration diagram for PoolSvc:

Classes

class  ContextLock
 

Public Member Functions

virtual StatusCode initialize () override
 Required of all Gaudi services: More...
 
virtual StatusCode io_reinit () override
 
virtual StatusCode start () override
 Required of all Gaudi services: More...
 
virtual StatusCode stop () override
 
virtual StatusCode finalize () override
 Required of all Gaudi services: More...
 
virtual StatusCode io_finalize () override
 
virtual TokenregisterForWrite (const Placement *placement, const void *obj, const RootType &classDesc) override
 
virtual void setObjPtr (void *&obj, const Token *token) override
 
virtual unsigned int getOutputContext (const std::string &label) override
 
virtual unsigned int getInputContext (const std::string &label, unsigned int maxFile=0) override
 
virtual const std::map< std::string, unsigned int > & getInputContextMap () const override
 
virtual const coral::Context * context () const override
 
virtual void loadComponent (const std::string &compName) override
 
virtual void setShareMode (bool shareCat) override
 
virtual const pool::IFileCatalogcatalog () const override
 
virtual void lookupBestPfn (const std::string &token, std::string &pfn, std::string &type) const override
 
virtual void renamePfn (const std::string &pf, const std::string &newpf) override
 
virtual pool::ICollectioncreateCollection (const std::string &collectionType, const std::string &connection, const std::string &collectionName, unsigned int contextId=IPoolSvc::kInputStream) const override
 
virtual TokengetToken (const std::string &connection, const std::string &collection, const unsigned long ientry) const override
 
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 (accessmode). More...
 
virtual StatusCode commit (unsigned int contextId=IPoolSvc::kInputStream) const override
 Commit data for a given contextId and flush buffer. More...
 
virtual StatusCode commitAndHold (unsigned int contextId=IPoolSvc::kInputStream) const override
 Commit data for a given contextId and hold buffer. More...
 
virtual StatusCode disconnect (unsigned int contextId=IPoolSvc::kInputStream) const override
 Disconnect PersistencySvc associated with a contextId. More...
 
virtual StatusCode disconnectDb (const std::string &connection, unsigned int contextId=IPoolSvc::kInputStream) const override
 Disconnect single Database. More...
 
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. More...
 
virtual StatusCode getAttribute (const std::string &optName, std::string &data, long tech, unsigned int contextId=IPoolSvc::kInputStream) const override
 Get POOL attributes - domain. More...
 
virtual StatusCode getAttribute (const std::string &optName, std::string &data, long tech, const std::string &dbName, const std::string &contName="", unsigned int contextId=IPoolSvc::kInputStream) const override
 Get POOL attributes - db/file, container/collection. More...
 
virtual StatusCode setAttribute (const std::string &optName, const std::string &data, long tech, unsigned int contextId=IPoolSvc::kOutputStream) const override
 Set POOL attributes - domain. More...
 
virtual StatusCode setAttribute (const std::string &optName, const std::string &data, long tech, const std::string &dbName, const std::string &contName="", unsigned int contextId=IPoolSvc::kOutputStream) const override
 Set POOL attributes - db/file, container/collection. More...
 
virtual StatusCode setFrontierCache (const std::string &conn) override
 Setup Frontier cache for given logical or physical connection name. More...
 
virtual ~PoolSvc ()
 Destructor. More...
 

Private Types

typedef std::recursive_mutex CallMutex
 

Private Member Functions

void clearState ()
 
pool::IFileCatalogcreateCatalog ()
 
void patchCatalog (const std::string &pfn, pool::IDatabase &dbH) const
 
StatusCode setupPersistencySvc ()
 
std::unique_ptr< pool::IDatabasegetDbHandle (unsigned int contextId, const std::string &dbName) const
 Get Database handle. More...
 
std::unique_ptr< pool::IContainergetContainerHandle (pool::IDatabase *dbH, const std::string &contName) const
 Get Container handle. More...
 
std::string poolCondPath (const std::string &leaf)
 Resolve a file using ATLAS_POOLCOND_PATH. More...
 

Private Attributes

CallMutex m_pool_mut
 
coral::Context * m_context {nullptr}
 
bool m_shareCat {false}
 
pool::IFileCatalogm_catalog {nullptr}
 
std::vector< pool::IPersistencySvc * > m_persistencySvcVec
 
std::vector< CallMutex * > m_pers_mut
 
std::map< std::string, unsigned int > m_inputContextLabel
 
std::map< std::string, unsigned int > m_outputContextLabel
 
std::string m_mainOutputLabel {}
 
std::map< unsigned int, unsigned int > m_contextMaxFile
 
std::map< unsigned int, std::list< Guid > > m_guidLists ATLAS_THREAD_SAFE
 
StringProperty m_fileOpen {this,"FileOpen","overwrite"}
 FileOpen, the open mode for the file ("append" or "overwrite"). More...
 
IntegerProperty m_dbAgeLimit {this,"MaxFilesOpen",0}
 MaxFilesOpen, option to have PoolSvc limit the number of open Input Files: default = 0 (No files are closed automatically) More...
 
StringProperty m_writeCatalog {this,"WriteCatalog","xmlcatalog_file:PoolFileCatalog.xml"}
 WriteCatalog, the file catalog to be used to register output files (also default input catalog): default = "" (use POOL default). More...
 
StringArrayProperty m_readCatalog {this,"ReadCatalog",{},"List of catalog files to read from","OrderedSet<std::string>"}
 ReadCatalog, the list of additional POOL input file catalogs to consult: default = empty vector. More...
 
BooleanProperty m_useROOTIMT {this,"UseROOTImplicitMT",true}
 Use ROOT Implicit MultiThreading, default = true. More...
 
BooleanProperty m_useROOTMaxTree {this,"UseROOTIncreaseVMaxTree",false}
 Increase virtual TTree size to avoid backreads in multithreading, default = false. More...
 
BooleanProperty m_attemptCatalogPatch {this,"AttemptCatalogPatch",true}
 AttemptCatalogPatch, option to create catalog: default = false. More...
 
IntegerProperty m_retrialPeriod {this,"ConnectionRetrialPeriod",300}
 ConnectionRetrialPeriod, retry period for CORAL Connection Service: default = 30 seconds. More...
 
IntegerProperty m_retrialTimeOut {this,"ConnectionRetrialTimeOut",3600}
 ConnectionRetrialTimeOut, the retrial time out for CORAL Connection Service: default = 300 seconds. More...
 
IntegerProperty m_timeOut {this,"ConnectionTimeOut",5}
 ConnectionTimeOut, the time out for CORAL Connection Service: default = 5 seconds. More...
 
BooleanProperty m_connClean {this,"ConnectionCleanUp",false}
 ConnectionCleanUp - whether to use CORAL connection management thread: default = false. More...
 
IntegerProperty m_frontierComp {this,"FrontierCompression",5}
 Frontier proprties, compression level and list of schemas to be refreshed: default = 5. More...
 
StringArrayProperty m_frontierRefresh {this,"FrontierRefreshSchema",{}}
 
BooleanProperty m_sortReplicas {this,"SortReplicas",true}
 Use DBReplicaSvc to sort database connections, default = true. More...
 
StringProperty m_defaultROOTContainerType {this, "DefaultContainerType", "ROOTTREEINDEX"}
 Default ROOT container type. More...
 

Detailed Description

This class provides the interface to the LCG POOL persistency software.

Definition at line 35 of file PoolSvc.h.

Member Typedef Documentation

◆ CallMutex

typedef std::recursive_mutex PoolSvc::CallMutex
private

Definition at line 204 of file PoolSvc.h.

Constructor & Destructor Documentation

◆ ~PoolSvc()

PoolSvc::~PoolSvc ( )
virtual

Destructor.

Definition at line 992 of file PoolSvc.cxx.

992  {
993 }

Member Function Documentation

◆ catalog()

const pool::IFileCatalog * PoolSvc::catalog ( ) const
overridevirtual
Returns
the file catalog.

Definition at line 408 of file PoolSvc.cxx.

408  {
409  return(m_catalog);
410 }

◆ clearState()

void PoolSvc::clearState ( )
private

Definition at line 248 of file PoolSvc.cxx.

248  {
249  // Cleanup persistency service
250  for (const auto& persistencySvc : m_persistencySvcVec) {
251  delete persistencySvc;
252  }
253  m_persistencySvcVec.clear();
254  for (const auto& persistencyMutex : m_pers_mut) {
255  delete persistencyMutex;
256  }
257  m_mainOutputLabel.clear();
258  m_inputContextLabel.clear();
259  m_outputContextLabel.clear();
260  m_pers_mut.clear();
261  if (m_catalog != nullptr) {
262  m_catalog->commit();
263  delete m_catalog; m_catalog = nullptr;
264  }
265 }

◆ commit()

StatusCode PoolSvc::commit ( unsigned int  contextId = IPoolSvc::kInputStream) const
overridevirtual

Commit data for a given contextId and flush buffer.

Parameters
contextId[IN] poolStream to be commited.

Definition at line 630 of file PoolSvc.cxx.

630  {
631  if (contextId >= m_persistencySvcVec.size()) {
632  return(StatusCode::FAILURE);
633  }
634  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
635  pool::IPersistencySvc* persSvc = m_persistencySvcVec[contextId];
636  if (persSvc != nullptr && persSvc->session().transaction().isActive()) {
637  if (!persSvc->session().transaction().commit()) {
638  ATH_MSG_ERROR("POOL commit failed " << persSvc);
639  return(StatusCode::FAILURE);
640  }
641  if (persSvc->session().transaction().type() == pool::ITransaction::READ) {
642  persSvc->session().disconnectAll();
643  }
644  }
645  return(StatusCode::SUCCESS);
646 }

◆ commitAndHold()

StatusCode PoolSvc::commitAndHold ( unsigned int  contextId = IPoolSvc::kInputStream) const
overridevirtual

Commit data for a given contextId and hold buffer.

Parameters
contextId[IN] poolStream to be commited.

Definition at line 648 of file PoolSvc.cxx.

648  {
649  if (contextId >= m_persistencySvcVec.size()) {
650  return(StatusCode::FAILURE);
651  }
652  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
653  pool::IPersistencySvc* persSvc = m_persistencySvcVec[contextId];
654  if (persSvc != nullptr && persSvc->session().transaction().isActive()) {
655  if (!persSvc->session().transaction().commitAndHold()) {
656  ATH_MSG_ERROR("POOL commitAndHold failed " << persSvc);
657  return(StatusCode::FAILURE);
658  }
659  }
660  return(StatusCode::SUCCESS);
661 }

◆ connect()

StatusCode PoolSvc::connect ( pool::ITransaction::Type  type,
unsigned int  contextId = IPoolSvc::kInputStream 
)
overridevirtual

Connect to a logical database unit; PersistencySvc is chosen according to transaction type (accessmode).

Definition at line 598 of file PoolSvc.cxx.

598  {
600  if (contextId >= m_persistencySvcVec.size()) {
601  ATH_MSG_WARNING("connect: Using default output Stream instead of id = " << contextId);
602  contextId = IPoolSvc::kOutputStream;
603  }
604  } else {
605  if (contextId > m_persistencySvcVec.size()) {
606  ATH_MSG_WARNING("connect: Using default input Stream instead of id = " << contextId);
607  contextId = IPoolSvc::kInputStream;
608  } else if (contextId == m_persistencySvcVec.size()) {
609  ATH_MSG_INFO("Connecting to InputStream for: " << contextId);
610  contextId = this->getInputContext("");
611  }
612  }
613  if (contextId >= m_persistencySvcVec.size()) {
614  return(StatusCode::FAILURE);
615  }
616  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
617  pool::IPersistencySvc* persSvc = m_persistencySvcVec[contextId];
618  // Connect to a logical database using the pre-defined technology and dbID
619  if (persSvc->session().transaction().isActive()) {
620  return(StatusCode::SUCCESS);
621  }
622  if (!persSvc->session().transaction().start(type)) {
623  ATH_MSG_ERROR("connect failed persSvc = " << persSvc << " type = " << type);
624  return(StatusCode::FAILURE);
625  }
626 
627  return(StatusCode::SUCCESS);
628 }

◆ context()

const coral::Context * PoolSvc::context ( ) const
overridevirtual
Returns
the context.

Definition at line 396 of file PoolSvc.cxx.

396  {
397  return(m_context);
398 }

◆ createCatalog()

pool::IFileCatalog * PoolSvc::createCatalog ( )
private

Definition at line 952 of file PoolSvc.cxx.

952  {
954  ctlg->removeCatalog("*");
955  for (auto& catalog : m_readCatalog.value()) {
956  ATH_MSG_DEBUG("POOL ReadCatalog is " << catalog);
957  if (catalog.compare(0, 8,"apcfile:") == 0 || catalog.compare(0, 7, "prfile:") == 0) {
958  std::string::size_type cpos = catalog.find(':');
959  // check for file accessed via ATLAS_POOLCOND_PATH
960  std::string file = poolCondPath(catalog.substr(cpos + 1));
961  if (!file.empty()) {
962  ATH_MSG_INFO("Resolved path (via ATLAS_POOLCOND_PATH) is " << file);
963  ctlg->addReadCatalog("file:" + file);
964  } else {
965  // As backup, check for file accessed via PathResolver
966  file = PathResolver::find_file(catalog.substr(cpos + 1), "DATAPATH");
967  if (!file.empty()) {
968  ATH_MSG_INFO("Resolved path (via DATAPATH) is " << file);
969  ctlg->addReadCatalog("file:" + file);
970  } else {
971  ATH_MSG_INFO("Unable find catalog "
972  << catalog
973  << " in $ATLAS_POOLCOND_PATH and $DATAPATH");
974  }
975  }
976  } else {
977  ctlg->addReadCatalog(catalog);
978  }
979  }
980  try {
981  ATH_MSG_INFO("POOL WriteCatalog is " << m_writeCatalog.value());
982  ctlg->setWriteCatalog(m_writeCatalog.value());
983  ctlg->connect();
984  } catch(std::exception& e) {
985  ATH_MSG_ERROR("setWriteCatalog - caught exception: " << e.what());
986  return(nullptr); // This catalog is not setup properly!
987  }
988  return(ctlg);
989 }

◆ createCollection()

pool::ICollection * PoolSvc::createCollection ( const std::string &  collectionType,
const std::string &  connection,
const std::string &  collectionName,
unsigned int  contextId = IPoolSvc::kInputStream 
) const
overridevirtual
Returns
a pointer to a Pool Collection.
Parameters
collectionType[IN] string containing the collection type.
connection[IN] string containing the connection.
collectionName[IN] string containing the persistent name of the collection.
contextId[IN] id for PoolSvc persistency service to use for input.

Definition at line 445 of file PoolSvc.cxx.

448  {
449  ATH_MSG_DEBUG("createCollection() type="<< collectionType << ", connection=" << connection
450  << ", name=" << collectionName << ", contextID=" << contextId);
451  std::string collection(collectionName);
452  if (collectionType == "RootCollection") {
453  if (collectionName.find("PFN:") == std::string::npos
454  && collectionName.find("LFN:") == std::string::npos
455  && collectionName.find("FID:") == std::string::npos) {
456  collection = "PFN:" + collectionName;
457  }
458  }
459  if (contextId >= m_persistencySvcVec.size()) {
460  ATH_MSG_WARNING("createCollection: Using default input Stream instead of id = " << contextId);
461  contextId = IPoolSvc::kInputStream;
462  }
463  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
464  // Check POOL FileCatalog entry.
465  bool insertFile = false;
466  if (connection.compare(0, 4, "PFN:") == 0) {
467  std::string fid, fileType;
468  m_catalog->lookupFileByPFN(connection.substr(4), fid, fileType);
469  if (fid.empty()) { // No entry in file catalog
470  insertFile = true;
471  ATH_MSG_INFO("File is not in Catalog! Attempt to open it anyway.");
472  }
473  }
474  // Check whether Collection Container exists.
475  if (collectionType == "ImplicitCollection") {
476  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, connection);
477  if (dbH == nullptr) {
478  ATH_MSG_INFO("Failed to get Session/DatabaseHandle to create POOL collection.");
479  return(nullptr);
480  }
481  try {
482  if (dbH->openMode() == pool::IDatabase::CLOSED) {
483  dbH->connectForRead();
484  }
485  std::map<unsigned int, unsigned int>::const_iterator maxFileIter = m_contextMaxFile.find(contextId);
486  if (maxFileIter != m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
487  const Guid guid(dbH->fid());
488  m_guidLists[contextId].remove(guid);
489  m_guidLists[contextId].push_back(guid);
490  while (m_guidLists[contextId].size() > maxFileIter->second + 1) {
491  this->disconnectDb("FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
492  }
493  }
494  std::unique_ptr<pool::IContainer> contH = getContainerHandle(dbH.get(), collection);
495  if (contH == nullptr) {
496  ATH_MSG_INFO("Failed to find container " << collection << " to create POOL collection.");
497  if (insertFile && m_attemptCatalogPatch.value()) {
498  patchCatalog(connection.substr(4), *dbH);
499  }
500  return(nullptr); // no events
501  }
502  } catch(std::exception& e) {
503  ATH_MSG_INFO("Failed to open container to check POOL collection - trying.");
504  }
505  }
506 
507  // access to these variables is locked below:
509  pool::ICollection* collPtr ATLAS_THREAD_SAFE = nullptr;
510 
511  pool::CollectionDescription collDes(collection, collectionType, collectionType == "ImplicitCollection" ? connection : "");
512  if (collectionType == "RootCollection" &&
513  m_persistencySvcVec[contextId]->session().defaultConnectionPolicy().writeModeForNonExisting() != pool::DatabaseConnectionPolicy::RAISE_ERROR) {
514  ATH_MSG_INFO("Writing ExplicitROOT Collection - do not pass session pointer");
515  std::scoped_lock lock(m_pool_mut);
516  collPtr = collFac->create(collDes, pool::ICollection::READ);
517  } else {
518  // Try to open APR EventTags Collection in the input file - first as RootCollection, then as RNTCollection
519  std::scoped_lock lock(m_pool_mut);
520  std::string tree_error, rntuple_error;
521  try {
522  collPtr = collFac->create(collDes, pool::ICollection::READ, &m_persistencySvcVec[contextId]->session());
523  } catch (std::exception &e) {
524  tree_error = e.what();
525  }
526  if( !collPtr ) try {
527  collDes.setType("RNTCollection");
528  collPtr = collFac->create(collDes, pool::ICollection::READ, &m_persistencySvcVec[contextId]->session());
529  } catch (std::exception &e) {
530  if (insertFile) {
531  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, connection);
532  if (dbH != nullptr) {
533  if (!dbH->fid().empty()) {
534  return(nullptr); // no events
535  }
536  }
537  }
538  rntuple_error = e.what();
539  }
540  if( !collPtr ) throw pool::Exception( "Failed to open APR Collection as RootCollection or RNTCollection: "
541  + tree_error + " | " + rntuple_error,
542  "PoolSvc::createCollection", "PoolSvc" );
543  }
544  if (insertFile && m_attemptCatalogPatch.value()) {
545  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, connection);
546  if (dbH == nullptr) {
547  ATH_MSG_INFO("Failed to create FileCatalog entry.");
548  } else if (dbH->fid().empty()) {
549  ATH_MSG_INFO("Cannot retrieve the FID of an existing POOL database: '"
550  << connection << "' - FileCatalog will NOT be updated.");
551  } else {
552  patchCatalog(connection.substr(4), *dbH);
553  }
554  }
555  // For multithreaded processing (with multiple events in flight),
556  // increase virtual tree size to accomodate back reads
557  if (m_useROOTMaxTree && Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1) {
558  if (!this->setAttribute("TREE_MAX_VIRTUAL_SIZE", "-1", pool::ROOT_StorageType.type(), connection.substr(4), "CollectionTree", IPoolSvc::kInputStream).isSuccess()) {
559  ATH_MSG_WARNING("Failed to increase maximum virtual TTree size.");
560  }
561  }
562 
563  return(collPtr);
564 }

◆ disconnect()

StatusCode PoolSvc::disconnect ( unsigned int  contextId = IPoolSvc::kInputStream) const
overridevirtual

Disconnect PersistencySvc associated with a contextId.

Parameters
contextId[IN] poolStream to be disconnected.

Definition at line 663 of file PoolSvc.cxx.

663  {
664  ATH_MSG_DEBUG("Disconnect request for contextId=" << contextId);
665  if (contextId >= m_persistencySvcVec.size()) {
666  return(StatusCode::SUCCESS);
667  }
668  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
669  pool::IPersistencySvc* persSvc = m_persistencySvcVec[contextId];
670  if (persSvc != nullptr && persSvc->session().transaction().isActive()) {
671  if (!commit(contextId).isSuccess()) {
672  ATH_MSG_ERROR("disconnect failed to commit " << persSvc);
673  return(StatusCode::FAILURE);
674  }
675  if (persSvc->session().disconnectAll()) {
676  ATH_MSG_DEBUG("Disconnected PersistencySvc session");
677  } else {
678  ATH_MSG_ERROR("disconnect failed to diconnect PersistencySvc");
679  return(StatusCode::FAILURE);
680  }
681  }
682  return(StatusCode::SUCCESS);
683 }

◆ disconnectDb()

StatusCode PoolSvc::disconnectDb ( const std::string &  connection,
unsigned int  contextId = IPoolSvc::kInputStream 
) const
overridevirtual

Disconnect single Database.

Parameters
connection[IN] connection string for Database to be disconnected.
contextId[IN] context id of database to be disconnected.

Definition at line 685 of file PoolSvc.cxx.

685  {
686  if (contextId >= m_persistencySvcVec.size()) {
687  return(StatusCode::SUCCESS);
688  }
689  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
690  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, connection);
691  if (dbH == nullptr) {
692  ATH_MSG_ERROR("Failed to get Session/DatabaseHandle.");
693  return(StatusCode::FAILURE);
694  }
695  std::map<unsigned int, unsigned int>::const_iterator maxFileIter = m_contextMaxFile.find(contextId);
696  if (maxFileIter != m_contextMaxFile.end() && maxFileIter->second > 0) {
697  m_guidLists[contextId].remove(Guid(dbH->fid()));
698  }
699  dbH->disconnect();
700  return(StatusCode::SUCCESS);
701 }

◆ finalize()

StatusCode PoolSvc::finalize ( )
overridevirtual

Required of all Gaudi services:

Definition at line 267 of file PoolSvc.cxx.

267  {
268  clearState();
269  return(::AthService::finalize());
270 }

◆ getAttribute() [1/2]

StatusCode PoolSvc::getAttribute ( const std::string &  optName,
std::string &  data,
long  tech,
const std::string &  dbName,
const std::string &  contName = "",
unsigned int  contextId = IPoolSvc::kInputStream 
) const
overridevirtual

Get POOL attributes - db/file, container/collection.

Definition at line 744 of file PoolSvc.cxx.

749  {
750  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
751  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, dbName);
752  if (dbH == nullptr) {
753  ATH_MSG_DEBUG("getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
754  return(StatusCode::FAILURE);
755  }
756  if (dbH->openMode() == pool::IDatabase::CLOSED) {
757  if (m_persistencySvcVec[contextId]->session().defaultConnectionPolicy().writeModeForNonExisting() != pool::DatabaseConnectionPolicy::RAISE_ERROR) {
758  dbH->setTechnology(tech);
759  dbH->connectForWrite();
760  } else {
761  dbH->connectForRead();
762  }
763  }
764  std::ostringstream oss;
765  if (contName.empty()) {
766  if (data == "DbLonglong") {
767  oss << std::dec << dbH->technologySpecificAttributes().attribute<long long int>(optName);
768  } else if (data == "double") {
769  oss << std::dec << dbH->technologySpecificAttributes().attribute<double>(optName);
770  } else if (data == "string") {
771  oss << dbH->technologySpecificAttributes().attribute<char*>(optName);
772  } else {
773  oss << std::dec << dbH->technologySpecificAttributes().attribute<int>(optName);
774  }
775  ATH_MSG_INFO("Database (" << dbH->pfn() << ") attribute [" << optName << "]" << ": " << oss.str());
776  } else {
777  std::unique_ptr<pool::IContainer> contH = getContainerHandle(dbH.get(), contName);
778  if (contH == nullptr) {
779  ATH_MSG_DEBUG("Failed to get ContainerHandle to get POOL property.");
780  return(StatusCode::FAILURE);
781  }
782  if (data == "DbLonglong") {
783  oss << std::dec << contH->technologySpecificAttributes().attribute<long long int>(optName);
784  } else if (data == "double") {
785  oss << std::dec << contH->technologySpecificAttributes().attribute<double>(optName);
786  } else {
787  oss << std::dec << contH->technologySpecificAttributes().attribute<int>(optName);
788  }
789  ATH_MSG_INFO("Container attribute [" << contName << "." << optName << "]: " << oss.str());
790  }
791  data = oss.str();
792  return(StatusCode::SUCCESS);
793 }

◆ getAttribute() [2/2]

StatusCode PoolSvc::getAttribute ( const std::string &  optName,
std::string &  data,
long  tech,
unsigned int  contextId = IPoolSvc::kInputStream 
) const
overridevirtual

Get POOL attributes - domain.

Definition at line 721 of file PoolSvc.cxx.

724  {
725  if (contextId >= m_persistencySvcVec.size()) {
726  ATH_MSG_WARNING("getAttribute: Using default input Stream instead of id = " << contextId);
727  contextId = IPoolSvc::kInputStream;
728  }
729  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
730  pool::ISession& sesH = m_persistencySvcVec[contextId]->session();
731  std::ostringstream oss;
732  if (data == "DbLonglong") {
733  oss << std::dec << sesH.technologySpecificAttributes(tech).attribute<long long int>(optName);
734  } else if (data == "double") {
735  oss << std::dec << sesH.technologySpecificAttributes(tech).attribute<double>(optName);
736  } else {
737  oss << std::dec << sesH.technologySpecificAttributes(tech).attribute<int>(optName);
738  }
739  data = oss.str();
740  ATH_MSG_INFO("Domain attribute [" << optName << "]" << ": " << data);
741  return(StatusCode::SUCCESS);
742 }

◆ getContainerHandle()

std::unique_ptr< pool::IContainer > PoolSvc::getContainerHandle ( pool::IDatabase dbH,
const std::string &  contName 
) const
private

Get Container handle.

Definition at line 1025 of file PoolSvc.cxx.

1025  {
1026  pool::IContainer* contH = nullptr;
1027  if (dbH == nullptr) {
1028  ATH_MSG_DEBUG("No DatabaseHandle to get Container.");
1029  return(nullptr);
1030  }
1031  if (dbH->openMode() == pool::IDatabase::CLOSED) {
1032  dbH->connectForRead();
1033  }
1034  if (contName.find("DataHeader") != std::string::npos) {
1035  contH = dbH->containerHandle(contName.substr(0, contName.find("_p")));
1036  } else {
1037  contH = dbH->containerHandle(contName);
1038  }
1039  return(std::unique_ptr<pool::IContainer>(contH));
1040 }

◆ getDbHandle()

std::unique_ptr< pool::IDatabase > PoolSvc::getDbHandle ( unsigned int  contextId,
const std::string &  dbName 
) const
private

Get Database handle.

Definition at line 995 of file PoolSvc.cxx.

995  {
996  pool::IDatabase* dbH = nullptr;
997  if (contextId >= m_persistencySvcVec.size()) {
998  ATH_MSG_WARNING("getDbHandle: Using default input Stream instead of id = " << contextId);
999  contextId = IPoolSvc::kInputStream;
1000  }
1001  pool::ISession& sesH = m_persistencySvcVec[contextId]->session();
1002  if (!sesH.transaction().isActive()) {
1004  if (m_persistencySvcVec[contextId]->session().defaultConnectionPolicy().writeModeForNonExisting() != pool::DatabaseConnectionPolicy::RAISE_ERROR) {
1005  transMode = pool::ITransaction::UPDATE;
1006  }
1007  ATH_MSG_DEBUG("Start transaction, type = " << transMode);
1008  if (!sesH.transaction().start(transMode)) {
1009  ATH_MSG_WARNING("Failed to start transaction, type = " << transMode);
1010  return(nullptr);
1011  }
1012  }
1013  if (dbName.compare(0, 4,"PFN:") == 0) {
1015  } else if (dbName.compare(0, 4, "LFN:") == 0) {
1017  } else if (dbName.compare(0, 4,"FID:") == 0) {
1019  } else {
1021  }
1022  return(std::unique_ptr<pool::IDatabase>(dbH));
1023 }

◆ getFileSize()

long long int PoolSvc::getFileSize ( const std::string &  dbName,
long  tech,
unsigned int  contextId 
) const
overridevirtual

Get POOL FileSize attribute for database without logging a message.

Definition at line 703 of file PoolSvc.cxx.

703  {
704  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
705  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, dbName);
706  if (dbH == nullptr) {
707  ATH_MSG_DEBUG("getFileSize: Failed to get Session/DatabaseHandle to get POOL FileSize property.");
708  return 0; // failure
709  }
710  if (dbH->openMode() == pool::IDatabase::CLOSED) {
711  if (m_persistencySvcVec[contextId]->session().defaultConnectionPolicy().writeModeForNonExisting() != pool::DatabaseConnectionPolicy::RAISE_ERROR) {
712  dbH->setTechnology(tech);
713  dbH->connectForWrite();
714  } else {
715  dbH->connectForRead();
716  }
717  }
718  return(dbH->technologySpecificAttributes().attribute<long long int>("FILE_SIZE"));
719 }

◆ getInputContext()

unsigned int PoolSvc::getInputContext ( const std::string &  label,
unsigned int  maxFile = 0 
)
overridevirtual
Returns
an Id for an input context (POOL persistency service) and create it if needed.
Parameters
label[IN] string label to name new context and allow sharing (returns existing contextId)
maxFile[IN] maximum number of open input files.

Definition at line 367 of file PoolSvc.cxx.

367  {
368  std::lock_guard<CallMutex> lock(m_pool_mut);
369  if (!label.empty()) {
370  std::map<std::string, unsigned int>::const_iterator contextIter = m_inputContextLabel.find(label);
371  if (contextIter != m_inputContextLabel.end()) {
372  if (maxFile > 0) {
373  m_contextMaxFile[contextIter->second] = maxFile;
374  }
375  return(contextIter->second);
376  }
377  }
378  const unsigned int id = m_persistencySvcVec.size();
379  m_persistencySvcVec.push_back( pool::IPersistencySvc::create(*m_catalog).release() );
380  m_pers_mut.push_back(new CallMutex);
381  if (!connect(pool::ITransaction::READ, id).isSuccess()) {
382  ATH_MSG_WARNING("Failed to connect Input PersistencySvc: " << id);
383  return(IPoolSvc::kInputStream);
384  }
385  if (!label.empty()) {
386  m_inputContextLabel.insert(std::pair<std::string, unsigned int>(label, id));
387  }
388  m_contextMaxFile.insert(std::pair<unsigned int, int>(id, maxFile));
389  return(id);
390 }

◆ getInputContextMap()

const std::map< std::string, unsigned int > & PoolSvc::getInputContextMap ( ) const
overridevirtual
Returns
map of all labelled input contexts.

Definition at line 392 of file PoolSvc.cxx.

392  {
393  return(m_inputContextLabel);
394 }

◆ getOutputContext()

unsigned int PoolSvc::getOutputContext ( const std::string &  label)
overridevirtual
Returns
an Id for an output context (POOL persistency service) and create it if needed.
Parameters
label[IN] string label to name new context and allow sharing (returns existing contextId)

Definition at line 336 of file PoolSvc.cxx.

336  {
337  std::lock_guard<CallMutex> lock(m_pool_mut);
338  if (m_mainOutputLabel.empty()) {
340  m_outputContextLabel.insert(std::pair<std::string, unsigned int>(label, IPoolSvc::kOutputStream));
341  }
342  if (label == m_mainOutputLabel || label.empty()) {
343  return(IPoolSvc::kOutputStream);
344  }
345  std::map<std::string, unsigned int>::const_iterator contextIter = m_outputContextLabel.find(label);
346  if (contextIter != m_outputContextLabel.end()) {
347  return(contextIter->second);
348  }
349  const unsigned int id = m_persistencySvcVec.size();
350  m_persistencySvcVec.push_back(pool::IPersistencySvc::create(*m_catalog).release());
351  m_pers_mut.push_back(new CallMutex);
355  if (m_fileOpen.value() == "update") {
357  }
358  m_persistencySvcVec[id]->session().setDefaultConnectionPolicy(policy);
359  if (!m_persistencySvcVec[id]->session().technologySpecificAttributes(pool::ROOT_StorageType.type()).setAttribute<int>("DEFAULT_CONTAINER_TYPE", pool::DbType::getType(m_defaultROOTContainerType).type())) {
360  ATH_MSG_WARNING("Failed to set ROOT default container type via PersistencySvc for id " << id);
361  return(IPoolSvc::kOutputStream);
362  }
363  m_outputContextLabel.insert(std::pair<std::string, unsigned int>(label, id));
364  return(id);
365 }

◆ getToken()

Token * PoolSvc::getToken ( const std::string &  connection,
const std::string &  collection,
const unsigned long  ientry 
) const
overridevirtual
Returns
a token for a container entry.
Parameters
connection[IN] string containing the connection/file name.
collection[IN] string containing the persistent name of the collection.
ientry[IN] entry number for the token to be returned

Definition at line 574 of file PoolSvc.cxx.

576  {
577  std::lock_guard<CallMutex> lock(*m_pers_mut[IPoolSvc::kInputStream]);
578  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(IPoolSvc::kInputStream, connection);
579  if (dbH == nullptr) {
580  return(nullptr);
581  }
582  if (dbH->openMode() == pool::IDatabase::CLOSED) {
583  dbH->connectForRead();
584  }
585  std::unique_ptr<pool::IContainer> contH = getContainerHandle(dbH.get(), collection);
586  if (contH == nullptr) {
587  return(nullptr);
588  }
589  pool::ITokenIterator* tokenIter = contH->tokens("");
590  Token* thisToken = tokenIter->next();
591  for (unsigned long ipos = 0; ipos < ientry; ipos++) {
592  delete thisToken; thisToken = tokenIter->next();
593  }
594  delete tokenIter; tokenIter = nullptr;
595  return(thisToken);
596 }

◆ initialize()

StatusCode PoolSvc::initialize ( )
overridevirtual

Required of all Gaudi services:

Definition at line 57 of file PoolSvc.cxx.

57  {
58  if (!::AthService::initialize().isSuccess()) {
59  ATH_MSG_FATAL("Cannot initialize AthService base class.");
60  return(StatusCode::FAILURE);
61  }
62 
63  // Register this service for 'I/O' events
64  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
65  if (!iomgr.retrieve().isSuccess()) {
66  ATH_MSG_FATAL("Could not retrieve IoComponentMgr !");
67  return(StatusCode::FAILURE);
68  }
69  if (!iomgr->io_register(this).isSuccess()) {
70  ATH_MSG_FATAL("Could not register myself with the IoComponentMgr !");
71  return(StatusCode::FAILURE);
72  }
73  // Register input file's names with the I/O manager, unless in SharedWrite mode, set by AthenaPoolCnvSvc
74  bool allGood = true;
75  for (auto& catalog : m_readCatalog.value()) {
76  if (catalog.compare(0, 16, "xmlcatalog_file:") == 0) {
77  const std::string& fileName = catalog.substr(16);
78  if (!iomgr->io_register(this, IIoComponentMgr::IoMode::READ, fileName, fileName).isSuccess()) {
79  ATH_MSG_FATAL("could not register [" << catalog << "] for input !");
80  allGood = false;
81  } else {
82  ATH_MSG_INFO("io_register[" << this->name() << "](" << catalog << ") [ok]");
83  }
84  }
85  }
86  if (m_writeCatalog.value().compare(0, 16, "xmlcatalog_file:") == 0) {
87  const std::string& fileName = m_writeCatalog.value().substr(16);
88  if (!iomgr->io_register(this, IIoComponentMgr::IoMode::WRITE, fileName, fileName).isSuccess()) {
89  ATH_MSG_FATAL("could not register [" << m_writeCatalog.value() << "] for input !");
90  allGood = false;
91  } else {
92  ATH_MSG_INFO("io_register[" << this->name() << "](" << m_writeCatalog.value() << ") [ok]");
93  }
94  }
95  if (!allGood) {
96  return(StatusCode::FAILURE);
97  }
99  if (m_context == nullptr) {
100  ATH_MSG_FATAL("Failed to access CORAL Context");
101  return(StatusCode::FAILURE);
102  }
103  coral::ConnectionService conSvcH;
104  coral::IConnectionServiceConfiguration& csConfig = conSvcH.configuration();
105  csConfig.setConnectionRetrialPeriod(m_retrialPeriod);
106  csConfig.setConnectionRetrialTimeOut(m_retrialTimeOut);
107  if (m_connClean) {
108  csConfig.enablePoolAutomaticCleanUp();
109  csConfig.setConnectionTimeOut(m_timeOut);
110  } else {
111  csConfig.disablePoolAutomaticCleanUp();
112  csConfig.setConnectionTimeOut(0);
113  }
114  ATH_MSG_INFO("Set connectionsvc retry/timeout/IDLE timeout to "
115  << m_retrialPeriod
116  << "/"
118  << "/"
119  << m_timeOut
120  << " seconds with connection cleanup "
121  << (csConfig.isPoolAutomaticCleanUpEnabled() ? "enabled" : "disabled"));
122  // set Frontier web cache compression level
123  coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
124  webCache.setCompressionLevel(m_frontierComp);
125  ATH_MSG_INFO("Frontier compression level set to " << webCache.compressionLevel());
126  if (m_sortReplicas) {
127  // set replica sorter - get service
128  ServiceHandle<IDBReplicaSvc> replicasvc("DBReplicaSvc", name());
129  if (replicasvc.retrieve().isSuccess()) {
130  csConfig.setReplicaSortingAlgorithm(*replicasvc);
131  ATH_MSG_INFO("Successfully setup replica sorting algorithm");
132  } else {
133  ATH_MSG_WARNING("Cannot setup replica sorting algorithm");
134  }
135  }
136  MSG::Level athLvl = msg().level();
137  ATH_MSG_DEBUG("OutputLevel is " << (int)athLvl);
139  return(setupPersistencySvc());
140 }

◆ io_finalize()

StatusCode PoolSvc::io_finalize ( )
overridevirtual

Definition at line 272 of file PoolSvc.cxx.

272  {
273  ATH_MSG_INFO("I/O finalization...");
274  for (size_t i = 0; i < m_persistencySvcVec.size(); i++) {
275  if (m_persistencySvcVec[i]->session().defaultConnectionPolicy().writeModeForNonExisting() != pool::DatabaseConnectionPolicy::RAISE_ERROR &&
276  !disconnect(i).isSuccess()) {
277  ATH_MSG_WARNING("Cannot disconnect output Stream " << i);
278  }
279  }
280  clearState();
281  return(StatusCode::SUCCESS);
282 }

◆ io_reinit()

StatusCode PoolSvc::io_reinit ( )
overridevirtual

Definition at line 143 of file PoolSvc.cxx.

143  {
144  ATH_MSG_INFO("I/O reinitialization...");
145  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
146  if (!iomgr.retrieve().isSuccess()) {
147  ATH_MSG_FATAL("Could not retrieve IoComponentMgr !");
148  return(StatusCode::FAILURE);
149  }
150  if (!iomgr->io_hasitem(this)) {
151  ATH_MSG_FATAL("IoComponentMgr does not know about myself !");
152  return(StatusCode::FAILURE);
153  }
154  std::vector<std::string> readcat = m_readCatalog.value();
155  for (std::size_t icat = 0, imax = readcat.size(); icat < imax; icat++) {
156  if (readcat[icat].compare(0, 16, "xmlcatalog_file:") == 0) {
157  std::string fileName = readcat[icat].substr(16);
158  if (iomgr->io_contains(this, fileName)) {
159  if (!iomgr->io_retrieve(this, fileName).isSuccess()) {
160  ATH_MSG_FATAL("Could not retrieve new value for [" << fileName << "] !");
161  return(StatusCode::FAILURE);
162  }
163  readcat[icat] = "xmlcatalog_file:" + fileName;
164  }
165  }
166  }
167  // all good... copy over.
168  m_readCatalog = readcat;
169  if (m_writeCatalog.value().compare(0, 16, "xmlcatalog_file:") == 0) {
170  std::string fileName = m_writeCatalog.value().substr(16);
171  if (iomgr->io_contains(this, fileName)) {
172  if (!iomgr->io_retrieve(this, fileName).isSuccess()) {
173  ATH_MSG_FATAL("Could not retrieve new value for [" << fileName << "] !");
174  return(StatusCode::FAILURE);
175  }
176  if (!m_shareCat) {
177  m_writeCatalog.setValue("xmlcatalog_file:" + fileName);
178  }
179  }
180  }
181  return(setupPersistencySvc());
182 }

◆ loadComponent()

void PoolSvc::loadComponent ( const std::string &  compName)
overridevirtual
Returns
void
Parameters
compName[IN] string name of the component to be loaded.

Definition at line 400 of file PoolSvc.cxx.

400  {
401  m_context->loadComponent(compName);
402 }

◆ lookupBestPfn()

void PoolSvc::lookupBestPfn ( const std::string &  token,
std::string &  pfn,
std::string &  type 
) const
overridevirtual
Returns
void
Parameters
token[IN] filename/token string to be translated
pfn[OUT] string PFN of database
type[OUT] string filetype of database

Definition at line 412 of file PoolSvc.cxx.

412  {
413  std::string dbID;
414  if (token.compare(0, 4, "PFN:") == 0) {
415  m_catalog->lookupFileByPFN(token.substr(4), dbID, type); // PFN -> FID
416  } else if (token.compare(0, 4, "LFN:") == 0) {
417  m_catalog->lookupFileByLFN(token.substr(4), dbID); // LFN -> FID
418  } else if (token.compare(0, 4, "FID:") == 0) {
419  dbID = token.substr(4);
420  } else if (token.size() > Guid::null().toString().size()) { // full token
421  Token tok;
422  tok.fromString(token);
423  dbID = tok.dbID().toString();
424  } else { // guid only
425  dbID = token;
426  }
427  m_catalog->getFirstPFN(dbID, pfn, type); // FID -> best PFN
428 }

◆ patchCatalog()

void PoolSvc::patchCatalog ( const std::string &  pfn,
pool::IDatabase dbH 
) const
private

Definition at line 566 of file PoolSvc.cxx.

566  {
567  std::scoped_lock lock(m_pool_mut);
568  dbH.setTechnology(pool::ROOT_StorageType.type());
569  std::string fid = dbH.fid();
571  catalog_locked->registerPFN(pfn, "ROOT_All", fid);
572 }

◆ poolCondPath()

std::string PoolSvc::poolCondPath ( const std::string &  leaf)
private

Resolve a file using ATLAS_POOLCOND_PATH.

Definition at line 1042 of file PoolSvc.cxx.

1042  {
1043  // look for files at $ATLAS_POOLCOND_PATH/<leaf>
1044  // return full filename if exists, or empty string if not
1045  const char* cpath = std::getenv("ATLAS_POOLCOND_PATH");
1046  if (cpath && strcmp(cpath, "") != 0) {
1047  const std::string testpath = std::string(cpath) + "/" + leaf;
1048 
1049  // Try to open file for reading. Note that a simple stat call may return
1050  // a wrong result if the file is residing on an auto-mounted FS (ATR-28801).
1051  if (FILE* fp = std::fopen(testpath.c_str(), "r")) {
1052  std::fclose(fp);
1053  return testpath;
1054  }
1055  }
1056  return {};
1057 }

◆ registerForWrite()

Token * PoolSvc::registerForWrite ( const Placement placement,
const void *  obj,
const RootType classDesc 
)
overridevirtual
Returns
a token to a Data Object written to Pool.
Parameters
placement[IN] pointer to the placement hint.
obj[IN] pointer to the Data Object to be written to Pool.
classDesc[IN] pointer to the Seal class description for the Data Object.

Definition at line 284 of file PoolSvc.cxx.

286  {
287  unsigned int contextId = IPoolSvc::kOutputStream;
288  const std::string& auxString = placement->auxString();
289  if (!auxString.empty()) {
290  if (auxString.compare(0, 6, "[CTXT=") == 0) {
291  ::sscanf(auxString.c_str(), "[CTXT=%08X]", &contextId);
292  } else if (auxString.compare(0, 8, "[CLABEL=") == 0) {
293  contextId = this->getOutputContext(auxString);
294  }
295  if (contextId >= m_persistencySvcVec.size()) {
296  ATH_MSG_WARNING("registerForWrite: Using default output Stream instead of id = " << contextId);
297  contextId = IPoolSvc::kOutputStream;
298  }
299  }
300  std::lock_guard<CallMutex> lock(*m_pers_mut[contextId]);
301  Token* token = m_persistencySvcVec[contextId]->registerForWrite(*placement, obj, classDesc);
302  if (token == nullptr) {
303  ATH_MSG_WARNING("Cannot write object: " << placement->containerName());
304  }
305  return(token);
306 }

◆ renamePfn()

void PoolSvc::renamePfn ( const std::string &  pf,
const std::string &  newpf 
)
overridevirtual
Returns
void
Parameters
pf[IN] filename to be renamed
newpf[IN] new filename

Definition at line 430 of file PoolSvc.cxx.

430  {
431  std::string dbID, type;
432  m_catalog->lookupFileByPFN(pf, dbID, type);
433  if (dbID.empty()) {
434  ATH_MSG_WARNING("Failed to lookup: " << pf << " in FileCatalog");
435  return;
436  }
437  m_catalog->lookupFileByPFN(newpf, dbID, type);
438  if (!dbID.empty()) {
439  ATH_MSG_INFO("Found: " << newpf << " in FileCatalog");
440  return;
441  }
442  m_catalog->renamePFN(pf, newpf);
443 }

◆ setAttribute() [1/2]

StatusCode PoolSvc::setAttribute ( const std::string &  optName,
const std::string &  data,
long  tech,
const std::string &  dbName,
const std::string &  contName = "",
unsigned int  contextId = IPoolSvc::kOutputStream 
) const
overridevirtual

Set POOL attributes - db/file, container/collection.

Definition at line 819 of file PoolSvc.cxx.

824  {
825  if (contextId >= m_persistencySvcVec.size()) {
826  ATH_MSG_WARNING("setAttribute: Using default output Stream instead of id = " << contextId);
827  contextId = IPoolSvc::kOutputStream;
828  }
829  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
830  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, dbName);
831  if (dbH == nullptr) {
832  ATH_MSG_DEBUG("Failed to get Session/DatabaseHandle to set POOL property.");
833  return(StatusCode::FAILURE);
834  }
835  if (dbH->openMode() == pool::IDatabase::CLOSED) {
836  if (m_persistencySvcVec[contextId]->session().defaultConnectionPolicy().writeModeForNonExisting() != pool::DatabaseConnectionPolicy::RAISE_ERROR) {
837  dbH->setTechnology(tech);
838  dbH->connectForWrite();
839  } else {
840  dbH->connectForRead();
841  }
842  }
843  bool retError = false;
844  std::string objName;
845  bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6, "TTree=") == 0);
846  if (contName.empty() || hasTTreeName || m_persistencySvcVec[contextId]->session().defaultConnectionPolicy().writeModeForNonExisting() == pool::DatabaseConnectionPolicy::RAISE_ERROR) {
847  objName = hasTTreeName ? contName.substr(6) : contName;
848  if( !isNumber(data) ) {
849  retError = dbH->technologySpecificAttributes().setAttribute(optName, data.c_str(), objName);
850  } else if( data[data.size() - 1] == 'L' ) {
851  retError = dbH->technologySpecificAttributes().setAttribute<long long int>(optName, atoll(data.c_str()), objName);
852  } else {
853  retError = dbH->technologySpecificAttributes().setAttribute<int>(optName, atoi(data.c_str()), objName);
854  }
855  if (!retError) {
856  ATH_MSG_DEBUG("Failed to set POOL property, " << optName << " to " << data);
857  return(StatusCode::FAILURE);
858  }
859  } else {
860  std::unique_ptr<pool::IContainer> contH = getContainerHandle(dbH.get(), contName);
861  if (contH == nullptr) {
862  ATH_MSG_DEBUG("Failed to get ContainerHandle to set POOL property.");
863  return(StatusCode::FAILURE);
864  }
865  if (auto p = contName.find('('); p != std::string::npos) {
866  objName = contName.substr(p + 1); // Get BranchName between parenthesis
867  objName.erase(objName.find(')'));
868  } else if (auto p = contName.find("::"); p != std::string::npos) {
869  objName = contName.substr(p + 2); // Split off Tree name
870  } else if (auto p = contName.find('_'); p != std::string::npos) {
871  objName = contName.substr(p + 1); // Split off "POOLContainer"
872  objName.erase(objName.find('/')); // Split off key
873  }
874  std::string::size_type off = 0;
875  while ((off = objName.find_first_of("<>/")) != std::string::npos) {
876  objName[off] = '_'; // Replace special chars (e.g. templates)
877  }
878  if (data[data.size() - 1] == 'L') {
879  retError = contH->technologySpecificAttributes().setAttribute<long long int>(optName, atoll(data.c_str()), objName);
880  } else {
881  retError = contH->technologySpecificAttributes().setAttribute<int>(optName, atoi(data.c_str()), objName);
882  }
883  if (!retError) {
884  ATH_MSG_DEBUG("Failed to set POOL container property, " << optName << " for " << contName << " : " << objName << " to " << data);
885  return(StatusCode::FAILURE);
886  }
887  }
888  return(StatusCode::SUCCESS);
889 }

◆ setAttribute() [2/2]

StatusCode PoolSvc::setAttribute ( const std::string &  optName,
const std::string &  data,
long  tech,
unsigned int  contextId = IPoolSvc::kOutputStream 
) const
overridevirtual

Set POOL attributes - domain.

Definition at line 795 of file PoolSvc.cxx.

798  {
799  if (contextId >= m_persistencySvcVec.size()) {
800  ATH_MSG_WARNING("setAttribute: Using default output Stream instead of id = " << contextId);
801  contextId = IPoolSvc::kOutputStream;
802  }
803  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
804  pool::ISession& sesH = m_persistencySvcVec[contextId]->session();
805  if (data[data.size() - 1] == 'L') {
806  if (!sesH.technologySpecificAttributes(tech).setAttribute<long long int>(optName, atoll(data.c_str()))) {
807  ATH_MSG_DEBUG("Failed to set POOL property, " << optName << " to " << data);
808  return(StatusCode::FAILURE);
809  }
810  } else {
811  if (!sesH.technologySpecificAttributes(tech).setAttribute<int>(optName, atoi(data.c_str()))) {
812  ATH_MSG_DEBUG("Failed to set POOL property, " << optName << " to " << data);
813  return(StatusCode::FAILURE);
814  }
815  }
816  return(StatusCode::SUCCESS);
817 }

◆ setFrontierCache()

StatusCode PoolSvc::setFrontierCache ( const std::string &  conn)
overridevirtual

Setup Frontier cache for given logical or physical connection name.

Definition at line 891 of file PoolSvc.cxx.

891  {
892  std::lock_guard<CallMutex> lock(m_pool_mut);
893  ATH_MSG_VERBOSE("setFrontierCache called for connection:" << conn);
894  // setup the Frontier cache information for the given logical or physical connection string
895  // first determine if the connection is logical (no ':')
896  std::vector<std::string> physcons;
897  if (conn.find(':') == std::string::npos) {
898  // if logical, have to lookup list of physical replicas, and consider each
899  // need the CORAL ILookupSvc interface which must be loaded if needed
900  const std::string lookSvcStr("CORAL/Services/XMLLookupService");
901  coral::IHandle<coral::ILookupService> lookSvcH = m_context->query<coral::ILookupService>();
902  if (!lookSvcH.isValid()) {
903  m_context->loadComponent(lookSvcStr);
904  lookSvcH = m_context->query<coral::ILookupService>();
905  }
906  if (!lookSvcH.isValid()) {
907  ATH_MSG_ERROR("Cannot locate " << lookSvcStr);
908  return(StatusCode::FAILURE);
909  }
910  coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
911  if (dbset != nullptr) {
912  for (int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
913  const std::string pcon = dbset->replica(irep).connectionString();
914  if (pcon.compare(0, 9, "frontier:") == 0) {
915  physcons.push_back(pcon);
916  }
917  }
918  delete dbset; dbset = nullptr;
919  } else {
920  ATH_MSG_DEBUG("setFrontierCache: Could not find any replicas for " << conn);
921  }
922  } else if (conn.compare(0, 9, "frontier:") == 0) {
923  physcons.push_back(conn);
924  }
925  // check if any replicas will try and use frontier
926  if (physcons.size() == 0) {
927  return(StatusCode::SUCCESS);
928  }
929  coral::ConnectionService conSvcH;
930  // for each frontier replica, define the web cache info
931  // get the WebCacheControl interface via ConnectionSvc
932  // note ConnectionSvc should already be loaded by initialize
933  coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
934  for (std::vector<std::string>::const_iterator iter = physcons.begin(), last = physcons.end();
935  iter != last; ++iter) {
936  if (find(m_frontierRefresh.value().begin(), m_frontierRefresh.value().end(), *iter)
937  == m_frontierRefresh.value().end()
938  && find(m_frontierRefresh.value().begin(), m_frontierRefresh.value().end(), conn)
939  == m_frontierRefresh.value().end()) {
940  // set that a table DUMMYTABLE should be refreshed - indicates that everything
941  // else in the schema should not be
942  webCache.refreshTable(*iter, "DUMMYTABLE");
943  } else {
944  // set the schema to be refreshed
945  webCache.refreshSchemaInfo(*iter);
946  }
947  ATH_MSG_DEBUG("Cache flag for connection " << *iter << " set to " << webCache.webCacheInfo(*iter).isSchemaInfoCached());
948  }
949  return(StatusCode::SUCCESS);
950 }

◆ setObjPtr()

void PoolSvc::setObjPtr ( void *&  obj,
const Token token 
)
overridevirtual
Returns
void
Parameters
obj[OUT] pointer to the Data Object.
token[IN] token of the Data Object for which a Pool Ref is filled.

Definition at line 308 of file PoolSvc.cxx.

308  {
309  unsigned int contextId = IPoolSvc::kInputStream;
310  const std::string& auxString = token->auxString();
311  if (!auxString.empty()) {
312  if (auxString.compare(0, 6, "[CTXT=") == 0) {
313  ::sscanf(auxString.c_str(), "[CTXT=%08X]", &contextId);
314  } else if (auxString.compare(0, 8, "[CLABEL=") == 0) {
315  contextId = this->getInputContext(auxString);
316  }
317  if (contextId >= m_persistencySvcVec.size()) {
318  ATH_MSG_WARNING("setObjPtr: Using default input Stream instead of id = " << contextId);
319  contextId = IPoolSvc::kInputStream;
320  }
321  }
322  ATH_MSG_VERBOSE("setObjPtr: token=" << token->toString() << ", auxString=" << auxString << ", contextID=" << contextId);
323  // Get Context ID/label from Token
324  std::lock_guard<CallMutex> lock(*m_pers_mut[contextId]);
325  obj = m_persistencySvcVec[contextId]->readObject(*token, obj);
326  std::map<unsigned int, unsigned int>::const_iterator maxFileIter = m_contextMaxFile.find(contextId);
327  if (maxFileIter != m_contextMaxFile.end() && maxFileIter->second > 0) {
328  m_guidLists[contextId].remove(token->dbID());
329  m_guidLists[contextId].push_back(token->dbID());
330  while (m_guidLists[contextId].size() > maxFileIter->second) {
331  this->disconnectDb("FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
332  }
333  }
334 }

◆ setShareMode()

void PoolSvc::setShareMode ( bool  shareCat)
overridevirtual
Returns
void
Parameters
shareCat[IN] bool to share the file catalog.

Definition at line 404 of file PoolSvc.cxx.

404  {
405  m_shareCat = shareCat;
406 }

◆ setupPersistencySvc()

StatusCode PoolSvc::setupPersistencySvc ( )
private

Definition at line 184 of file PoolSvc.cxx.

184  {
185  clearState();
186  ATH_MSG_INFO("Setting up APR FileCatalog and Streams");
188  if (m_catalog != nullptr) {
189  m_catalog->start();
190  } else {
191  ATH_MSG_FATAL("Failed to setup POOL File Catalog.");
192  return(StatusCode::FAILURE);
193  }
194  // Setup a persistency services
195  m_persistencySvcVec.push_back(pool::IPersistencySvc::create(*m_catalog).release()); // Read Service
196  m_pers_mut.push_back(new CallMutex);
197  if (!m_persistencySvcVec[IPoolSvc::kInputStream]->session().technologySpecificAttributes(pool::ROOT_StorageType.type()).setAttribute<bool>("ENABLE_THREADSAFETY", true)) {
198  ATH_MSG_FATAL("Failed to enable thread safety in ROOT via PersistencySvc.");
199  return(StatusCode::FAILURE);
200  }
201  m_contextMaxFile.insert(std::pair<unsigned int, int>(IPoolSvc::kInputStream, m_dbAgeLimit));
203  ATH_MSG_FATAL("Failed to connect Input PersistencySvc.");
204  return(StatusCode::FAILURE);
205  }
206  m_persistencySvcVec.push_back(pool::IPersistencySvc::create(*m_catalog).release()); // Write Service
207  m_pers_mut.push_back(new CallMutex);
211  if (m_fileOpen.value() == "update") {
213  }
214  m_persistencySvcVec[IPoolSvc::kOutputStream]->session().setDefaultConnectionPolicy(policy);
215  if (!m_persistencySvcVec[IPoolSvc::kOutputStream]->session().technologySpecificAttributes(pool::ROOT_StorageType.type()).setAttribute<int>("DEFAULT_CONTAINER_TYPE", pool::DbType::getType(m_defaultROOTContainerType).type())) {
216  ATH_MSG_FATAL("Failed to set ROOT default container type via PersistencySvc.");
217  return(StatusCode::FAILURE);
218  }
219 
220  return(StatusCode::SUCCESS);
221 }

◆ start()

StatusCode PoolSvc::start ( )
overridevirtual

Required of all Gaudi services:

Definition at line 223 of file PoolSvc.cxx.

223  {
224  // Switiching on ROOT implicit multi threading for AthenaMT
226  if (!m_persistencySvcVec[IPoolSvc::kInputStream]->session().technologySpecificAttributes(pool::ROOT_StorageType.type()).setAttribute<int>("ENABLE_IMPLICITMT", Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1)) {
227  ATH_MSG_FATAL("Failed to enable implicit multithreading in ROOT via PersistencySvc.");
228  return(StatusCode::FAILURE);
229  }
230  ATH_MSG_INFO("Enabled implicit multithreading in ROOT via PersistencySvc to: " << Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1);
231  }
232  return(StatusCode::SUCCESS);
233 }

◆ stop()

StatusCode PoolSvc::stop ( )
overridevirtual

Definition at line 235 of file PoolSvc.cxx.

235  {
236  ATH_MSG_VERBOSE("stop()");
237  bool retError = false;
238  for (unsigned int contextId = 0, imax = m_persistencySvcVec.size(); contextId < imax; contextId++) {
239  if (!disconnect(contextId).isSuccess()) {
240  ATH_MSG_FATAL("Cannot disconnect Stream: " << contextId);
241  retError = true;
242  }
243  }
244  return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
245 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::map<unsigned int, std::list<Guid> > m_guidLists PoolSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 229 of file PoolSvc.h.

◆ m_attemptCatalogPatch

BooleanProperty PoolSvc::m_attemptCatalogPatch {this,"AttemptCatalogPatch",true}
private

AttemptCatalogPatch, option to create catalog: default = false.

Definition at line 248 of file PoolSvc.h.

◆ m_catalog

pool::IFileCatalog* PoolSvc::m_catalog {nullptr}
private

Definition at line 221 of file PoolSvc.h.

◆ m_connClean

BooleanProperty PoolSvc::m_connClean {this,"ConnectionCleanUp",false}
private

ConnectionCleanUp - whether to use CORAL connection management thread: default = false.

Definition at line 256 of file PoolSvc.h.

◆ m_context

coral::Context* PoolSvc::m_context {nullptr}
private

Definition at line 219 of file PoolSvc.h.

◆ m_contextMaxFile

std::map<unsigned int, unsigned int> PoolSvc::m_contextMaxFile
private

Definition at line 227 of file PoolSvc.h.

◆ m_dbAgeLimit

IntegerProperty PoolSvc::m_dbAgeLimit {this,"MaxFilesOpen",0}
private

MaxFilesOpen, option to have PoolSvc limit the number of open Input Files: default = 0 (No files are closed automatically)

Definition at line 236 of file PoolSvc.h.

◆ m_defaultROOTContainerType

StringProperty PoolSvc::m_defaultROOTContainerType {this, "DefaultContainerType", "ROOTTREEINDEX"}
private

Default ROOT container type.

Definition at line 263 of file PoolSvc.h.

◆ m_fileOpen

StringProperty PoolSvc::m_fileOpen {this,"FileOpen","overwrite"}
private

FileOpen, the open mode for the file ("append" or "overwrite").

Definition at line 233 of file PoolSvc.h.

◆ m_frontierComp

IntegerProperty PoolSvc::m_frontierComp {this,"FrontierCompression",5}
private

Frontier proprties, compression level and list of schemas to be refreshed: default = 5.

Definition at line 258 of file PoolSvc.h.

◆ m_frontierRefresh

StringArrayProperty PoolSvc::m_frontierRefresh {this,"FrontierRefreshSchema",{}}
private

Definition at line 259 of file PoolSvc.h.

◆ m_inputContextLabel

std::map<std::string, unsigned int> PoolSvc::m_inputContextLabel
private

Definition at line 224 of file PoolSvc.h.

◆ m_mainOutputLabel

std::string PoolSvc::m_mainOutputLabel {}
private

Definition at line 226 of file PoolSvc.h.

◆ m_outputContextLabel

std::map<std::string, unsigned int> PoolSvc::m_outputContextLabel
private

Definition at line 225 of file PoolSvc.h.

◆ m_pers_mut

std::vector<CallMutex*> PoolSvc::m_pers_mut
private

Definition at line 223 of file PoolSvc.h.

◆ m_persistencySvcVec

std::vector<pool::IPersistencySvc*> PoolSvc::m_persistencySvcVec
private

Definition at line 222 of file PoolSvc.h.

◆ m_pool_mut

CallMutex PoolSvc::m_pool_mut
mutableprivate

Definition at line 218 of file PoolSvc.h.

◆ m_readCatalog

StringArrayProperty PoolSvc::m_readCatalog {this,"ReadCatalog",{},"List of catalog files to read from","OrderedSet<std::string>"}
private

ReadCatalog, the list of additional POOL input file catalogs to consult: default = empty vector.

Definition at line 241 of file PoolSvc.h.

◆ m_retrialPeriod

IntegerProperty PoolSvc::m_retrialPeriod {this,"ConnectionRetrialPeriod",300}
private

ConnectionRetrialPeriod, retry period for CORAL Connection Service: default = 30 seconds.

Definition at line 250 of file PoolSvc.h.

◆ m_retrialTimeOut

IntegerProperty PoolSvc::m_retrialTimeOut {this,"ConnectionRetrialTimeOut",3600}
private

ConnectionRetrialTimeOut, the retrial time out for CORAL Connection Service: default = 300 seconds.

Definition at line 252 of file PoolSvc.h.

◆ m_shareCat

bool PoolSvc::m_shareCat {false}
private

Definition at line 220 of file PoolSvc.h.

◆ m_sortReplicas

BooleanProperty PoolSvc::m_sortReplicas {this,"SortReplicas",true}
private

Use DBReplicaSvc to sort database connections, default = true.

Definition at line 261 of file PoolSvc.h.

◆ m_timeOut

IntegerProperty PoolSvc::m_timeOut {this,"ConnectionTimeOut",5}
private

ConnectionTimeOut, the time out for CORAL Connection Service: default = 5 seconds.

Definition at line 254 of file PoolSvc.h.

◆ m_useROOTIMT

BooleanProperty PoolSvc::m_useROOTIMT {this,"UseROOTImplicitMT",true}
private

Use ROOT Implicit MultiThreading, default = true.

Definition at line 243 of file PoolSvc.h.

◆ m_useROOTMaxTree

BooleanProperty PoolSvc::m_useROOTMaxTree {this,"UseROOTIncreaseVMaxTree",false}
private

Increase virtual TTree size to avoid backreads in multithreading, default = false.

Definition at line 245 of file PoolSvc.h.

◆ m_writeCatalog

StringProperty PoolSvc::m_writeCatalog {this,"WriteCatalog","xmlcatalog_file:PoolFileCatalog.xml"}
private

WriteCatalog, the file catalog to be used to register output files (also default input catalog): default = "" (use POOL default).

Definition at line 239 of file PoolSvc.h.


The documentation for this class was generated from the following files:
pool::IContainer
Definition: IContainer.h:23
PoolSvc::m_timeOut
IntegerProperty m_timeOut
ConnectionTimeOut, the time out for CORAL Connection Service: default = 5 seconds.
Definition: PoolSvc.h:254
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
IPoolSvc::kOutputStream
@ kOutputStream
Definition: IPoolSvc.h:39
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
pool::CollectionFactory::get
static CollectionFactory * get()
Retrieves the collection factory singleton.
Guid::null
static const Guid & null()
NULL-Guid: static class method.
Definition: Guid.cxx:18
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
Amg::compare
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
Definition: EventPrimitivesHelpers.h:109
AddEmptyComponent.compName
compName
Definition: AddEmptyComponent.py:32
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
PoolSvc::ATLAS_THREAD_SAFE
std::map< unsigned int, std::list< Guid > > m_guidLists ATLAS_THREAD_SAFE
Definition: PoolSvc.h:229
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
pool::DatabaseSpecification::FID
@ FID
Physical File Name.
Definition: DatabaseSpecification.h:17
pool::IFileCatalog::lookupFileByPFN
void lookupFileByPFN(const std::string &pfn, std::string &fid, std::string &tech) const
Get FID and filetype for a given PFN.
PoolSvc::getDbHandle
std::unique_ptr< pool::IDatabase > getDbHandle(unsigned int contextId, const std::string &dbName) const
Get Database handle.
Definition: PoolSvc.cxx:995
pool::DbType::getType
static DbType getType(const std::string &name)
Access known storage type object by name.
PoolSvc::m_retrialTimeOut
IntegerProperty m_retrialTimeOut
ConnectionRetrialTimeOut, the retrial time out for CORAL Connection Service: default = 300 seconds.
Definition: PoolSvc.h:252
Placement::containerName
const std::string & containerName() const
Access container name.
Definition: Placement.h:32
pool::DatabaseConnectionPolicy::setWriteModeForNonExisting
bool setWriteModeForNonExisting(Mode mode)
Sets the opening mode when a non existing database is opened for writing Acceptable values are RAISE_...
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PoolSvc::m_pool_mut
CallMutex m_pool_mut
Definition: PoolSvc.h:218
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
PoolSvc::m_fileOpen
StringProperty m_fileOpen
FileOpen, the open mode for the file ("append" or "overwrite").
Definition: PoolSvc.h:233
PoolSvc::m_frontierComp
IntegerProperty m_frontierComp
Frontier proprties, compression level and list of schemas to be refreshed: default = 5.
Definition: PoolSvc.h:258
pool::IFileCatalog::registerPFN
void registerPFN(const std::string &pfn, const std::string &ftype, std::string &fid)
Register PFN, assign new FID if not given.
PoolSvc::m_inputContextLabel
std::map< std::string, unsigned int > m_inputContextLabel
Definition: PoolSvc.h:224
PoolSvc::connect
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...
Definition: PoolSvc.cxx:598
PoolSvc::commit
virtual StatusCode commit(unsigned int contextId=IPoolSvc::kInputStream) const override
Commit data for a given contextId and flush buffer.
Definition: PoolSvc.cxx:630
PoolSvc::m_attemptCatalogPatch
BooleanProperty m_attemptCatalogPatch
AttemptCatalogPatch, option to create catalog: default = false.
Definition: PoolSvc.h:248
pool::IContainer::technologySpecificAttributes
virtual const ITechnologySpecificAttributes & technologySpecificAttributes() const =0
Returns the object holding the technology specific attributes for a given technology domain.
initialize
void initialize()
Definition: run_EoverP.cxx:894
pool::IDatabase::connectForRead
virtual void connectForRead()=0
Connects explicitly to the database for read operations.
Token::auxString
const std::string & auxString() const
Access auxiliary string.
Definition: Token.h:91
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
PoolSvc::catalog
virtual const pool::IFileCatalog * catalog() const override
Definition: PoolSvc.cxx:408
pool::IFileCatalog::renamePFN
void renamePFN(const std::string &pfn, const std::string &newpfn)
Rename PFN.
Definition: IFileCatalog.h:98
pool::ITransaction::UPDATE
@ UPDATE
Definition: ITransaction.h:30
PoolSvc::disconnect
virtual StatusCode disconnect(unsigned int contextId=IPoolSvc::kInputStream) const override
Disconnect PersistencySvc associated with a contextId.
Definition: PoolSvc.cxx:663
Token::dbID
const Guid & dbID() const
Access database identifier.
Definition: Token.h:64
pool::WRITE
@ WRITE
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:72
PoolSvc::m_frontierRefresh
StringArrayProperty m_frontierRefresh
Definition: PoolSvc.h:259
pool::ISession::disconnectAll
virtual bool disconnectAll()=0
Explicitly disconnects all the databases.
pool::IDatabase::pfn
virtual const std::string & pfn()=0
Returns the physical file name of this database.
Guid::toString
const std::string toString() const
Automatic conversion to string representation.
Definition: Guid.cxx:58
pool::IFileCatalog::commit
void commit()
Save catalog to file.
Definition: IFileCatalog.h:49
pool::DatabaseConnectionPolicy::RAISE_ERROR
@ RAISE_ERROR
Definition: DatabaseConnectionPolicy.h:22
pool::ITechnologySpecificAttributes::setAttribute
bool setAttribute(const std::string &attributeName, const T &atttibuteValue, const std::string &option="")
Templated method to set an attribute.
Definition: ITechnologySpecificAttributes.h:53
pool::IContainer::tokens
virtual ITokenIterator * tokens(const std::string &selection)=0
Starts an iteration over the tokens in the container.
PoolSvc::m_context
coral::Context * m_context
Definition: PoolSvc.h:219
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PoolSvc::setAttribute
virtual StatusCode setAttribute(const std::string &optName, const std::string &data, long tech, unsigned int contextId=IPoolSvc::kOutputStream) const override
Set POOL attributes - domain.
Definition: PoolSvc.cxx:795
pool::ISession::transaction
virtual ITransaction & transaction()=0
Returns the transaction object.
pool::IDatabase::fid
virtual const std::string & fid()=0
Returns the file identifier of this database.
pool::DatabaseSpecification::LFN
@ LFN
File IDentifier.
Definition: DatabaseSpecification.h:18
PoolSvc::m_writeCatalog
StringProperty m_writeCatalog
WriteCatalog, the file catalog to be used to register output files (also default input catalog): defa...
Definition: PoolSvc.h:239
pool::IDatabase::openMode
virtual OpenMode openMode() const =0
Returns the opening mode. It can be used to check whether the database is connected.
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
pool::ITokenIterator::next
virtual Token * next()=0
Returns the pointer to next token.
PoolSvc::m_useROOTMaxTree
BooleanProperty m_useROOTMaxTree
Increase virtual TTree size to avoid backreads in multithreading, default = false.
Definition: PoolSvc.h:245
pool::ITransaction::Type
Type
Transaction type enumeration.
Definition: ITransaction.h:28
pool::ISession
Definition: ISession.h:31
pool::IDatabase::technologySpecificAttributes
virtual const ITechnologySpecificAttributes & technologySpecificAttributes() const =0
Returns the object holding the technology specific attributes.
pool::IFileCatalog::lookupFileByLFN
void lookupFileByLFN(const std::string &lfn, std::string &fid) const
Return the status of a LFName.
Definition: IFileCatalog.h:82
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
pool::DbPrintLvl::setLevel
void setLevel(MsgLevel l)
Definition: DbPrint.h:32
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
PoolSvc::CallMutex
std::recursive_mutex CallMutex
Definition: PoolSvc.h:204
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
Token::fromString
Token & fromString(const std::string &from)
Build from the string representation of a token.
Definition: Token.cxx:148
PoolSvc::m_pers_mut
std::vector< CallMutex * > m_pers_mut
Definition: PoolSvc.h:223
IPoolSvc::kInputStream
@ kInputStream
Definition: IPoolSvc.h:39
pool::DatabaseConnectionPolicy::UPDATE
@ UPDATE
Definition: DatabaseConnectionPolicy.h:25
PoolSvc::m_mainOutputLabel
std::string m_mainOutputLabel
Definition: PoolSvc.h:226
pool::Exception
Base exception class for the POOL system.
Definition: Database/APR/POOLCore/POOLCore/Exception.h:15
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
pool::IFileCatalog
Definition: IFileCatalog.h:23
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
pool::DatabaseConnectionPolicy::OVERWRITE
@ OVERWRITE
Definition: DatabaseConnectionPolicy.h:24
PoolSvc::getOutputContext
virtual unsigned int getOutputContext(const std::string &label) override
Definition: PoolSvc.cxx:336
pool::ITransaction::commitAndHold
virtual bool commitAndHold()=0
Commits the holds transaction.
pool::IDatabase::connectForWrite
virtual void connectForWrite()=0
Connects explicitly to the database for write/update operations.
lumiFormat.i
int i
Definition: lumiFormat.py:85
trigmenu_modify_prescale_json.fp
fp
Definition: trigmenu_modify_prescale_json.py:53
PoolSvc::getContainerHandle
std::unique_ptr< pool::IContainer > getContainerHandle(pool::IDatabase *dbH, const std::string &contName) const
Get Container handle.
Definition: PoolSvc.cxx:1025
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PixelModuleFeMask_create_db.dbName
string dbName
Definition: PixelModuleFeMask_create_db.py:21
pool::IDatabase::CLOSED
@ CLOSED
Definition: IDatabase.h:28
pool::CollectionDescription
Definition: CollectionDescription.h:26
pool::CollectionFactory
Definition: CollectionFactory.h:31
pool::ISession::technologySpecificAttributes
virtual const ITechnologySpecificAttributes & technologySpecificAttributes(long technology) const =0
Returns the object holding the technology specific attributes for a given technology domain.
pool::IFileCatalog::start
void start()
redirect to init() for Gaudi FC
Definition: IFileCatalog.h:45
pool::ITransaction::start
virtual bool start(Type type=READ)=0
Starts a new transaction. Returns the success of the operation.
calibdata.exception
exception
Definition: calibdata.py:496
add-xsec-uncert-quadrature-N.label
label
Definition: add-xsec-uncert-quadrature-N.py:104
pool::DatabaseConnectionPolicy::setWriteModeForExisting
bool setWriteModeForExisting(Mode mode)
Sets the opening mode when an existing database is opened for writing.
file
TFile * file
Definition: tile_monitor.h:29
PoolSvc::disconnectDb
virtual StatusCode disconnectDb(const std::string &connection, unsigned int contextId=IPoolSvc::kInputStream) const override
Disconnect single Database.
Definition: PoolSvc.cxx:685
pool::IFileCatalog::setWriteCatalog
void setWriteCatalog(const std::string &connect)
Access to the (first) writable file catalog.
pool::IDatabase::setTechnology
virtual bool setTechnology(long technology)=0
Sets the technology identifier for this database.
pool::IDatabase::disconnect
virtual void disconnect()=0
Disconnects from the database.
imax
int imax(int i, int j)
Definition: TileLaserTimingTool.cxx:33
pool::IFileCatalog::connect
void connect()
Definition: IFileCatalog.h:39
Placement::auxString
const std::string & auxString() const
Access auxiliary string.
Definition: Placement.h:40
pool::IFileCatalog::removeCatalog
void removeCatalog(const std::string &connect)
Add new catalog identified by reference to the existing ones.
Definition: IFileCatalog.h:123
checkRpcDigits.allGood
bool allGood
Loop over the SDOs & Digits.
Definition: checkRpcDigits.py:171
PoolSvc::m_sortReplicas
BooleanProperty m_sortReplicas
Use DBReplicaSvc to sort database connections, default = true.
Definition: PoolSvc.h:261
PoolSvc::m_defaultROOTContainerType
StringProperty m_defaultROOTContainerType
Default ROOT container type.
Definition: PoolSvc.h:263
pool::ITokenIterator
Definition: ITokenIterator.h:20
pool_uuid.guid
guid
Definition: pool_uuid.py:112
PoolSvc::clearState
void clearState()
Definition: PoolSvc.cxx:248
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
PoolSvc::m_catalog
pool::IFileCatalog * m_catalog
Definition: PoolSvc.h:221
PoolSvc::m_contextMaxFile
std::map< unsigned int, unsigned int > m_contextMaxFile
Definition: PoolSvc.h:227
pool::IDatabase
Definition: IDatabase.h:25
pool::READ
@ READ
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:68
PoolSvc::m_readCatalog
StringArrayProperty m_readCatalog
ReadCatalog, the list of additional POOL input file catalogs to consult: default = empty vector.
Definition: PoolSvc.h:241
PoolSvc::m_dbAgeLimit
IntegerProperty m_dbAgeLimit
MaxFilesOpen, option to have PoolSvc limit the number of open Input Files: default = 0 (No files are ...
Definition: PoolSvc.h:236
PoolSvc::m_shareCat
bool m_shareCat
Definition: PoolSvc.h:220
Token::toString
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition: Token.cxx:129
PoolSvc::patchCatalog
void patchCatalog(const std::string &pfn, pool::IDatabase &dbH) const
Definition: PoolSvc.cxx:566
pool::IPersistencySvc
Definition: IPersistencySvc.h:31
pool::ITransaction::commit
virtual bool commit()=0
Commits the transaction.
pool::DatabaseSpecification::PFN
@ PFN
Definition: DatabaseSpecification.h:16
pool::DatabaseConnectionPolicy::CREATE
@ CREATE
Definition: DatabaseConnectionPolicy.h:23
PoolSvc::poolCondPath
std::string poolCondPath(const std::string &leaf)
Resolve a file using ATLAS_POOLCOND_PATH.
Definition: PoolSvc.cxx:1042
pool::ISession::databaseHandle
virtual IDatabase * databaseHandle(const std::string &dbName, DatabaseSpecification::NameType dbNameType)=0
Returns a pointer to a database object. The user acquires ownership of that object.
pool::ITechnologySpecificAttributes::attribute
T attribute(const std::string &attributeName, const std::string &option="")
Templated method to retrieve an attribute.
Definition: ITechnologySpecificAttributes.h:37
pool::IFileCatalog::getFirstPFN
void getFirstPFN(const std::string &fid, std::string &pfn, std::string &tech) const
Get the first PFN + filetype for the given FID.
pool::ICollection::READ
@ READ
Definition: ICollection.h:26
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
python.output.AtlRunQueryRoot.pf
pf
Definition: AtlRunQueryRoot.py:988
python.BackTrackingConfig.numThreads
int numThreads
Definition: BackTrackingConfig.py:61
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
pool::ITransaction::READ
@ READ
Definition: ITransaction.h:29
PoolSvc::m_persistencySvcVec
std::vector< pool::IPersistencySvc * > m_persistencySvcVec
Definition: PoolSvc.h:222
pool::DatabaseConnectionPolicy
Definition: DatabaseConnectionPolicy.h:19
PoolSvc::setupPersistencySvc
StatusCode setupPersistencySvc()
Definition: PoolSvc.cxx:184
pool::IPersistencySvc::session
virtual ISession & session()=0
Returns the underlying global session.
pool::IDatabase::containerHandle
virtual IContainer * containerHandle(const std::string &name)=0
Returns a pointer to a container object. The user acquires ownership of that object.
PoolSvc::m_retrialPeriod
IntegerProperty m_retrialPeriod
ConnectionRetrialPeriod, retry period for CORAL Connection Service: default = 30 seconds.
Definition: PoolSvc.h:250
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
isNumber
bool isNumber(const std::string &s)
Definition: PoolSvc.cxx:52
PoolSvc::createCatalog
pool::IFileCatalog * createCatalog()
Definition: PoolSvc.cxx:952
jobOptions.fileName
fileName
Definition: jobOptions.SuperChic_ALP2.py:39
pool::IPersistencySvc::create
static std::unique_ptr< IPersistencySvc > create(IFileCatalog &catalog)
Factory for PersistencySvc.
python.PyAthena.obj
obj
Definition: PyAthena.py:132
PoolSvc::getInputContext
virtual unsigned int getInputContext(const std::string &label, unsigned int maxFile=0) override
Definition: PoolSvc.cxx:367
PoolSvc::m_connClean
BooleanProperty m_connClean
ConnectionCleanUp - whether to use CORAL connection management thread: default = false.
Definition: PoolSvc.h:256
pool::IFileCatalog::addReadCatalog
void addReadCatalog(const std::string &connect)
Add new catalog identified by name to the existing ones.
Definition: IFileCatalog.h:116
pool::ITransaction::type
virtual Type type() const =0
Returns the transaction type.
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
pool::ICollection
Definition: ICollection.h:23
PoolSvc::m_useROOTIMT
BooleanProperty m_useROOTIMT
Use ROOT Implicit MultiThreading, default = true.
Definition: PoolSvc.h:243
pool::ITransaction::isActive
virtual bool isActive() const =0
Checks if the transaction is active.
ServiceHandle< IIoComponentMgr >
PoolSvc::m_outputContextLabel
std::map< std::string, unsigned int > m_outputContextLabel
Definition: PoolSvc.h:225