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, cond::TimeType& timeType, std::string& objectType, cond::SynchronizationType& synchronizationType,
22  cond::Time_t& endOfValidity, std::string& description, cond::Time_t& lastValidatedTime ) = 0;
23  virtual bool getMetadata( const std::string& name, std::string& description,
24  boost::posix_time::ptime& insertionTime, boost::posix_time::ptime& modificationTime ) = 0;
25  virtual void insert( const std::string& name, cond::TimeType timeType, const std::string& objectType,
26  cond::SynchronizationType synchronizationType, cond::Time_t endOfValidity, const std::string& description,
27  cond::Time_t lastValidatedTime, const boost::posix_time::ptime& insertionTime ) = 0;
28  virtual void update( const std::string& name, cond::SynchronizationType synchronizationType, cond::Time_t& endOfValidity, const std::string& description,
29  cond::Time_t lastValidatedTime, const boost::posix_time::ptime& updateTime ) = 0;
30  virtual void updateValidity( const std::string& name, cond::Time_t lastValidatedTime,
31  const boost::posix_time::ptime& updateTime ) = 0;
32  virtual void setValidationMode() = 0;
33  };
34 
35  class IPayloadTable {
36  public:
37  virtual ~IPayloadTable(){}
38  virtual bool exists() = 0;
39  virtual void create() = 0;
40  virtual bool select( const cond::Hash& payloadHash, std::string& objectType,
41  cond::Binary& payloadData, cond::Binary& streamerInfoData ) = 0;
42  virtual bool getType( const cond::Hash& payloadHash, std::string& objectType ) = 0;
43  virtual cond::Hash insertIfNew( const std::string& objectType, const cond::Binary& payloadData,
44  const cond::Binary& streamerInfoData, const boost::posix_time::ptime& insertionTime ) = 0;
45  };
46 
47  class IIOVTable {
48  public:
49  virtual ~IIOVTable(){}
50  virtual bool exists() = 0;
51  virtual void create() = 0;
52  virtual size_t getGroups( const std::string& tag, const boost::posix_time::ptime& snapshotTime, unsigned long long groupSize,
53  std::vector<cond::Time_t>& groups ) = 0;
54  virtual size_t select( const std::string& tag, cond::Time_t lowerGroup, cond::Time_t upperGroup,
55  const boost::posix_time::ptime& snapshotTime,
56  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs) = 0;
57  virtual bool getLastIov( const std::string& tag, const boost::posix_time::ptime& snapshotTime, cond::Time_t& since, cond::Hash& hash ) = 0;
58  virtual bool getSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size ) = 0;
59  virtual bool getRange( const std::string& tag, cond::Time_t begin, cond::Time_t end,
60  const boost::posix_time::ptime& snapshotTime, std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs ) = 0;
61  virtual void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash,
62  const boost::posix_time::ptime& insertTime ) = 0;
63  virtual void insertMany( const std::string& tag,
64  const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ) = 0;
65  virtual void erase( const std::string& tag ) = 0;
66  };
67 
69  public:
70  virtual ~ITagMigrationTable(){}
71  virtual bool exists() = 0;
72  virtual void create() = 0;
73  virtual bool select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName, int& statusCode ) = 0;
74  virtual void insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
75  int statusCode, const boost::posix_time::ptime& insertionTime ) = 0;
76  virtual void updateValidationCode( const std::string& sourceAccount, const std::string& sourceTag, int statusCode ) = 0;
77  };
78 
80  public:
82  virtual bool exists() = 0;
83  virtual void create() = 0;
84  virtual bool select( const std::string& sourceAccount, const std::string& sourceToken, std::string& payloadId ) = 0;
85  virtual void insert( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
86  const boost::posix_time::ptime& insertionTime ) = 0;
87  virtual void update( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
88  const boost::posix_time::ptime& insertionTime ) = 0;
89  };
90 
91  class ITagLogTable {
92  public:
93  virtual ~ITagLogTable(){}
94  virtual bool exists() = 0;
95  virtual void create() = 0;
96  virtual void insert( const std::string& tag, const boost::posix_time::ptime& eventTime, const std::string& userName, const std::string& hostName,
97  const std::string& command, const std::string& action, const std::string& userText ) = 0;
98  };
99 
100  class IIOVSchema {
101  public:
102  virtual ~IIOVSchema(){}
103  virtual bool exists() = 0;
104  virtual bool create() = 0;
105  virtual ITagTable& tagTable() = 0;
106  virtual IIOVTable& iovTable() = 0;
107  virtual IPayloadTable& payloadTable() = 0;
108  virtual ITagLogTable& tagLogTable() = 0;
109  };
110 
111  class IGTTable {
112  public:
113  virtual ~IGTTable(){}
114  virtual bool exists() = 0;
115  virtual void create() = 0;
116  virtual bool select( const std::string& name ) = 0;
117  virtual bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime ) = 0;
118  virtual bool select( const std::string& name, cond::Time_t& validity, std::string& description,
119  std::string& release, boost::posix_time::ptime& snapshotTime ) = 0;
120  virtual void insert( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
121  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
122  virtual void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
123  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
124  };
125 
126  class IGTMapTable {
127  public:
128  virtual ~IGTMapTable(){}
129  virtual bool exists() = 0;
130  virtual void create() = 0;
131  virtual bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
132  virtual bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
133  std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
134  virtual void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
135  };
136 
137  class IGTSchema {
138  public:
139  virtual ~IGTSchema(){}
140  virtual bool exists() = 0;
141  virtual void create() = 0;
142  virtual IGTTable& gtTable() = 0;
143  virtual IGTMapTable& gtMapTable() = 0;
144  };
145 
147  public:
148  virtual ~IRunInfoTable(){}
149  virtual bool exists() = 0;
150  virtual void create() = 0;
151  virtual bool select( cond::Time_t runNumber, boost::posix_time::ptime& start, boost::posix_time::ptime& end ) = 0;
152  virtual cond::Time_t getLastInserted() = 0;
153  virtual bool getInclusiveRunRange( cond::Time_t lower, cond::Time_t upper,
154  std::vector<std::tuple<cond::Time_t,boost::posix_time::ptime,boost::posix_time::ptime> >& runData ) = 0;
155  virtual bool getInclusiveTimeRange( const boost::posix_time::ptime& lower ,const boost::posix_time::ptime& upper,
156  std::vector<std::tuple<cond::Time_t,boost::posix_time::ptime,boost::posix_time::ptime> >& runData ) = 0;
157  virtual void insertOne( cond::Time_t runNumber, const boost::posix_time::ptime& start, const boost::posix_time::ptime& end) = 0;
158  virtual void insert( const std::vector<std::tuple<cond::Time_t,boost::posix_time::ptime,boost::posix_time::ptime> >& runs ) = 0;
159  virtual void updateEnd( cond::Time_t runNumber, const boost::posix_time::ptime& end ) = 0;
160  };
161 
163  public:
164  virtual ~IRunInfoSchema(){}
165  virtual bool exists() = 0;
166  virtual bool create() = 0;
167  virtual IRunInfoTable& runInfoTable() = 0;
168  };
169 
170 
171  }
172 }
173 #endif
size
Write out results.
virtual void update(const std::string &name, cond::SynchronizationType synchronizationType, cond::Time_t &endOfValidity, const std::string &description, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)=0
Definition: start.py:1
virtual void updateValidity(const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)=0
virtual bool getMetadata(const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime)=0
TimeType
Definition: Time.h:21
unsigned long long Time_t
Definition: Time.h:16
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
std::string Hash
Definition: Types.h:45
virtual void setValidationMode()=0
#define end
Definition: vmac.h:39
list command
Definition: mps_check.py:25
Definition: plugin.cc:24
#define begin
Definition: vmac.h:32
SynchronizationType
Definition: Types.h:29
virtual bool select(const std::string &name)=0