CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
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,
212  cond::Time_t upper,
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
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
virtual IIOVTable & iovTable()=0
virtual void removeEntriesForCredential(const std::string &credential, int credentialType)=0
virtual void updateValidity(const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)=0
virtual cond::Time_t getLastInserted(boost::posix_time::ptime &start, boost::posix_time::ptime &end)=0
virtual void unsetProtectionCode(const std::string &name, int code)=0
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
virtual cond::Hash insertIfNew(const std::string &objectType, const cond::Binary &payloadData, const cond::Binary &streamerInfoData, const boost::posix_time::ptime &insertionTime)=0
virtual void updateMetadata(const std::string &name, const std::string &description, const boost::posix_time::ptime &updateTime)=0
virtual bool getSize(const std::string &tag, const boost::posix_time::ptime &snapshotTime, size_t &size)=0
virtual void setProtectionCode(const std::string &name, int code)=0
virtual bool getMetadata(const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime)=0
virtual void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime &end)=0
virtual IRunInfoTable & runInfoTable()=0
virtual bool select(const std::string &name)=0
virtual IPayloadTable & payloadTable()=0
virtual void eraseMany(const std::string &tag, const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
TimeType
Definition: Time.h:19
tuple runs
Definition: gather_cfg.py:88
virtual ITagLogTable & tagLogTable()=0
virtual bool getAccessPermission(const std::string &tagName, const std::string &credential, int credentialType, int accessType)=0
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
unsigned long long Time_t
Definition: Time.h:14
virtual bool getType(const cond::Hash &payloadHash, std::string &objectType)=0
virtual bool select(const std::string &gtName, std::vector< std::tuple< std::string, std::string, std::string > > &tags)=0
virtual bool select(cond::Time_t runNumber, boost::posix_time::ptime &start, boost::posix_time::ptime &end)=0
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
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
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
virtual void insertMany(const std::string &tag, const std::vector< std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > > &iovs)=0
std::string Hash
Definition: Types.h:43
virtual IGTTable & gtTable()=0
virtual void setAccessPermission(const std::string &tagName, const std::string &credential, int credentialType, int accessType)=0
virtual bool select(const cond::Hash &payloadHash, std::string &objectType, cond::Binary &payloadData, cond::Binary &streamerInfoData)=0
virtual bool getLastIov(const std::string &tag, const boost::posix_time::ptime &snapshotTime, cond::Time_t &since, cond::Hash &hash)=0
virtual void erase(const std::string &tag)=0
virtual ITagAccessPermissionTable & tagAccessPermissionTable()=0
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
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
virtual IGTMapTable & gtMapTable()=0
string action
Definition: mps_fire.py:183
virtual void insertOne(const std::string &tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime &insertTime)=0
list command
Definition: mps_check.py:25
virtual void insertOne(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)=0
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
string end
Definition: dataset.py:937
SynchronizationType
Definition: Types.h:27
virtual bool select(const std::string &name)=0
virtual void removeAccessPermission(const std::string &tagName, const std::string &credential, int credentialType)=0
virtual void insert(const std::string &gtName, const std::vector< std::tuple< std::string, std::string, std::string > > &tags)=0
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
tuple size
Write out results.
virtual ITagTable & tagTable()=0
virtual void insert(const std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runs)=0
virtual void eraseOne(const std::string &tag, cond::Time_t since, cond::Hash payloadId)=0