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) = 0;
27  virtual bool getMetadata(const std::string& name,
29  boost::posix_time::ptime& insertionTime,
30  boost::posix_time::ptime& modificationTime) = 0;
31  virtual void insert(const std::string& name,
32  cond::TimeType timeType,
33  const std::string& objectType,
34  cond::SynchronizationType synchronizationType,
35  cond::Time_t endOfValidity,
36  const std::string& description,
37  cond::Time_t lastValidatedTime,
38  const boost::posix_time::ptime& insertionTime) = 0;
39  virtual void update(const std::string& name,
40  cond::SynchronizationType synchronizationType,
41  cond::Time_t& endOfValidity,
42  cond::Time_t lastValidatedTime,
43  const boost::posix_time::ptime& updateTime) = 0;
44  virtual void updateMetadata(const std::string& name,
45  const std::string& description,
46  const boost::posix_time::ptime& updateTime) = 0;
47  virtual void updateValidity(const std::string& name,
48  cond::Time_t lastValidatedTime,
49  const boost::posix_time::ptime& updateTime) = 0;
50  virtual void setValidationMode() = 0;
51  };
52 
53  class IPayloadTable {
54  public:
55  virtual ~IPayloadTable() {}
56  virtual bool exists() = 0;
57  virtual void create() = 0;
58  virtual bool select(const cond::Hash& payloadHash,
59  std::string& objectType,
60  cond::Binary& payloadData,
61  cond::Binary& streamerInfoData) = 0;
62  virtual bool getType(const cond::Hash& payloadHash, std::string& objectType) = 0;
63  virtual cond::Hash insertIfNew(const std::string& objectType,
64  const cond::Binary& payloadData,
65  const cond::Binary& streamerInfoData,
66  const boost::posix_time::ptime& insertionTime) = 0;
67  };
68 
69  class IIOVTable {
70  public:
71  virtual ~IIOVTable() {}
72  virtual bool exists() = 0;
73  virtual void create() = 0;
74  virtual size_t getGroups(const std::string& tag,
75  const boost::posix_time::ptime& snapshotTime,
76  unsigned long long groupSize,
77  std::vector<cond::Time_t>& groups) = 0;
78  virtual size_t select(const std::string& tag,
79  cond::Time_t lowerGroup,
80  cond::Time_t upperGroup,
81  const boost::posix_time::ptime& snapshotTime,
82  std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
83  virtual bool getLastIov(const std::string& tag,
84  const boost::posix_time::ptime& snapshotTime,
86  cond::Hash& hash) = 0;
87  virtual bool getSize(const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size) = 0;
88  virtual bool getRange(const std::string& tag,
91  const boost::posix_time::ptime& snapshotTime,
92  std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
93  virtual void insertOne(const std::string& tag,
95  cond::Hash payloadHash,
96  const boost::posix_time::ptime& insertTime) = 0;
97  virtual void insertMany(
98  const std::string& tag,
99  const std::vector<std::tuple<cond::Time_t, cond::Hash, boost::posix_time::ptime> >& iovs) = 0;
100  virtual void eraseOne(const std::string& tag, cond::Time_t since, cond::Hash payloadId) = 0;
101  virtual void eraseMany(const std::string& tag,
102  const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
103  virtual void erase(const std::string& tag) = 0;
104  };
105 
107  public:
108  virtual ~ITagMigrationTable() {}
109  virtual bool exists() = 0;
110  virtual void create() = 0;
111  virtual bool select(const std::string& sourceAccount,
112  const std::string& sourceTag,
114  int& statusCode) = 0;
115  virtual void insert(const std::string& sourceAccount,
116  const std::string& sourceTag,
117  const std::string& tagName,
118  int statusCode,
119  const boost::posix_time::ptime& insertionTime) = 0;
120  virtual void updateValidationCode(const std::string& sourceAccount,
121  const std::string& sourceTag,
122  int statusCode) = 0;
123  };
124 
126  public:
128  virtual bool exists() = 0;
129  virtual void create() = 0;
130  virtual bool select(const std::string& sourceAccount, const std::string& sourceToken, std::string& payloadId) = 0;
131  virtual void insert(const std::string& sourceAccount,
132  const std::string& sourceToken,
133  const std::string& payloadId,
134  const boost::posix_time::ptime& insertionTime) = 0;
135  virtual void update(const std::string& sourceAccount,
136  const std::string& sourceToken,
137  const std::string& payloadId,
138  const boost::posix_time::ptime& insertionTime) = 0;
139  };
140 
141  class ITagLogTable {
142  public:
143  virtual ~ITagLogTable() {}
144  virtual bool exists() = 0;
145  virtual void create() = 0;
146  virtual void insert(const std::string& tag,
147  const boost::posix_time::ptime& eventTime,
148  const std::string& userName,
149  const std::string& hostName,
150  const std::string& command,
151  const std::string& action,
152  const std::string& userText) = 0;
153  };
154 
155  class IIOVSchema {
156  public:
157  virtual ~IIOVSchema() {}
158  virtual bool exists() = 0;
159  virtual bool create() = 0;
160  virtual ITagTable& tagTable() = 0;
161  virtual IIOVTable& iovTable() = 0;
162  virtual IPayloadTable& payloadTable() = 0;
163  virtual ITagLogTable& tagLogTable() = 0;
164  };
165 
166  class IGTTable {
167  public:
168  virtual ~IGTTable() {}
169  virtual bool exists() = 0;
170  virtual void create() = 0;
171  virtual bool select(const std::string& name) = 0;
172  virtual bool select(const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime) = 0;
173  virtual bool select(const std::string& name,
174  cond::Time_t& validity,
177  boost::posix_time::ptime& snapshotTime) = 0;
178  virtual void insert(const std::string& name,
179  cond::Time_t validity,
180  const std::string& description,
181  const std::string& release,
182  const boost::posix_time::ptime& snapshotTime,
183  const boost::posix_time::ptime& insertionTime) = 0;
184  virtual void update(const std::string& name,
185  cond::Time_t validity,
186  const std::string& description,
187  const std::string& release,
188  const boost::posix_time::ptime& snapshotTime,
189  const boost::posix_time::ptime& insertionTime) = 0;
190  };
191 
192  class IGTMapTable {
193  public:
194  virtual ~IGTMapTable() {}
195  virtual bool exists() = 0;
196  virtual void create() = 0;
197  virtual bool select(const std::string& gtName,
198  std::vector<std::tuple<std::string, std::string, std::string> >& tags) = 0;
199  virtual bool select(const std::string& gtName,
200  const std::string& preFix,
201  const std::string& postFix,
202  std::vector<std::tuple<std::string, std::string, std::string> >& tags) = 0;
203  virtual void insert(const std::string& gtName,
204  const std::vector<std::tuple<std::string, std::string, std::string> >& tags) = 0;
205  };
206 
207  class IGTSchema {
208  public:
209  virtual ~IGTSchema() {}
210  virtual bool exists() = 0;
211  virtual void create() = 0;
212  virtual IGTTable& gtTable() = 0;
213  virtual IGTMapTable& gtMapTable() = 0;
214  };
215 
217  public:
218  virtual ~IRunInfoTable() {}
219  virtual bool exists() = 0;
220  virtual void create() = 0;
221  virtual bool select(cond::Time_t runNumber, boost::posix_time::ptime& start, boost::posix_time::ptime& end) = 0;
222  virtual cond::Time_t getLastInserted(boost::posix_time::ptime& start, boost::posix_time::ptime& end) = 0;
223  virtual bool getInclusiveRunRange(
224  cond::Time_t lower,
226  std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData) = 0;
227  virtual bool getInclusiveTimeRange(
228  const boost::posix_time::ptime& lower,
229  const boost::posix_time::ptime& upper,
230  std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData) = 0;
231  virtual void insertOne(cond::Time_t runNumber,
232  const boost::posix_time::ptime& start,
233  const boost::posix_time::ptime& end) = 0;
234  virtual void insert(
235  const std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runs) = 0;
236  virtual void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime& end) = 0;
237  };
238 
240  public:
241  virtual ~IRunInfoSchema() {}
242  virtual bool exists() = 0;
243  virtual bool create() = 0;
244  virtual IRunInfoTable& runInfoTable() = 0;
245  };
246 
247  } // namespace persistency
248 } // namespace cond
249 #endif
cond::persistency::IGTSchema::gtTable
virtual IGTTable & gtTable()=0
cond::persistency::IGTTable
Definition: IDbSchema.h:166
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::IPayloadMigrationTable::create
virtual void create()=0
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
GlobalTag_cfi.snapshotTime
snapshotTime
Definition: GlobalTag_cfi.py:19
cond::hash
Definition: Time.h:19
cond::persistency::IIOVSchema::~IIOVSchema
virtual ~IIOVSchema()
Definition: IDbSchema.h:157
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::ITagLogTable::~ITagLogTable
virtual ~ITagLogTable()
Definition: IDbSchema.h:143
cond::persistency::IGTSchema
Definition: IDbSchema.h:207
cond::persistency::IPayloadMigrationTable::update
virtual void update(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId, const boost::posix_time::ptime &insertionTime)=0
cond::persistency::ITagMigrationTable::~ITagMigrationTable
virtual ~ITagMigrationTable()
Definition: IDbSchema.h:108
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
cond::persistency::ITagTable::updateMetadata
virtual void updateMetadata(const std::string &name, const std::string &description, const boost::posix_time::ptime &updateTime)=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:155
cond::persistency::ITagMigrationTable::exists
virtual bool exists()=0
cond::persistency::IGTMapTable::create
virtual void create()=0
cond::persistency::IPayloadMigrationTable::~IPayloadMigrationTable
virtual ~IPayloadMigrationTable()
Definition: IDbSchema.h:127
mps_check.command
list command
Definition: mps_check.py:25
cond::persistency::IPayloadMigrationTable::select
virtual bool select(const std::string &sourceAccount, const std::string &sourceToken, std::string &payloadId)=0
cond::persistency::IGTMapTable
Definition: IDbSchema.h:192
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
end
#define end
Definition: vmac.h:39
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
cond::persistency::ITagTable::create
virtual void create()=0
cond::persistency::ITagMigrationTable::create
virtual void create()=0
cond::persistency::IGTSchema::gtMapTable
virtual IGTMapTable & gtMapTable()=0
cond::persistency::ITagMigrationTable
Definition: IDbSchema.h:106
cond::persistency::IPayloadTable
Definition: IDbSchema.h:53
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::ITagMigrationTable::select
virtual bool select(const std::string &sourceAccount, const std::string &sourceTag, std::string &tagName, int &statusCode)=0
cond::persistency::IRunInfoTable::create
virtual void create()=0
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
cond::persistency::ITagMigrationTable::insert
virtual void insert(const std::string &sourceAccount, const std::string &sourceTag, const std::string &tagName, int statusCode, const boost::posix_time::ptime &insertionTime)=0
cond::persistency::IPayloadMigrationTable::exists
virtual bool exists()=0
cond::persistency::IRunInfoSchema::~IRunInfoSchema
virtual ~IRunInfoSchema()
Definition: IDbSchema.h:241
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
writeEcalDQMStatus.since
since
Definition: writeEcalDQMStatus.py:53
cond::persistency::IRunInfoSchema
Definition: IDbSchema.h:239
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::ITagTable::setValidationMode
virtual void setValidationMode()=0
cond::persistency::IGTMapTable::select
virtual bool select(const std::string &gtName, std::vector< std::tuple< std::string, std::string, std::string > > &tags)=0
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::persistency::ITagTable::select
virtual bool select(const std::string &name)=0
cond::persistency::IIOVTable::~IIOVTable
virtual ~IIOVTable()
Definition: IDbSchema.h:71
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::IPayloadMigrationTable::insert
virtual void insert(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId, const boost::posix_time::ptime &insertionTime)=0
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
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
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
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
RawToDigi_cff.sourceTag
sourceTag
Definition: RawToDigi_cff.py:78
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
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:216
cond::persistency::IPayloadTable::~IPayloadTable
virtual ~IPayloadTable()
Definition: IDbSchema.h:55
cond::persistency::IRunInfoSchema::create
virtual bool create()=0
cond::persistency::ITagLogTable
Definition: IDbSchema.h:141
cond::persistency::ITagMigrationTable::updateValidationCode
virtual void updateValidationCode(const std::string &sourceAccount, const std::string &sourceTag, int statusCode)=0
cond::persistency::ITagLogTable::create
virtual void create()=0
cond::persistency::IGTTable::~IGTTable
virtual ~IGTTable()
Definition: IDbSchema.h:168
cond::persistency::IIOVTable
Definition: IDbSchema.h:69
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::IPayloadMigrationTable
Definition: IDbSchema.h:125
cond::persistency::IIOVTable::create
virtual void create()=0
pileupCalc.upper
upper
Definition: pileupCalc.py:214
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:194
cond::persistency::IGTSchema::~IGTSchema
virtual ~IGTSchema()
Definition: IDbSchema.h:209
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::IIOVSchema::create
virtual bool create()=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
begin
#define begin
Definition: vmac.h:32
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:218
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