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::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 IIOVSchema {
94  public:
95  virtual ~IIOVSchema(){}
96  virtual bool exists() = 0;
97  virtual bool create() = 0;
98  virtual ITagTable& tagTable() = 0;
99  virtual IIOVTable& iovTable() = 0;
100  virtual IPayloadTable& payloadTable() = 0;
101  virtual ITagMigrationTable& tagMigrationTable() = 0;
103  virtual std::string parsePoolToken( const std::string& poolToken ) = 0;
104  };
105 
106  class IGTTable {
107  public:
108  virtual ~IGTTable(){}
109  virtual bool exists() = 0;
110  virtual void create() = 0;
111  virtual bool select( const std::string& name ) = 0;
112  virtual bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime ) = 0;
113  virtual bool select( const std::string& name, cond::Time_t& validity, std::string& description,
114  std::string& release, boost::posix_time::ptime& snapshotTime ) = 0;
115  virtual void insert( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
116  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
117  virtual void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
118  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
119  };
120 
121  class IGTMapTable {
122  public:
123  virtual ~IGTMapTable(){}
124  virtual bool exists() = 0;
125  virtual void create() = 0;
126  virtual bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
127  virtual bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
128  std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
129  virtual void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
130  };
131 
132  class IGTSchema {
133  public:
134  virtual ~IGTSchema(){}
135  virtual bool exists() = 0;
136  virtual void create() = 0;
137  virtual IGTTable& gtTable() = 0;
138  virtual IGTMapTable& gtMapTable() = 0;
139  };
140 
141  }
142 }
143 #endif
virtual ITagMigrationTable & tagMigrationTable()=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 void update(const std::string &name, cond::Time_t &endOfValidity, const std::string &description, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)=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
virtual IPayloadMigrationTable & payloadMigrationTable()=0
TimeType
Definition: Time.h:21
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:47
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 std::string parsePoolToken(const std::string &poolToken)=0
virtual IGTMapTable & gtMapTable()=0
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:31
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