| The Gaudi Framework v32r1 (f65d50dc)

IODataManager.h
Go to the documentation of this file.
1 #ifndef GAUDIUTILS_IODATAMANAGER_H
2 #define GAUDIUTILS_IODATAMANAGER_H
3
4 // C++ include files
5 #include <map>
6 // Framework include files
7 #include "GaudiKernel/Service.h"
8 #include "GaudiUtils/IIODataManager.h"
9
10 class IIncidentSvc;
11
12 /*
13 * LHCb namespace declaration
14 */
15 namespace Gaudi {
16
17 // Forward declarations
18 class IFileCatalog;
19 class RawDataConnectionEntry;
20
29 class IODataManager : public extends<Service, IIODataManager> {
30 protected:
31 typedef const std::string& CSTR;
32 struct Entry final {
33 std::string type;
34 IoType ioType;
35 IDataConnection* connection;
36 bool keepOpen;
37 Entry( CSTR tech, bool k, IoType iot, IDataConnection* con )
38 : type( tech ), ioType( iot ), connection( con ), keepOpen( k ) {}
39 };
40 typedef std::map<std::string, Entry*> ConnectionMap;
41 typedef std::map<std::string, std::string> FidMap;
42
43 Gaudi::Property<std::string> m_catalogSvcName{this, "CatalogType", "Gaudi::MultiFileCatalog/FileCatalog",
44 "name of the file catalog service"};
45 Gaudi::Property<bool> m_useGFAL{this, "UseGFAL", true, "flag for auto gfal data access"};
46 Gaudi::Property<bool> m_quarantine{this, "QuarantineFiles", true,
47 "if unaccessible files should be quarantines in job"};
48 Gaudi::Property<int> m_ageLimit{this, "AgeLimit", 2, "age limit"};
49 Gaudi::Property<bool> m_disablePFNWarning{
50 this, "DisablePFNWarning", false,
51 "if set to True, we will not report when a file is opened by its physical name"};
52
54 ConnectionMap m_connectionMap;
56 SmartIF<IFileCatalog> m_catalog;
58 FidMap m_fidMap;
59 StatusCode connectDataIO( int typ, IoType rw, CSTR fn, CSTR technology, bool keep, Connection* con );
60 StatusCode reconnect( Entry* e );
61 StatusCode error( CSTR msg, bool rethrow );
62 StatusCode establishConnection( Connection* con );
63
64 SmartIF<IIncidentSvc> m_incSvc;
65
66 public:
68 using extends::extends;
69
71 StatusCode initialize() override;
72
74 StatusCode finalize() override;
75
77 StatusCode connectRead( bool keep_open, Connection* ioDesc ) override;
79 StatusCode connectWrite( Connection* con, IoType mode = Connection::CREATE, CSTR doctype = "UNKNOWN" ) override;
81 StatusCode disconnect( Connection* ioDesc ) override;
83 Connection* connection( const std::string& dsn ) const override;
85 Connections connections( const IInterface* owner ) const override;
87 StatusCode read( Connection* ioDesc, void* const data, size_t len ) override;
89 StatusCode write( Connection* con, const void* data, int len ) override;
91 long long int seek( Connection* ioDesc, long long int where, int origin ) override;
92 };
93 } // End namespace Gaudi
94 #endif // GAUDIUTILS_IODATAMANAGER_H
Gaudi::IODataManager::finalize
StatusCode finalize() override
IService implementation: finalize the service.
Definition: IODataManager.cpp:65
Gaudi::IODataManager::m_ageLimit
Gaudi::Property< int > m_ageLimit
Definition: IODataManager.h:48
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:15
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
Gaudi::IODataManager::disconnect
StatusCode disconnect(Connection *ioDesc) override
Release data stream.
Definition: IODataManager.cpp:119
Gaudi::IODataManager::m_catalogSvcName
Gaudi::Property< std::string > m_catalogSvcName
Definition: IODataManager.h:43
Gaudi::IODataManager::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
Definition: IODataManager.h:64
Gaudi::IODataManager::Entry::Entry
Entry(CSTR tech, bool k, IoType iot, IDataConnection *con)
Definition: IODataManager.h:37
Gaudi::IODataManager::establishConnection
StatusCode establishConnection(Connection *con)
Definition: IODataManager.cpp:200
std::map< std::string, Entry * >
Gaudi::IODataManager::read
StatusCode read(Connection *ioDesc, void *const data, size_t len) override
Read raw byte buffer from input stream.
Definition: IODataManager.cpp:105
IIODataManager.h
std::string
STL class.
Gaudi::IODataManager::FidMap
std::map< std::string, std::string > FidMap
Definition: IODataManager.h:41
Gaudi::IODataManager::connection
Connection * connection(const std::string &dsn) const override
Retrieve known connection.
Definition: IODataManager.cpp:193
Service.h
Gaudi::IODataManager::m_quarantine
Gaudi::Property< bool > m_quarantine
Definition: IODataManager.h:46
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
Gaudi::IODataManager::initialize
StatusCode initialize() override
IService implementation: initialize the service.
Definition: IODataManager.cpp:42
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Gaudi::IODataManager::m_catalog
SmartIF< IFileCatalog > m_catalog
Reference to file catalog.
Definition: IODataManager.h:56
Gaudi::IODataManager
Definition: IODataManager.h:29
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
Gaudi::IODataManager::write
StatusCode write(Connection *con, const void *data, int len) override
Write raw byte buffer to output stream.
Definition: IODataManager.cpp:110
Gaudi::IODataManager::Entry
Definition: IODataManager.h:32
Gaudi::IODataManager::m_useGFAL
Gaudi::Property< bool > m_useGFAL
Definition: IODataManager.h:45
Gaudi::IODataManager::connectWrite
StatusCode connectWrite(Connection *con, IoType mode=Connection::CREATE, CSTR doctype="UNKNOWN") override
Open data stream in write mode.
Definition: IODataManager.cpp:98
Gaudi::IODataManager::Entry::type
std::string type
Definition: IODataManager.h:33
Gaudi::IODataManager::ConnectionMap
std::map< std::string, Entry * > ConnectionMap
Definition: IODataManager.h:40
Gaudi::IDataConnection
ABC describing basic data connection.
Definition: IIODataManager.h:24
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:113
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Io::CREATE
Definition: IFileMgr.h:31
Gaudi::IODataManager::m_connectionMap
ConnectionMap m_connectionMap
Map with I/O descriptors.
Definition: IODataManager.h:54
Gaudi::IODataManager::Entry::connection
IDataConnection * connection
Definition: IODataManager.h:35
Gaudi::IODataManager::CSTR
const std::string & CSTR
Definition: IODataManager.h:31
Gaudi::IODataManager::m_disablePFNWarning
Gaudi::Property< bool > m_disablePFNWarning
Definition: IODataManager.h:49
Gaudi::IODataManager::connectDataIO
StatusCode connectDataIO(int typ, IoType rw, CSTR fn, CSTR technology, bool keep, Connection *con)
Definition: IODataManager.cpp:219
Gaudi::IODataManager::connectRead
StatusCode connectRead(bool keep_open, Connection *ioDesc) override
Open data stream in read mode.
Definition: IODataManager.cpp:89
Gaudi::IODataManager::Entry::keepOpen
bool keepOpen
Definition: IODataManager.h:36
Gaudi::IODataManager::connections
Connections connections(const IInterface *owner) const override
Get connection by owner instance (0=ALL)
Definition: IODataManager.cpp:79
Gaudi::IODataManager::seek
long long int seek(Connection *ioDesc, long long int where, int origin) override
Seek on the file described by ioDesc. Arguments as in ::seek()
Definition: IODataManager.cpp:115
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
Gaudi::IODataManager::reconnect
StatusCode reconnect(Entry *e)
Definition: IODataManager.cpp:156
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
Gaudi::IODataManager::Entry::ioType
IoType ioType
Definition: IODataManager.h:34
Gaudi::IODataManager::m_fidMap
FidMap m_fidMap
Map of FID to PFN.
Definition: IODataManager.h:58