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,
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  };
29 
30  class IPayloadTable {
31  public:
32  virtual ~IPayloadTable(){}
33  virtual bool exists() = 0;
34  virtual void create() = 0;
35  virtual bool select( const cond::Hash& payloadHash, std::string& objectType, cond::Binary& payloadData ) = 0;
36  virtual bool getType( const cond::Hash& payloadHash, std::string& objectType ) = 0;
37  //virtual bool insert( const cond::Hash& payloadHash, const std::string& objectType,
38  // const cond::Binary& payloadData, const boost::posix_time::ptime& insertionTime ) = 0;
39  virtual cond::Hash insertIfNew( const std::string& objectType, const cond::Binary& payloadData,
40  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  };
65 
67  public:
68  virtual ~ITagMigrationTable(){}
69  virtual bool exists() = 0;
70  virtual void create() = 0;
71  virtual bool select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName ) = 0;
72  virtual void insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
73  const boost::posix_time::ptime& insertionTime ) = 0;
74  };
75 
76  class IIOVSchema {
77  public:
78  virtual ~IIOVSchema(){}
79  virtual bool exists() = 0;
80  virtual bool create() = 0;
81  virtual ITagTable& tagTable() = 0;
82  virtual IIOVTable& iovTable() = 0;
83  virtual IPayloadTable& payloadTable() = 0;
85  };
86 
87  class IGTTable {
88  public:
89  virtual ~IGTTable(){}
90  virtual bool exists() = 0;
91  virtual bool select( const std::string& name ) = 0;
92  virtual bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime ) = 0;
93  virtual bool select( const std::string& name, cond::Time_t& validity, std::string& description,
94  std::string& release, boost::posix_time::ptime& snapshotTime ) = 0;
95  virtual void insert( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
96  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
97  virtual void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
98  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime ) = 0;
99  };
100 
101  class IGTMapTable {
102  public:
103  virtual ~IGTMapTable(){}
104  virtual bool exists() = 0;
105  virtual bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
106  virtual bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
107  std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
108  virtual void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags ) = 0;
109  };
110 
111  class IGTSchema {
112  public:
113  virtual ~IGTSchema(){}
114  virtual bool exists() = 0;
115  virtual IGTTable& gtTable() = 0;
116  virtual IGTMapTable& gtMapTable() = 0;
117  };
118 
119  }
120 }
121 #endif
virtual ITagMigrationTable & tagMigrationTable()=0
virtual IIOVTable & iovTable()=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 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 void insert(const std::string &sourceAccount, const std::string &sourceTag, const std::string &tagName, const boost::posix_time::ptime &insertionTime)=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
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 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:34
virtual bool select(const std::string &sourceAccount, const std::string &sourceTag, std::string &tagName)=0
virtual IGTTable & gtTable()=0
tuple tags
Definition: o2o.py:248
tuple description
Definition: idDealer.py:66
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
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:22
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
virtual cond::Hash insertIfNew(const std::string &objectType, const cond::Binary &payloadData, 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
virtual bool select(const cond::Hash &payloadHash, std::string &objectType, cond::Binary &payloadData)=0