CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
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 selectGroups( const std::string& tag, std::vector<cond::Time_t>& groups ) = 0;
49  virtual size_t selectSnapshotGroups( const std::string& tag, const boost::posix_time::ptime& snapshotTime,
50  std::vector<cond::Time_t>& groups ) = 0;
51  virtual size_t selectLatestByGroup( const std::string& tag, cond::Time_t lowerGroup, cond::Time_t upperGroup ,
52  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs) = 0;
53  virtual size_t selectSnapshotByGroup( const std::string& tag, cond::Time_t lowerGroup, cond::Time_t upperGroup,
54  const boost::posix_time::ptime& snapshotTime,
55  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs) = 0;
56  virtual size_t selectLatest( const std::string& tag, std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs) = 0;
57  virtual size_t selectSnapshot( const std::string& tag, const boost::posix_time::ptime& snapshotTime,
58  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs) = 0;
59  virtual bool getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ) = 0;
60  virtual bool getSnapshotLastIov( const std::string& tag, const boost::posix_time::ptime& snapshotTime, cond::Time_t& since, cond::Hash& hash ) = 0;
61  virtual bool getSize( const std::string& tag, size_t& size ) = 0;
62  virtual bool getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size ) = 0;
63  virtual void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash,
64  const boost::posix_time::ptime& insertTime ) = 0;
65  virtual void insertMany( const std::string& tag,
66  const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ) = 0;
67  virtual void erase( const std::string& tag ) = 0;
68  };
69 
71  public:
72  virtual ~ITagMigrationTable(){}
73  virtual bool exists() = 0;
74  virtual void create() = 0;
75  virtual bool select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName, int& statusCode ) = 0;
76  virtual void insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
77  int statusCode, const boost::posix_time::ptime& insertionTime ) = 0;
78  virtual void updateValidationCode( const std::string& sourceAccount, const std::string& sourceTag, int statusCode ) = 0;
79  };
80 
82  public:
84  virtual bool exists() = 0;
85  virtual void create() = 0;
86  virtual bool select( const std::string& sourceAccount, const std::string& sourceToken, std::string& payloadId ) = 0;
87  virtual void insert( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
88  const boost::posix_time::ptime& insertionTime ) = 0;
89  virtual void update( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
90  const boost::posix_time::ptime& insertionTime ) = 0;
91  };
92 
93  class ITagLogTable {
94  public:
95  virtual ~ITagLogTable(){}
96  virtual bool exists() = 0;
97  virtual void create() = 0;
98  virtual void insert( const std::string& tag, const boost::posix_time::ptime& eventTime, const std::string& userName, const std::string& hostName,
99  const std::string& command, const std::string& action, const std::string& userText ) = 0;
100  };
101 
102  class IIOVSchema {
103  public:
104  virtual ~IIOVSchema(){}
105  virtual bool exists() = 0;
106  virtual bool create() = 0;
107  virtual ITagTable& tagTable() = 0;
108  virtual IIOVTable& iovTable() = 0;
109  virtual IPayloadTable& payloadTable() = 0;
110  virtual ITagLogTable& tagLogTable() = 0;
111  };
112 
113  class IGTTable {
114  public:
115  virtual ~IGTTable(){}
116  virtual bool exists() = 0;
117  virtual void create() = 0;
118  virtual bool select( const std::string& name ) = 0;
119  virtual bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime ) = 0;
120  virtual bool select( const std::string& name, cond::Time_t& validity, std::string& description,
121  std::string& release, boost::posix_time::ptime& snapshotTime ) = 0;
122  virtual void insert( 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  virtual void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
125  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
126  };
127 
128  class IGTMapTable {
129  public:
130  virtual ~IGTMapTable(){}
131  virtual bool exists() = 0;
132  virtual void create() = 0;
133  virtual bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
134  virtual bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
135  std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
136  virtual void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
137  };
138 
139  class IGTSchema {
140  public:
141  virtual ~IGTSchema(){}
142  virtual bool exists() = 0;
143  virtual void create() = 0;
144  virtual IGTTable& gtTable() = 0;
145  virtual IGTMapTable& gtMapTable() = 0;
146  };
147 
148  }
149 }
150 #endif
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
virtual IIOVTable & iovTable()=0
virtual void insert(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId, const boost::posix_time::ptime &insertionTime)=0
virtual void updateValidity(const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)=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 bool getMetadata(const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime)=0
virtual size_t selectSnapshotByGroup(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 bool getSnapshotLastIov(const std::string &tag, const boost::posix_time::ptime &snapshotTime, cond::Time_t &since, cond::Hash &hash)=0
virtual bool getSnapshotSize(const std::string &tag, const boost::posix_time::ptime &snapshotTime, size_t &size)=0
virtual size_t selectSnapshotGroups(const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::vector< cond::Time_t > &groups)=0
virtual bool select(const std::string &name)=0
virtual bool getLastIov(const std::string &tag, cond::Time_t &since, cond::Hash &hash)=0
virtual IPayloadTable & payloadTable()=0
virtual void update(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId, const boost::posix_time::ptime &insertionTime)=0
TimeType
Definition: Time.h:21
virtual ITagLogTable & tagLogTable()=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
virtual size_t selectSnapshot(const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
unsigned long long Time_t
Definition: Time.h:16
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(const std::string &sourceAccount, const std::string &sourceToken, std::string &payloadId)=0
virtual void insert(const std::string &sourceAccount, const std::string &sourceTag, const std::string &tagName, int statusCode, const boost::posix_time::ptime &insertionTime)=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:45
virtual IGTTable & gtTable()=0
virtual bool select(const cond::Hash &payloadHash, std::string &objectType, cond::Binary &payloadData, cond::Binary &streamerInfoData)=0
virtual void setValidationMode()=0
virtual void erase(const std::string &tag)=0
tuple tags
Definition: o2o.py:248
tuple description
Definition: idDealer.py:66
virtual void updateValidationCode(const std::string &sourceAccount, const std::string &sourceTag, int statusCode)=0
virtual size_t selectLatestByGroup(const std::string &tag, cond::Time_t lowerGroup, cond::Time_t upperGroup, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
virtual IGTMapTable & gtMapTable()=0
string command
Definition: mps_check.py:26
string action
Definition: mps_fire.py:28
virtual bool select(const std::string &sourceAccount, const std::string &sourceTag, std::string &tagName, int &statusCode)=0
virtual void insertOne(const std::string &tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime &insertTime)=0
virtual size_t selectLatest(const std::string &tag, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
virtual bool getSize(const std::string &tag, size_t &size)=0
SynchronizationType
Definition: Types.h:29
virtual bool select(const std::string &name)=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 size_t selectGroups(const std::string &tag, std::vector< cond::Time_t > &groups)=0
virtual ITagTable & tagTable()=0