ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
pool::IFileCatalog Class Reference

#include <IFileCatalog.h>

Inheritance diagram for pool::IFileCatalog:
Collaboration diagram for pool::IFileCatalog:

Public Types

typedef Gaudi::IFileCatalog::Files Files
 
typedef Gaudi::IFileCatalog::Strings Strings
 
typedef Gaudi::IFileCatalogMgr::Catalogs Catalogs
 

Public Member Functions

 IFileCatalog ()
 
 ~IFileCatalog ()
 
std::string createFID () const
 Create file identifier using UUID mechanism. More...
 
void connect ()
 
void disconnect ()
 
const std::string & connectInfo () const
 Get the connect string. More...
 
void start ()
 redirect to init() for Gaudi FC More...
 
void init ()
 Parse the DOM tree of the XML catalog. More...
 
void commit ()
 Save catalog to file. More...
 
void rollback ()
 Save catalog to file. More...
 
bool readOnly () const
 Check if the catalog is read-only. More...
 
bool dirty () const
 Check if the catalog should be updated. More...
 
void getFIDs (Strings &fids) const
 Get all FIDs. More...
 
void getLFNs (const std::string &fid, Files &files) const
 Get all logical names for a given FID. Return pairs <LFN,FID> More...
 
void getPFNs (const std::string &fid, Files &files) const
 Dump all PFNames of the catalog and their attributes associate to the FileID. More...
 
void getFirstPFN (const std::string &fid, std::string &pfn, std::string &tech) const
 Get the first PFN + filetype for the given FID. More...
 
void lookupFileByPFN (const std::string &pfn, std::string &fid, std::string &tech) const
 Get FID and filetype for a given PFN. More...
 
bool existsPFN (const std::string &pfn) const
 Return the status of a PFName. More...
 
std::string lookupPFN (const std::string &pfn) const
 Lookup file identifier by physical file name. More...
 
void lookupFileByLFN (const std::string &lfn, std::string &fid) const
 Return the status of a LFName. More...
 
std::string lookupLFN (const std::string &lfn) const
 
void deleteFID (const std::string &FileID)
 Return the status of a FileID. More...
 
void deletePFN (const std::string &pfn)
 Delete PFN from the catalog (delete entire FID entry if it was the last PFN) More...
 
void registerPFN (const std::string &pfn, const std::string &ftype, std::string &fid)
 Register PFN, assign new FID if not given. More...
 
void renamePFN (const std::string &pfn, const std::string &newpfn)
 Rename PFN. More...
 
void addReplicaPFN (const std::string &pfn, const std::string &replica_pfn)
 adding replica to an existing PFN More...
 
void addReplicaFID (const std::string &fid, const std::string &replica_pfn, const std::string &replica_tech="ROOT_All")
 adding replica to an existing FID More...
 
void registerLFN (const std::string &fid, const std::string &lfn) const
 Create a Node for a FileID and DOM Node of the LFN with all the attributes. More...
 
void addReadCatalog (const std::string &connect)
 Add new catalog identified by name to the existing ones. More...
 
void addCatalog (const std::string &connect)
 
void removeCatalog (const std::string &connect)
 Add new catalog identified by reference to the existing ones. More...
 
Catalogscatalogs ()
 Remove catalog identified by reference from the existing ones. More...
 
const Catalogscatalogs () const
 Access catalog container (CONST) More...
 
void setWriteCatalog (const std::string &connect)
 Access to the (first) writable file catalog. More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Protected Attributes

SmartIF< Gaudi::IFileCatalogMgr > m_mgr
 
SmartIF< Gaudi::IFileCatalog > m_fc
 

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 23 of file IFileCatalog.h.

Member Typedef Documentation

◆ Catalogs

typedef Gaudi::IFileCatalogMgr::Catalogs pool::IFileCatalog::Catalogs

Definition at line 28 of file IFileCatalog.h.

◆ Files

typedef Gaudi::IFileCatalog::Files pool::IFileCatalog::Files

Definition at line 26 of file IFileCatalog.h.

◆ Strings

typedef Gaudi::IFileCatalog::Strings pool::IFileCatalog::Strings

Definition at line 27 of file IFileCatalog.h.

Constructor & Destructor Documentation

◆ IFileCatalog()

pool::IFileCatalog::IFileCatalog ( )

◆ ~IFileCatalog()

pool::IFileCatalog::~IFileCatalog ( )
inline

Definition at line 32 of file IFileCatalog.h.

32 {}

Member Function Documentation

◆ addCatalog()

void pool::IFileCatalog::addCatalog ( const std::string &  connect)

◆ addReadCatalog()

void pool::IFileCatalog::addReadCatalog ( const std::string &  connect)
inline

Add new catalog identified by name to the existing ones.

Definition at line 116 of file IFileCatalog.h.

116 { addCatalog(connect); }

◆ addReplicaFID()

void pool::IFileCatalog::addReplicaFID ( const std::string &  fid,
const std::string &  replica_pfn,
const std::string &  replica_tech = "ROOT_All" 
)

adding replica to an existing FID

◆ addReplicaPFN()

void pool::IFileCatalog::addReplicaPFN ( const std::string &  pfn,
const std::string &  replica_pfn 
)

adding replica to an existing PFN

◆ catalogs() [1/2]

Catalogs& pool::IFileCatalog::catalogs ( )
inline

Remove catalog identified by reference from the existing ones.

Access catalog container

Definition at line 128 of file IFileCatalog.h.

128 { return m_mgr->catalogs(); }

◆ catalogs() [2/2]

const Catalogs& pool::IFileCatalog::catalogs ( ) const
inline

Access catalog container (CONST)

Definition at line 130 of file IFileCatalog.h.

130 { return m_mgr->catalogs(); }

◆ commit()

void pool::IFileCatalog::commit ( )
inline

Save catalog to file.

Definition at line 49 of file IFileCatalog.h.

49 { m_fc->commit(); }

◆ connect()

void pool::IFileCatalog::connect ( )
inline

Definition at line 39 of file IFileCatalog.h.

39 { /* not doing anything in Gaudi FC */ }

◆ connectInfo()

const std::string& pool::IFileCatalog::connectInfo ( ) const
inline

Get the connect string.

Definition at line 42 of file IFileCatalog.h.

42 { return m_fc->connectInfo(); }

◆ createFID()

std::string pool::IFileCatalog::createFID ( ) const

Create file identifier using UUID mechanism.

◆ deleteFID()

void pool::IFileCatalog::deleteFID ( const std::string &  FileID)
inline

Return the status of a FileID.

Delete FileID Node from the catalog

Definition at line 89 of file IFileCatalog.h.

89 { m_fc->deleteFID(FileID); }

◆ deletePFN()

void pool::IFileCatalog::deletePFN ( const std::string &  pfn)
inline

Delete PFN from the catalog (delete entire FID entry if it was the last PFN)

Definition at line 92 of file IFileCatalog.h.

92 { m_fc->deletePFN(pfn); }

◆ dirty()

bool pool::IFileCatalog::dirty ( ) const
inline

Check if the catalog should be updated.

Definition at line 55 of file IFileCatalog.h.

55 { return m_fc->dirty(); }

◆ disconnect()

void pool::IFileCatalog::disconnect ( )
inline

Definition at line 40 of file IFileCatalog.h.

40 { /* not doing anything in Gaudi FC */ }

◆ existsPFN()

bool pool::IFileCatalog::existsPFN ( const std::string &  pfn) const
inline

Return the status of a PFName.

Definition at line 73 of file IFileCatalog.h.

73 { return m_fc->existsPFN(pfn); }

◆ getFIDs()

void pool::IFileCatalog::getFIDs ( Strings fids) const
inline

Get all FIDs.

Definition at line 58 of file IFileCatalog.h.

58 { m_fc->getFID(fids); }

◆ getFirstPFN()

void pool::IFileCatalog::getFirstPFN ( const std::string &  fid,
std::string &  pfn,
std::string &  tech 
) const

Get the first PFN + filetype for the given FID.

◆ getLFNs()

void pool::IFileCatalog::getLFNs ( const std::string &  fid,
Files files 
) const
inline

Get all logical names for a given FID. Return pairs <LFN,FID>

Definition at line 61 of file IFileCatalog.h.

61 { m_fc->getLFN(fid, files); }

◆ getPFNs()

void pool::IFileCatalog::getPFNs ( const std::string &  fid,
Files files 
) const
inline

Dump all PFNames of the catalog and their attributes associate to the FileID.

Definition at line 64 of file IFileCatalog.h.

64 { m_fc->getPFN(fid, files); }

◆ init()

void pool::IFileCatalog::init ( )
inline

Parse the DOM tree of the XML catalog.

Definition at line 47 of file IFileCatalog.h.

47 { m_fc->init(); }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ lookupFileByLFN()

void pool::IFileCatalog::lookupFileByLFN ( const std::string &  lfn,
std::string &  fid 
) const
inline

Return the status of a LFName.

Lookup file identified by logical file name

Definition at line 82 of file IFileCatalog.h.

82 { fid = lookupLFN(lfn); }

◆ lookupFileByPFN()

void pool::IFileCatalog::lookupFileByPFN ( const std::string &  pfn,
std::string &  fid,
std::string &  tech 
) const

Get FID and filetype for a given PFN.

◆ lookupLFN()

std::string pool::IFileCatalog::lookupLFN ( const std::string &  lfn) const
inline

Definition at line 83 of file IFileCatalog.h.

83 { return m_fc->lookupLFN(lfn); }

◆ lookupPFN()

std::string pool::IFileCatalog::lookupPFN ( const std::string &  pfn) const
inline

Lookup file identifier by physical file name.

Definition at line 76 of file IFileCatalog.h.

76 { return m_fc->lookupPFN(pfn); }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ readOnly()

bool pool::IFileCatalog::readOnly ( ) const
inline

Check if the catalog is read-only.

Definition at line 53 of file IFileCatalog.h.

53 { return m_fc->readOnly(); }

◆ registerLFN()

void pool::IFileCatalog::registerLFN ( const std::string &  fid,
const std::string &  lfn 
) const
inline

Create a Node for a FileID and DOM Node of the LFN with all the attributes.

Definition at line 110 of file IFileCatalog.h.

110 { m_fc->registerLFN(fid, lfn ); }

◆ registerPFN()

void pool::IFileCatalog::registerPFN ( const std::string &  pfn,
const std::string &  ftype,
std::string &  fid 
)

Register PFN, assign new FID if not given.

◆ removeCatalog()

void pool::IFileCatalog::removeCatalog ( const std::string &  connect)
inline

Add new catalog identified by reference to the existing ones.

Remove catalog identified by name from the existing ones. * or '' removes all

Definition at line 123 of file IFileCatalog.h.

123 { m_mgr->removeCatalog(connect); }

◆ renamePFN()

void pool::IFileCatalog::renamePFN ( const std::string &  pfn,
const std::string &  newpfn 
)
inline

Rename PFN.

Definition at line 98 of file IFileCatalog.h.

98 { m_fc->renamePFN(pfn, newpfn); }

◆ rollback()

void pool::IFileCatalog::rollback ( )
inline

Save catalog to file.

Definition at line 51 of file IFileCatalog.h.

51 { m_fc->rollback(); }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ setWriteCatalog()

void pool::IFileCatalog::setWriteCatalog ( const std::string &  connect)

Access to the (first) writable file catalog.

Define the writable catalog identified by reference Define the writable catalog identified by name

◆ start()

void pool::IFileCatalog::start ( )
inline

redirect to init() for Gaudi FC

Definition at line 45 of file IFileCatalog.h.

45 { init(); }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_fc

SmartIF<Gaudi::IFileCatalog> pool::IFileCatalog::m_fc
protected

Definition at line 141 of file IFileCatalog.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_mgr

SmartIF<Gaudi::IFileCatalogMgr> pool::IFileCatalog::m_mgr
protected

Definition at line 140 of file IFileCatalog.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following file:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
pool::IFileCatalog::m_mgr
SmartIF< Gaudi::IFileCatalogMgr > m_mgr
Definition: IFileCatalog.h:140
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
rerun_display.lfn
lfn
Definition: rerun_display.py:60
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
pool::IFileCatalog::m_fc
SmartIF< Gaudi::IFileCatalog > m_fc
Definition: IFileCatalog.h:141
generateReferenceFile.files
files
Definition: generateReferenceFile.py:12
pool::IFileCatalog::lookupLFN
std::string lookupLFN(const std::string &lfn) const
Definition: IFileCatalog.h:83
pool::IFileCatalog::connect
void connect()
Definition: IFileCatalog.h:39
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
pool::FileID
std::string FileID
Definition: FileDescriptor.h:27
pool::IFileCatalog::addCatalog
void addCatalog(const std::string &connect)
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
pool::IFileCatalog::init
void init()
Parse the DOM tree of the XML catalog.
Definition: IFileCatalog.h:47
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132