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 bool getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ) = 0;
58  virtual bool getSize( const std::string& tag, size_t& size ) = 0;
59  virtual bool getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size ) = 0;
60  virtual void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash,
61  const boost::posix_time::ptime& insertTime ) = 0;
62  virtual void insertMany( const std::string& tag,
63  const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ) = 0;
64  virtual void erase( const std::string& tag ) = 0;
65  };
66 
68  public:
69  virtual ~ITagMigrationTable(){}
70  virtual bool exists() = 0;
71  virtual void create() = 0;
72  virtual bool select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName, int& statusCode ) = 0;
73  virtual void insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
74  int statusCode, const boost::posix_time::ptime& insertionTime ) = 0;
75  virtual void updateValidationCode( const std::string& sourceAccount, const std::string& sourceTag, int statusCode ) = 0;
76  };
77 
79  public:
81  virtual bool exists() = 0;
82  virtual void create() = 0;
83  virtual bool select( const std::string& sourceAccount, const std::string& sourceToken, std::string& payloadId ) = 0;
84  virtual void insert( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
85  const boost::posix_time::ptime& insertionTime ) = 0;
86  virtual void update( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
87  const boost::posix_time::ptime& insertionTime ) = 0;
88  };
89 
90  class IIOVSchema {
91  public:
92  virtual ~IIOVSchema(){}
93  virtual bool exists() = 0;
94  virtual bool create() = 0;
95  virtual ITagTable& tagTable() = 0;
96  virtual IIOVTable& iovTable() = 0;
97  virtual IPayloadTable& payloadTable() = 0;
100  virtual std::string parsePoolToken( const std::string& poolToken ) = 0;
101  };
102 
103  class IGTTable {
104  public:
105  virtual ~IGTTable(){}
106  virtual bool exists() = 0;
107  virtual bool select( const std::string& name ) = 0;
108  virtual bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime ) = 0;
109  virtual bool select( const std::string& name, cond::Time_t& validity, std::string& description,
110  std::string& release, boost::posix_time::ptime& snapshotTime ) = 0;
111  virtual void insert( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
112  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
113  virtual void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
114  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
115  };
116 
117  class IGTMapTable {
118  public:
119  virtual ~IGTMapTable(){}
120  virtual bool exists() = 0;
121  virtual bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
122  virtual bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
123  std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
124  virtual void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
125  };
126 
127  class IGTSchema {
128  public:
129  virtual ~IGTSchema(){}
130  virtual bool exists() = 0;
131  virtual IGTTable& gtTable() = 0;
132  virtual IGTMapTable& gtMapTable() = 0;
133  };
134 
135  }
136 }
137 #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 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
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:43
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