CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OraDbSchema.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_OraDbSchema_h
2 #define CondCore_CondDB_OraDbSchema_h
3 
7 #include "IDbSchema.h"
8 //
11 //
12 #include <boost/date_time/posix_time/posix_time.hpp>
13 
14 namespace cond {
15 
16  namespace persistency {
17 
18  class IOVCache {
19  public:
24  bool existsTag( const std::string& tag );
25  void addTag( const std::string& tag, const std::string token );
26  std::string getToken( const std::string& tag );
27  bool load( const std::string& tag );
28  private:
32  };
33 
34  class OraTagTable : public ITagTable {
35  public:
36  explicit OraTagTable( IOVCache& cache );
37  virtual ~OraTagTable(){}
38  bool exists(){
39  return true;
40  }
41  void create(){
42  }
43 
44  bool select( const std::string& name );
45  bool select( const std::string& name, cond::TimeType& timeType, std::string& objectType,
46  cond::Time_t& endOfValidity, std::string& description, cond::Time_t& lastValidatedTime );
48  boost::posix_time::ptime& insertionTime, boost::posix_time::ptime& modificationTime );
49  void insert( const std::string& name, cond::TimeType timeType, const std::string& objectType,
50  cond::SynchronizationType synchronizationType, cond::Time_t endOfValidity, const std::string& description,
51  cond::Time_t lastValidatedTime, const boost::posix_time::ptime& insertionTime );
52  void update( const std::string& name, cond::Time_t& endOfValidity, const std::string& description,
53  cond::Time_t lastValidatedTime, const boost::posix_time::ptime& updateTime );
54  void updateValidity( const std::string& name, cond::Time_t lastValidatedTime,
55  const boost::posix_time::ptime& updateTime );
56  private:
58  };
59 
60  class OraPayloadTable : public IPayloadTable {
61  public:
62  explicit OraPayloadTable( DbSession& session );
63  virtual ~OraPayloadTable(){}
64  bool exists(){
65  return true;
66  }
67  void create(){
68  }
69  bool select( const cond::Hash& payloadHash, std::string& objectType, cond::Binary& payloadData );
70  bool getType( const cond::Hash& payloadHash, std::string& objectType );
71  cond::Hash insertIfNew( const std::string& objectType, const cond::Binary& payloadData,
72  const boost::posix_time::ptime& insertionTime );
73  private:
75  };
76 
77  class OraIOVTable : public IIOVTable {
78  public:
79  explicit OraIOVTable( IOVCache& cache );
80  virtual ~OraIOVTable(){}
81  bool exists(){
82  return true;
83  }
84  void create(){
85  }
86  size_t selectGroups( const std::string& tag, std::vector<cond::Time_t>& groups );
87  size_t selectSnapshotGroups( const std::string& tag, const boost::posix_time::ptime& snapshotTime,
88  std::vector<cond::Time_t>& groups );
89  size_t selectLatestByGroup( const std::string& tag, cond::Time_t lowerGroup, cond::Time_t upperGroup ,
90  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
91  size_t selectSnapshotByGroup( const std::string& tag, cond::Time_t lowerGroup, cond::Time_t upperGroup,
92  const boost::posix_time::ptime& snapshotTime,
93  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
94  size_t selectLatest( const std::string& tag, std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
95  bool getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash );
96  bool getSize( const std::string& tag, size_t& size );
97  bool getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size );
98  void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash,
99  const boost::posix_time::ptime& insertTime );
100  void insertMany( const std::string& tag,
101  const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs );
102  private:
104  };
105 
106  class OraIOVSchema : public IIOVSchema {
107  public:
108  explicit OraIOVSchema( DbSession& session );
109  virtual ~OraIOVSchema(){}
110  bool exists();
111  bool create();
112  ITagTable& tagTable();
113  IIOVTable& iovTable();
116  private:
121  };
122 
123  class OraGTTable : public IGTTable {
124  public:
125  explicit OraGTTable( DbSession& session );
126  virtual ~OraGTTable(){}
127  bool exists(){
128  return true;
129  }
130  bool select( const std::string& name );
131  bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime );
132  bool select( const std::string& name, cond::Time_t& validity, std::string& description,
133  std::string& release, boost::posix_time::ptime& snapshotTime );
134  void insert( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
135  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime );
136  void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
137  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime );
138  private:
140  };
141 
142  class OraGTMapTable : public IGTMapTable {
143  public:
144  explicit OraGTMapTable( DbSession& session );
145  virtual ~OraGTMapTable(){}
146  bool exists(){
147  return true;
148  }
149  bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags );
150  bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
151  std::vector<std::tuple<std::string,std::string,std::string> >& tags );
152  void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags );
153  private:
155  };
156 
157  class OraGTSchema : public IGTSchema {
158  public:
160  virtual ~OraGTSchema(){}
161  bool exists();
162  IGTTable& gtTable();
164  private:
168  };
169 
170  }
171 }
172 #endif
bool select(const std::string &name)
Definition: OraDbSchema.cc:67
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)
Definition: OraDbSchema.cc:287
bool getSnapshotSize(const std::string &tag, const boost::posix_time::ptime &snapshotTime, size_t &size)
Definition: OraDbSchema.cc:202
size_t selectGroups(const std::string &tag, std::vector< cond::Time_t > &groups)
Definition: OraDbSchema.cc:142
std::string getToken(const std::string &tag)
Definition: OraDbSchema.cc:38
IPayloadTable & payloadTable()
Definition: OraDbSchema.cc:249
OraTagTable(IOVCache &cache)
Definition: OraDbSchema.cc:63
bool existsTag(const std::string &tag)
Definition: OraDbSchema.cc:33
cond::IOVEditor editor()
Definition: OraDbSchema.cc:29
cond::DbSession & session()
Definition: OraDbSchema.cc:21
bool select(const std::string &gtName, std::vector< std::tuple< std::string, std::string, std::string > > &tags)
Definition: OraDbSchema.cc:296
bool select(const std::string &name)
Definition: OraDbSchema.cc:262
void update(const std::string &name, cond::Time_t &endOfValidity, const std::string &description, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)
Definition: OraDbSchema.cc:99
void addTag(const std::string &tag, const std::string token)
Definition: OraDbSchema.cc:47
bool getLastIov(const std::string &tag, cond::Time_t &since, cond::Hash &hash)
Definition: OraDbSchema.cc:188
TimeType
Definition: Time.h:21
bool select(const cond::Hash &payloadHash, std::string &objectType, cond::Binary &payloadData)
Definition: OraDbSchema.cc:118
OraGTTable(DbSession &session)
Definition: OraDbSchema.cc:258
void insert(const std::string &gtName, const std::vector< std::tuple< std::string, std::string, std::string > > &tags)
Definition: OraDbSchema.cc:315
unsigned long long Time_t
Definition: Time.h:16
cond::IOVProxy iovSequence()
Definition: OraDbSchema.cc:25
bool getMetadata(const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime)
Definition: OraDbSchema.cc:83
OraIOVSchema(DbSession &session)
Definition: OraDbSchema.cc:226
std::string Hash
Definition: Types.h:38
bool load(const std::string &tag)
Definition: OraDbSchema.cc:56
bool getSize(const std::string &tag, size_t &size)
Definition: OraDbSchema.cc:196
void insertMany(const std::string &tag, const std::vector< std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > > &iovs)
Definition: OraDbSchema.cc:214
void insertOne(const std::string &tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime &insertTime)
Definition: OraDbSchema.cc:207
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)
Definition: OraDbSchema.cc:158
tuple tags
Definition: o2o.py:248
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)
Definition: OraDbSchema.cc:282
tuple description
Definition: idDealer.py:66
OraPayloadTable(DbSession &session)
Definition: OraDbSchema.cc:114
OraGTSchema(DbSession &session)
Definition: OraDbSchema.cc:319
bool getType(const cond::Hash &payloadHash, std::string &objectType)
Definition: OraDbSchema.cc:125
ITagMigrationTable & tagMigrationTable()
Definition: OraDbSchema.cc:253
SynchronizationType
Definition: Types.h:26
OraGTMapTable(DbSession &session)
Definition: OraDbSchema.cc:292
cond::IOVEditor m_iovAccess
Definition: OraDbSchema.h:29
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)
Definition: OraDbSchema.cc:170
size_t selectSnapshotGroups(const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::vector< cond::Time_t > &groups)
Definition: OraDbSchema.cc:152
cond::Hash insertIfNew(const std::string &objectType, const cond::Binary &payloadData, const boost::posix_time::ptime &insertionTime)
Definition: OraDbSchema.cc:130
size_t selectLatest(const std::string &tag, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)
Definition: OraDbSchema.cc:177
void updateValidity(const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)
Definition: OraDbSchema.cc:109
tuple size
Write out results.
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)
Definition: OraDbSchema.cc:91
IOVCache(cond::DbSession &s)
Definition: OraDbSchema.cc:17