ATLAS Offline Software
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...
 

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 983 of file PoolSvc.cxx.

983  {
984 }

Member Function Documentation

◆ catalog()

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

Definition at line 399 of file PoolSvc.cxx.

399  {
400  return(m_catalog);
401 }

◆ clearState()

void PoolSvc::clearState ( )
private

Definition at line 243 of file PoolSvc.cxx.

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

◆ 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 621 of file PoolSvc.cxx.

621  {
622  if (contextId >= m_persistencySvcVec.size()) {
623  return(StatusCode::FAILURE);
624  }
625  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
626  pool::IPersistencySvc* persSvc = m_persistencySvcVec[contextId];
627  if (persSvc != nullptr && persSvc->session().transaction().isActive()) {
628  if (!persSvc->session().transaction().commit()) {
629  ATH_MSG_ERROR("POOL commit failed " << persSvc);
630  return(StatusCode::FAILURE);
631  }
632  if (persSvc->session().transaction().type() == pool::ITransaction::READ) {
633  persSvc->session().disconnectAll();
634  }
635  }
636  return(StatusCode::SUCCESS);
637 }

◆ 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 639 of file PoolSvc.cxx.

639  {
640  if (contextId >= m_persistencySvcVec.size()) {
641  return(StatusCode::FAILURE);
642  }
643  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
644  pool::IPersistencySvc* persSvc = m_persistencySvcVec[contextId];
645  if (persSvc != nullptr && persSvc->session().transaction().isActive()) {
646  if (!persSvc->session().transaction().commitAndHold()) {
647  ATH_MSG_ERROR("POOL commitAndHold failed " << persSvc);
648  return(StatusCode::FAILURE);
649  }
650  }
651  return(StatusCode::SUCCESS);
652 }

◆ 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 589 of file PoolSvc.cxx.

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

◆ context()

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

Definition at line 387 of file PoolSvc.cxx.

387  {
388  return(m_context);
389 }

◆ createCatalog()

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

Definition at line 943 of file PoolSvc.cxx.

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

◆ 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 436 of file PoolSvc.cxx.

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

◆ 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 654 of file PoolSvc.cxx.

654  {
655  ATH_MSG_DEBUG("Disconnect request for contextId=" << contextId);
656  if (contextId >= m_persistencySvcVec.size()) {
657  return(StatusCode::SUCCESS);
658  }
659  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
660  pool::IPersistencySvc* persSvc = m_persistencySvcVec[contextId];
661  if (persSvc != nullptr && persSvc->session().transaction().isActive()) {
662  if (!commit(contextId).isSuccess()) {
663  ATH_MSG_ERROR("disconnect failed to commit " << persSvc);
664  return(StatusCode::FAILURE);
665  }
666  if (persSvc->session().disconnectAll()) {
667  ATH_MSG_DEBUG("Disconnected PersistencySvc session");
668  } else {
669  ATH_MSG_ERROR("disconnect failed to diconnect PersistencySvc");
670  return(StatusCode::FAILURE);
671  }
672  }
673  return(StatusCode::SUCCESS);
674 }

◆ 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 676 of file PoolSvc.cxx.

676  {
677  if (contextId >= m_persistencySvcVec.size()) {
678  return(StatusCode::SUCCESS);
679  }
680  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
681  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, connection);
682  if (dbH == nullptr) {
683  ATH_MSG_ERROR("Failed to get Session/DatabaseHandle.");
684  return(StatusCode::FAILURE);
685  }
686  std::map<unsigned int, unsigned int>::const_iterator maxFileIter = m_contextMaxFile.find(contextId);
687  if (maxFileIter != m_contextMaxFile.end() && maxFileIter->second > 0) {
688  m_guidLists[contextId].remove(Guid(dbH->fid()));
689  }
690  dbH->disconnect();
691  return(StatusCode::SUCCESS);
692 }

◆ finalize()

StatusCode PoolSvc::finalize ( )
overridevirtual

Required of all Gaudi services:

Definition at line 262 of file PoolSvc.cxx.

262  {
263  clearState();
264  return(::AthService::finalize());
265 }

◆ 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 735 of file PoolSvc.cxx.

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

◆ 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 712 of file PoolSvc.cxx.

715  {
716  if (contextId >= m_persistencySvcVec.size()) {
717  ATH_MSG_WARNING("getAttribute: Using default input Stream instead of id = " << contextId);
718  contextId = IPoolSvc::kInputStream;
719  }
720  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
721  pool::ISession& sesH = m_persistencySvcVec[contextId]->session();
722  std::ostringstream oss;
723  if (data == "DbLonglong") {
724  oss << std::dec << sesH.technologySpecificAttributes(tech).attribute<long long int>(optName);
725  } else if (data == "double") {
726  oss << std::dec << sesH.technologySpecificAttributes(tech).attribute<double>(optName);
727  } else {
728  oss << std::dec << sesH.technologySpecificAttributes(tech).attribute<int>(optName);
729  }
730  data = oss.str();
731  ATH_MSG_INFO("Domain attribute [" << optName << "]" << ": " << data);
732  return(StatusCode::SUCCESS);
733 }

◆ getContainerHandle()

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

Get Container handle.

Definition at line 1016 of file PoolSvc.cxx.

1016  {
1017  pool::IContainer* contH = nullptr;
1018  if (dbH == nullptr) {
1019  ATH_MSG_DEBUG("No DatabaseHandle to get Container.");
1020  return(nullptr);
1021  }
1022  if (dbH->openMode() == pool::IDatabase::CLOSED) {
1023  dbH->connectForRead();
1024  }
1025  if (contName.find("DataHeader") != std::string::npos) {
1026  contH = dbH->containerHandle(contName.substr(0, contName.find("_p")));
1027  } else {
1028  contH = dbH->containerHandle(contName);
1029  }
1030  return(std::unique_ptr<pool::IContainer>(contH));
1031 }

◆ getDbHandle()

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

Get Database handle.

Definition at line 986 of file PoolSvc.cxx.

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

◆ 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 694 of file PoolSvc.cxx.

694  {
695  ContextLock lock(contextId, m_pool_mut, m_pers_mut);
696  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(contextId, dbName);
697  if (dbH == nullptr) {
698  ATH_MSG_DEBUG("getFileSize: Failed to get Session/DatabaseHandle to get POOL FileSize property.");
699  return 0; // failure
700  }
701  if (dbH->openMode() == pool::IDatabase::CLOSED) {
702  if (m_persistencySvcVec[contextId]->session().defaultConnectionPolicy().writeModeForNonExisting() != pool::DatabaseConnectionPolicy::RAISE_ERROR) {
703  dbH->setTechnology(tech);
704  dbH->connectForWrite();
705  } else {
706  dbH->connectForRead();
707  }
708  }
709  return(dbH->technologySpecificAttributes().attribute<long long int>("FILE_SIZE"));
710 }

◆ 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 358 of file PoolSvc.cxx.

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

◆ getInputContextMap()

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

Definition at line 383 of file PoolSvc.cxx.

383  {
384  return(m_inputContextLabel);
385 }

◆ 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 331 of file PoolSvc.cxx.

331  {
332  std::lock_guard<CallMutex> lock(m_pool_mut);
333  if (m_mainOutputLabel.empty()) {
335  m_outputContextLabel.insert(std::pair<std::string, unsigned int>(label, IPoolSvc::kOutputStream));
336  }
337  if (label == m_mainOutputLabel || label.empty()) {
338  return(IPoolSvc::kOutputStream);
339  }
340  std::map<std::string, unsigned int>::const_iterator contextIter = m_outputContextLabel.find(label);
341  if (contextIter != m_outputContextLabel.end()) {
342  return(contextIter->second);
343  }
344  const unsigned int id = m_persistencySvcVec.size();
345  m_persistencySvcVec.push_back(pool::IPersistencySvc::create(*m_catalog).release());
346  m_pers_mut.push_back(new CallMutex);
350  if (m_fileOpen.value() == "update") {
352  }
353  m_persistencySvcVec[id]->session().setDefaultConnectionPolicy(policy);
354  m_outputContextLabel.insert(std::pair<std::string, unsigned int>(label, id));
355  return(id);
356 }

◆ 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 565 of file PoolSvc.cxx.

567  {
568  std::lock_guard<CallMutex> lock(*m_pers_mut[IPoolSvc::kInputStream]);
569  std::unique_ptr<pool::IDatabase> dbH = getDbHandle(IPoolSvc::kInputStream, connection);
570  if (dbH == nullptr) {
571  return(nullptr);
572  }
573  if (dbH->openMode() == pool::IDatabase::CLOSED) {
574  dbH->connectForRead();
575  }
576  std::unique_ptr<pool::IContainer> contH = getContainerHandle(dbH.get(), collection);
577  if (contH == nullptr) {
578  return(nullptr);
579  }
580  pool::ITokenIterator* tokenIter = contH->tokens("");
581  Token* thisToken = tokenIter->next();
582  for (unsigned long ipos = 0; ipos < ientry; ipos++) {
583  delete thisToken; thisToken = tokenIter->next();
584  }
585  delete tokenIter; tokenIter = nullptr;
586  return(thisToken);
587 }

◆ 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 267 of file PoolSvc.cxx.

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

◆ 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 391 of file PoolSvc.cxx.

391  {
392  m_context->loadComponent(compName);
393 }

◆ 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 403 of file PoolSvc.cxx.

403  {
404  std::string dbID;
405  if (token.compare(0, 4, "PFN:") == 0) {
406  m_catalog->lookupFileByPFN(token.substr(4), dbID, type); // PFN -> FID
407  } else if (token.compare(0, 4, "LFN:") == 0) {
408  m_catalog->lookupFileByLFN(token.substr(4), dbID); // LFN -> FID
409  } else if (token.compare(0, 4, "FID:") == 0) {
410  dbID = token.substr(4);
411  } else if (token.size() > Guid::null().toString().size()) { // full token
412  Token tok;
413  tok.fromString(token);
414  dbID = tok.dbID().toString();
415  } else { // guid only
416  dbID = token;
417  }
418  m_catalog->getFirstPFN(dbID, pfn, type); // FID -> best PFN
419 }

◆ patchCatalog()

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

Definition at line 557 of file PoolSvc.cxx.

557  {
558  std::scoped_lock lock(m_pool_mut);
559  dbH.setTechnology(pool::ROOT_StorageType.type());
560  std::string fid = dbH.fid();
562  catalog_locked->registerPFN(pfn, "ROOT_All", fid);
563 }

◆ poolCondPath()

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

Resolve a file using ATLAS_POOLCOND_PATH.

Definition at line 1033 of file PoolSvc.cxx.

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

◆ 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 279 of file PoolSvc.cxx.

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

◆ 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 421 of file PoolSvc.cxx.

421  {
422  std::string dbID, type;
423  m_catalog->lookupFileByPFN(pf, dbID, type);
424  if (dbID.empty()) {
425  ATH_MSG_WARNING("Failed to lookup: " << pf << " in FileCatalog");
426  return;
427  }
428  m_catalog->lookupFileByPFN(newpf, dbID, type);
429  if (!dbID.empty()) {
430  ATH_MSG_INFO("Found: " << newpf << " in FileCatalog");
431  return;
432  }
433  m_catalog->renamePFN(pf, newpf);
434 }

◆ 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 810 of file PoolSvc.cxx.

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

◆ 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 786 of file PoolSvc.cxx.

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

◆ setFrontierCache()

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

Setup Frontier cache for given logical or physical connection name.

Definition at line 882 of file PoolSvc.cxx.

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

◆ 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 303 of file PoolSvc.cxx.

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

◆ setShareMode()

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

Definition at line 395 of file PoolSvc.cxx.

395  {
396  m_shareCat = shareCat;
397 }

◆ 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  return(StatusCode::SUCCESS);
216 }

◆ start()

StatusCode PoolSvc::start ( )
overridevirtual

Required of all Gaudi services:

Definition at line 218 of file PoolSvc.cxx.

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

◆ stop()

StatusCode PoolSvc::stop ( )
overridevirtual

Definition at line 230 of file PoolSvc.cxx.

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

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_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:986
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:589
PoolSvc::commit
virtual StatusCode commit(unsigned int contextId=IPoolSvc::kInputStream) const override
Commit data for a given contextId and flush buffer.
Definition: PoolSvc.cxx:621
PoolSvc::m_attemptCatalogPatch
BooleanProperty m_attemptCatalogPatch
AttemptCatalogPatch, option to create catalog: default = false.
Definition: PoolSvc.h:248
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
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:89
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
PoolSvc::catalog
virtual const pool::IFileCatalog * catalog() const override
Definition: PoolSvc.cxx:399
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:654
Token::dbID
const Guid & dbID() const
Access database identifier.
Definition: Token.h:62
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:786
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.
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:133
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
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
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:331
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:1016
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:29
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
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:676
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
pool::ITokenIterator
Definition: ITokenIterator.h:20
pool_uuid.guid
guid
Definition: pool_uuid.py:112
PoolSvc::clearState
void clearState()
Definition: PoolSvc.cxx:243
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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:114
PoolSvc::patchCatalog
void patchCatalog(const std::string &pfn, pool::IDatabase &dbH) const
Definition: PoolSvc.cxx:557
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:1033
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:27
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:943
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:358
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:24
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