CMS 3D CMS Logo

IDbSchema.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_IDbSchema_h
2 #define CondCore_CondDB_IDbSchema_h
3 
4 //
5 #include <boost/date_time/posix_time/posix_time.hpp>
6 
10 
11 namespace cond {
12 
13  namespace persistency {
14 
15  class ITagTable {
16  public:
17  virtual ~ITagTable() {}
18  virtual bool exists() = 0;
19  virtual void create() = 0;
20  virtual bool select(const std::string& name) = 0;
21  virtual bool select(const std::string& name,
22  cond::TimeType& timeType,
23  std::string& objectType,
24  cond::SynchronizationType& synchronizationType,
25  cond::Time_t& endOfValidity,
26  cond::Time_t& lastValidatedTime,
27  int& protectionCode) = 0;
28  virtual bool getMetadata(const std::string& name,
30  boost::posix_time::ptime& insertionTime,
31  boost::posix_time::ptime& modificationTime) = 0;
32  virtual void insert(const std::string& name,
33  cond::TimeType timeType,
34  const std::string& objectType,
35  cond::SynchronizationType synchronizationType,
36  cond::Time_t endOfValidity,
37  const std::string& description,
38  cond::Time_t lastValidatedTime,
39  const boost::posix_time::ptime& insertionTime) = 0;
40  virtual void update(const std::string& name,
41  cond::SynchronizationType synchronizationType,
42  cond::Time_t& endOfValidity,
43  cond::Time_t lastValidatedTime,
44  const boost::posix_time::ptime& updateTime) = 0;
45  virtual void updateMetadata(const std::string& name,
46  const std::string& description,
47  const boost::posix_time::ptime& updateTime) = 0;
48  virtual void updateValidity(const std::string& name,
49  cond::Time_t lastValidatedTime,
50  const boost::posix_time::ptime& updateTime) = 0;
51  virtual void setProtectionCode(const std::string& name, int code) = 0;
52  virtual void unsetProtectionCode(const std::string& name, int code) = 0;
53  };
54 
55  class IPayloadTable {
56  public:
57  virtual ~IPayloadTable() {}
58  virtual bool exists() = 0;
59  virtual void create() = 0;
60  virtual bool select(const cond::Hash& payloadHash,
61  std::string& objectType,
62  cond::Binary& payloadData,
63  cond::Binary& streamerInfoData) = 0;
64  virtual bool getType(const cond::Hash& payloadHash, std::string& objectType) = 0;
65  virtual cond::Hash insertIfNew(const std::string& objectType,
66  const cond::Binary& payloadData,
67  const cond::Binary& streamerInfoData,
68  const boost::posix_time::ptime& insertionTime) = 0;
69  };
70 
71  class IIOVTable {
72  public:
73  virtual ~IIOVTable() {}
74  virtual bool exists() = 0;
75  virtual void create() = 0;
76  virtual size_t getGroups(const std::string& tag,
77  const boost::posix_time::ptime& snapshotTime,
78  unsigned long long groupSize,
79  std::vector<cond::Time_t>& groups) = 0;
80  virtual size_t select(const std::string& tag,
81  cond::Time_t lowerGroup,
82  cond::Time_t upperGroup,
83  const boost::posix_time::ptime& snapshotTime,
84  std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
85  virtual bool getLastIov(const std::string& tag,
86  const boost::posix_time::ptime& snapshotTime,
88  cond::Hash& hash) = 0;
89  virtual bool getSize(const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size) = 0;
90  virtual bool getRange(const std::string& tag,
91  cond::Time_t begin,
93  const boost::posix_time::ptime& snapshotTime,
94  std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
95  virtual void insertOne(const std::string& tag,
97  cond::Hash payloadHash,
98  const boost::posix_time::ptime& insertTime) = 0;
99  virtual void insertMany(
100  const std::string& tag,
101  const std::vector<std::tuple<cond::Time_t, cond::Hash, boost::posix_time::ptime> >& iovs) = 0;
102  virtual void eraseOne(const std::string& tag, cond::Time_t since, cond::Hash payloadId) = 0;
103  virtual void eraseMany(const std::string& tag,
104  const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
105  virtual void erase(const std::string& tag) = 0;
106  };
107 
109  public:
111  virtual bool exists() = 0;
112  virtual void create() = 0;
113  virtual bool getAccessPermission(const std::string& tagName,
114  const std::string& credential,
115  int credentialType,
116  int accessType) = 0;
117  virtual void setAccessPermission(const std::string& tagName,
118  const std::string& credential,
119  int credentialType,
120  int accessType) = 0;
121  virtual void removeAccessPermission(const std::string& tagName,
122  const std::string& credential,
123  int credentialType) = 0;
124  virtual void removeEntriesForCredential(const std::string& credential, int credentialType) = 0;
125  };
126 
127  class ITagLogTable {
128  public:
129  virtual ~ITagLogTable() {}
130  virtual bool exists() = 0;
131  virtual void create() = 0;
132  virtual void insert(const std::string& tag,
133  const boost::posix_time::ptime& eventTime,
134  const std::string& userName,
135  const std::string& hostName,
136  const std::string& command,
137  const std::string& action,
138  const std::string& userText) = 0;
139  };
140 
141  class IIOVSchema {
142  public:
143  virtual ~IIOVSchema() {}
144  virtual bool exists() = 0;
145  virtual bool create() = 0;
146  virtual ITagTable& tagTable() = 0;
147  virtual IIOVTable& iovTable() = 0;
148  virtual IPayloadTable& payloadTable() = 0;
149  virtual ITagLogTable& tagLogTable() = 0;
151  };
152 
153  class IGTTable {
154  public:
155  virtual ~IGTTable() {}
156  virtual bool exists() = 0;
157  virtual void create() = 0;
158  virtual bool select(const std::string& name) = 0;
159  virtual bool select(const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime) = 0;
160  virtual bool select(const std::string& name,
161  cond::Time_t& validity,
164  boost::posix_time::ptime& snapshotTime) = 0;
165  virtual void insert(const std::string& name,
166  cond::Time_t validity,
167  const std::string& description,
168  const std::string& release,
169  const boost::posix_time::ptime& snapshotTime,
170  const boost::posix_time::ptime& insertionTime) = 0;
171  virtual void update(const std::string& name,
172  cond::Time_t validity,
173  const std::string& description,
174  const std::string& release,
175  const boost::posix_time::ptime& snapshotTime,
176  const boost::posix_time::ptime& insertionTime) = 0;
177  };
178 
179  class IGTMapTable {
180  public:
181  virtual ~IGTMapTable() {}
182  virtual bool exists() = 0;
183  virtual void create() = 0;
184  virtual bool select(const std::string& gtName,
185  std::vector<std::tuple<std::string, std::string, std::string> >& tags) = 0;
186  virtual bool select(const std::string& gtName,
187  const std::string& preFix,
188  const std::string& postFix,
189  std::vector<std::tuple<std::string, std::string, std::string> >& tags) = 0;
190  virtual void insert(const std::string& gtName,
191  const std::vector<std::tuple<std::string, std::string, std::string> >& tags) = 0;
192  };
193 
194  class IGTSchema {
195  public:
196  virtual ~IGTSchema() {}
197  virtual bool exists() = 0;
198  virtual void create() = 0;
199  virtual IGTTable& gtTable() = 0;
200  virtual IGTMapTable& gtMapTable() = 0;
201  };
202 
204  public:
205  virtual ~IRunInfoTable() {}
206  virtual bool exists() = 0;
207  virtual void create() = 0;
208  virtual bool select(cond::Time_t runNumber, boost::posix_time::ptime& start, boost::posix_time::ptime& end) = 0;
209  virtual cond::Time_t getLastInserted(boost::posix_time::ptime& start, boost::posix_time::ptime& end) = 0;
210  virtual bool getInclusiveRunRange(
211  cond::Time_t lower,
213  std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData) = 0;
214  virtual bool getInclusiveTimeRange(
215  const boost::posix_time::ptime& lower,
216  const boost::posix_time::ptime& upper,
217  std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData) = 0;
218  virtual void insertOne(cond::Time_t runNumber,
219  const boost::posix_time::ptime& start,
220  const boost::posix_time::ptime& end) = 0;
221  virtual void insert(
222  const std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runs) = 0;
223  virtual void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime& end) = 0;
224  };
225 
227  public:
228  virtual ~IRunInfoSchema() {}
229  virtual bool exists() = 0;
230  virtual bool create() = 0;
231  virtual IRunInfoTable& runInfoTable() = 0;
232  };
233 
234  } // namespace persistency
235 } // namespace cond
236 #endif
cond::persistency::IGTSchema::gtTable
virtual IGTTable & gtTable()=0
cond::persistency::IGTTable
Definition: IDbSchema.h:153
cond::persistency::IIOVTable::select
virtual size_t select(const std::string &tag, cond::Time_t lowerGroup, cond::Time_t upperGroup, const boost::posix_time::ptime &snapshotTime, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
start
Definition: start.py:1
cond::persistency::IPayloadTable::create
virtual void create()=0
cond::persistency::ITagTable::getMetadata
virtual bool getMetadata(const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime)=0
cond::TimeType
TimeType
Definition: Time.h:19
cond::Hash
std::string Hash
Definition: Types.h:43
cond::persistency::IRunInfoTable::getInclusiveTimeRange
virtual bool getInclusiveTimeRange(const boost::posix_time::ptime &lower, const boost::posix_time::ptime &upper, std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runData)=0
cond::persistency::IIOVSchema::exists
virtual bool exists()=0
cond::Binary
Definition: Binary.h:15
cond::hash
Definition: Time.h:19
cond::persistency::IIOVSchema::~IIOVSchema
virtual ~IIOVSchema()
Definition: IDbSchema.h:143
Time.h
cond::persistency::ITagTable::insert
virtual void insert(const std::string &name, cond::TimeType timeType, const std::string &objectType, cond::SynchronizationType synchronizationType, cond::Time_t endOfValidity, const std::string &description, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &insertionTime)=0
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
cond::persistency::ITagAccessPermissionTable
Definition: IDbSchema.h:108
cond::persistency::ITagLogTable::~ITagLogTable
virtual ~ITagLogTable()
Definition: IDbSchema.h:129
cond::persistency::IGTSchema
Definition: IDbSchema.h:194
cond::persistency::IGTTable::update
virtual void update(const std::string &name, cond::Time_t validity, const std::string &description, const std::string &release, const boost::posix_time::ptime &snapshotTime, const boost::posix_time::ptime &insertionTime)=0
writedatasetfile.runs
runs
Definition: writedatasetfile.py:27
loadRecoTauTagMVAsFromPrepDB_cfi.snapshotTime
snapshotTime
Definition: loadRecoTauTagMVAsFromPrepDB_cfi.py:10
cond::persistency::ITagTable::updateMetadata
virtual void updateMetadata(const std::string &name, const std::string &description, const boost::posix_time::ptime &updateTime)=0
cond::persistency::IIOVSchema::tagAccessPermissionTable
virtual ITagAccessPermissionTable & tagAccessPermissionTable()=0
cond::persistency::IGTTable::insert
virtual void insert(const std::string &name, cond::Time_t validity, const std::string &description, const std::string &release, const boost::posix_time::ptime &snapshotTime, const boost::posix_time::ptime &insertionTime)=0
cond::persistency::IIOVSchema::iovTable
virtual IIOVTable & iovTable()=0
cond::persistency::IIOVSchema
Definition: IDbSchema.h:141
cond::persistency::ITagTable::setProtectionCode
virtual void setProtectionCode(const std::string &name, int code)=0
cond::persistency::IGTMapTable::create
virtual void create()=0
mps_check.command
list command
Definition: mps_check.py:25
cond::persistency::IGTMapTable
Definition: IDbSchema.h:179
cond::persistency::ITagLogTable::exists
virtual bool exists()=0
cond::persistency::IGTMapTable::exists
virtual bool exists()=0
cond::persistency::ITagTable::update
virtual void update(const std::string &name, cond::SynchronizationType synchronizationType, cond::Time_t &endOfValidity, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)=0
cond::persistency::IGTTable::exists
virtual bool exists()=0
EcalCondDBWriter_cfi.userName
userName
Definition: EcalCondDBWriter_cfi.py:61
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
cond::persistency::ITagTable::create
virtual void create()=0
cond::persistency::IGTSchema::gtMapTable
virtual IGTMapTable & gtMapTable()=0
cond::persistency::ITagAccessPermissionTable::~ITagAccessPermissionTable
virtual ~ITagAccessPermissionTable()
Definition: IDbSchema.h:110
cond::persistency::IPayloadTable
Definition: IDbSchema.h:55
cond::persistency::ITagTable::unsetProtectionCode
virtual void unsetProtectionCode(const std::string &name, int code)=0
cond::persistency::IIOVSchema::payloadTable
virtual IPayloadTable & payloadTable()=0
cond::persistency::IPayloadTable::insertIfNew
virtual cond::Hash insertIfNew(const std::string &objectType, const cond::Binary &payloadData, const cond::Binary &streamerInfoData, const boost::posix_time::ptime &insertionTime)=0
cond::SynchronizationType
SynchronizationType
Definition: Types.h:27
cond::persistency::IRunInfoTable::create
virtual void create()=0
cond::persistency::IRunInfoSchema::~IRunInfoSchema
virtual ~IRunInfoSchema()
Definition: IDbSchema.h:228
mps_fire.end
end
Definition: mps_fire.py:242
cond::persistency::IRunInfoTable::insert
virtual void insert(const std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runs)=0
cond::persistency::IGTTable::create
virtual void create()=0
cond::persistency::ITagAccessPermissionTable::setAccessPermission
virtual void setAccessPermission(const std::string &tagName, const std::string &credential, int credentialType, int accessType)=0
writeEcalDQMStatus.since
since
Definition: writeEcalDQMStatus.py:53
cond::persistency::IRunInfoSchema
Definition: IDbSchema.h:226
cond::persistency::IIOVTable::eraseMany
virtual void eraseMany(const std::string &tag, const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
cond::persistency::IIOVTable::getRange
virtual bool getRange(const std::string &tag, cond::Time_t begin, cond::Time_t end, const boost::posix_time::ptime &snapshotTime, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
cond::persistency::IRunInfoTable::getInclusiveRunRange
virtual bool getInclusiveRunRange(cond::Time_t lower, cond::Time_t upper, std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runData)=0
cond::persistency::ITagTable::updateValidity
virtual void updateValidity(const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)=0
cond::persistency::IGTMapTable::select
virtual bool select(const std::string &gtName, std::vector< std::tuple< std::string, std::string, std::string > > &tags)=0
cond::persistency::ITagTable::select
virtual bool select(const std::string &name)=0
cond::persistency::IIOVTable::~IIOVTable
virtual ~IIOVTable()
Definition: IDbSchema.h:73
cond::persistency::IGTSchema::create
virtual void create()=0
cond
Definition: plugin.cc:23
cond::persistency::IIOVSchema::tagTable
virtual ITagTable & tagTable()=0
cond::persistency::IRunInfoSchema::exists
virtual bool exists()=0
cond::persistency::IIOVTable::eraseOne
virtual void eraseOne(const std::string &tag, cond::Time_t since, cond::Hash payloadId)=0
EcalCondDBWriter_cfi.hostName
hostName
Definition: EcalCondDBWriter_cfi.py:59
cond::persistency::IIOVTable::insertOne
virtual void insertOne(const std::string &tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime &insertTime)=0
cond::persistency::ITagAccessPermissionTable::removeAccessPermission
virtual void removeAccessPermission(const std::string &tagName, const std::string &credential, int credentialType)=0
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
cond::persistency::IRunInfoSchema::runInfoTable
virtual IRunInfoTable & runInfoTable()=0
writedatasetfile.action
action
Definition: writedatasetfile.py:8
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
cond::persistency::ITagLogTable::insert
virtual void insert(const std::string &tag, const boost::posix_time::ptime &eventTime, const std::string &userName, const std::string &hostName, const std::string &command, const std::string &action, const std::string &userText)=0
cond::persistency::IIOVSchema::tagLogTable
virtual ITagLogTable & tagLogTable()=0
cond::persistency::IIOVTable::getSize
virtual bool getSize(const std::string &tag, const boost::posix_time::ptime &snapshotTime, size_t &size)=0
cond::persistency::IPayloadTable::exists
virtual bool exists()=0
cond::persistency::ITagTable
Definition: IDbSchema.h:15
cond::persistency::IRunInfoTable::exists
virtual bool exists()=0
cond::persistency::IIOVTable::exists
virtual bool exists()=0
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::persistency::IRunInfoTable::insertOne
virtual void insertOne(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)=0
cond::persistency::ITagTable::~ITagTable
virtual ~ITagTable()
Definition: IDbSchema.h:17
cond::persistency::IRunInfoTable
Definition: IDbSchema.h:203
cond::persistency::IPayloadTable::~IPayloadTable
virtual ~IPayloadTable()
Definition: IDbSchema.h:57
cond::persistency::IRunInfoSchema::create
virtual bool create()=0
cond::persistency::ITagAccessPermissionTable::removeEntriesForCredential
virtual void removeEntriesForCredential(const std::string &credential, int credentialType)=0
cond::persistency::ITagLogTable
Definition: IDbSchema.h:127
cond::persistency::ITagLogTable::create
virtual void create()=0
cond::persistency::IGTTable::~IGTTable
virtual ~IGTTable()
Definition: IDbSchema.h:155
cond::persistency::IIOVTable
Definition: IDbSchema.h:71
cond::persistency::IPayloadTable::getType
virtual bool getType(const cond::Hash &payloadHash, std::string &objectType)=0
cond::persistency::IIOVTable::erase
virtual void erase(const std::string &tag)=0
cond::persistency::ITagAccessPermissionTable::create
virtual void create()=0
cond::persistency::IIOVTable::create
virtual void create()=0
pileupCalc.upper
upper
Definition: pileupCalc.py:213
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Binary.h
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
cond::persistency::IRunInfoTable::select
virtual bool select(cond::Time_t runNumber, boost::posix_time::ptime &start, boost::posix_time::ptime &end)=0
cond::persistency::IGTMapTable::~IGTMapTable
virtual ~IGTMapTable()
Definition: IDbSchema.h:181
cond::persistency::IGTSchema::~IGTSchema
virtual ~IGTSchema()
Definition: IDbSchema.h:196
cond::persistency::IGTMapTable::insert
virtual void insert(const std::string &gtName, const std::vector< std::tuple< std::string, std::string, std::string > > &tags)=0
Types.h
cond::persistency::ITagAccessPermissionTable::exists
virtual bool exists()=0
cond::persistency::IIOVSchema::create
virtual bool create()=0
cond::persistency::ITagAccessPermissionTable::getAccessPermission
virtual bool getAccessPermission(const std::string &tagName, const std::string &credential, int credentialType, int accessType)=0
cond::persistency::IIOVTable::insertMany
virtual void insertMany(const std::string &tag, const std::vector< std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > > &iovs)=0
JetPartonCorrections_cff.tagName
tagName
Definition: JetPartonCorrections_cff.py:12
cond::persistency::IGTSchema::exists
virtual bool exists()=0
cond::persistency::IRunInfoTable::updateEnd
virtual void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime &end)=0
cond::persistency::IIOVTable::getLastIov
virtual bool getLastIov(const std::string &tag, const boost::posix_time::ptime &snapshotTime, cond::Time_t &since, cond::Hash &hash)=0
cond::persistency::IRunInfoTable::getLastInserted
virtual cond::Time_t getLastInserted(boost::posix_time::ptime &start, boost::posix_time::ptime &end)=0
cond::persistency::IRunInfoTable::~IRunInfoTable
virtual ~IRunInfoTable()
Definition: IDbSchema.h:205
cond::persistency::IIOVTable::getGroups
virtual size_t getGroups(const std::string &tag, const boost::posix_time::ptime &snapshotTime, unsigned long long groupSize, std::vector< cond::Time_t > &groups)=0
cond::persistency::ITagTable::exists
virtual bool exists()=0
cond::persistency::IPayloadTable::select
virtual bool select(const cond::Hash &payloadHash, std::string &objectType, cond::Binary &payloadData, cond::Binary &streamerInfoData)=0
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
cond::persistency::IGTTable::select
virtual bool select(const std::string &name)=0