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