CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IOVSchema.cc
Go to the documentation of this file.
2 #include "IOVSchema.h"
3 //
4 #include <openssl/sha.h>
5 
6 namespace cond {
7 
8  namespace persistency {
9 
10  cond::Hash makeHash( const std::string& objectType, const cond::Binary& data ){
11  SHA_CTX ctx;
12  if( !SHA1_Init( &ctx ) ){
13  throwException( "SHA1 initialization error.","IOVSchema::makeHash");
14  }
15  if( !SHA1_Update( &ctx, objectType.c_str(), objectType.size() ) ){
16  throwException( "SHA1 processing error (1).","IOVSchema::makeHash");
17  }
18  if( !SHA1_Update( &ctx, data.data(), data.size() ) ){
19  throwException( "SHA1 processing error (2).","IOVSchema::makeHash");
20  }
21  unsigned char hash[SHA_DIGEST_LENGTH];
22  if( !SHA1_Final(hash, &ctx) ){
23  throwException( "SHA1 finalization error.","IOVSchema::makeHash");
24  }
25 
26  char tmp[SHA_DIGEST_LENGTH*2+1];
27  // re-write bytes in hex
28  for (unsigned int i = 0; i < 20; i++) {
29  ::sprintf(&tmp[i * 2], "%02x", hash[i]);
30  }
31  tmp[20*2] = 0;
32  return tmp;
33  }
34 
35  TAG::Table::Table( coral::ISchema& schema ):
36  m_schema( schema ){
37  }
38 
39  bool TAG::Table::Table::exists(){
40  return existsTable( m_schema, tname );
41  }
42 
44  if( exists() ){
45  throwException( "TAG table already exists in this schema.",
46  "TAG::Table::create");
47  }
49  descr.setPrimaryKey<NAME>();
50  createTable( m_schema, descr.get() );
51  }
52 
54  Query< NAME > q( m_schema );
55  q.addCondition<NAME>( name );
56  for ( auto row : q ) {}
57 
58  return q.retrievedRows();
59  }
60 
62  cond::TimeType& timeType,
63  std::string& objectType,
64  cond::SynchronizationType& synchronizationType,
65  cond::Time_t& endOfValidity,
67  cond::Time_t& lastValidatedTime ){
69  q.addCondition<NAME>( name );
70  for ( auto row : q ) std::tie( timeType, objectType, synchronizationType, endOfValidity, description, lastValidatedTime ) = row;
71 
72  return q.retrievedRows();
73  }
74 
77  boost::posix_time::ptime& insertionTime,
78  boost::posix_time::ptime& modificationTime ){
80  q.addCondition<NAME>( name );
81  for ( auto row : q ) std::tie( description, insertionTime, modificationTime ) = row;
82  return q.retrievedRows();
83  }
84 
86  cond::TimeType timeType,
87  const std::string& objectType,
88  cond::SynchronizationType synchronizationType,
89  cond::Time_t endOfValidity,
90  const std::string& description,
91  cond::Time_t lastValidatedTime,
92  const boost::posix_time::ptime& insertionTime ){
94  dataToInsert( std::tie( name, timeType, objectType, synchronizationType, endOfValidity, description, lastValidatedTime, insertionTime, insertionTime ) );
95  insertInTable( m_schema, tname, dataToInsert.get() );
96  }
97 
99  cond::Time_t& endOfValidity,
100  const std::string& description,
101  cond::Time_t lastValidatedTime,
102  const boost::posix_time::ptime& updateTime ){
103  UpdateBuffer buffer;
104  buffer.setColumnData< END_OF_VALIDITY, DESCRIPTION, LAST_VALIDATED_TIME, MODIFICATION_TIME >( std::tie( endOfValidity, description, lastValidatedTime, updateTime ) );
105  buffer.addWhereCondition<NAME>( name );
106  updateTable( m_schema, tname, buffer );
107  }
108 
110  cond::Time_t lastValidatedTime,
111  const boost::posix_time::ptime& updateTime ){
112  UpdateBuffer buffer;
113  buffer.setColumnData< LAST_VALIDATED_TIME, MODIFICATION_TIME >( std::tie( lastValidatedTime, updateTime ) );
114  buffer.addWhereCondition<NAME>( name );
115  updateTable( m_schema, tname, buffer );
116  }
117 
118  IOV::Table::Table( coral::ISchema& schema ):
119  m_schema( schema ){
120  }
121 
123  return existsTable( m_schema, tname );
124  }
125 
127  if( exists()){
128  throwException( "IOV table already exists in this schema.",
129  "IOV::Schema::create");
130  }
131 
134  descr.setForeignKey< TAG_NAME, TAG::NAME >( "TAG_NAME_FK" );
135  descr.setForeignKey< PAYLOAD_HASH, PAYLOAD::HASH >( "PAYLOAD_HASH_FK" );
136  createTable( m_schema, descr.get() );
137  }
138 
139  size_t IOV::Table::selectGroups( const std::string& tag, std::vector<cond::Time_t>& groups ){
140  Query< SINCE_GROUP > q( m_schema, true );
141  q.addCondition<TAG_NAME>( tag );
144  for( auto row : q ){
145  groups.push_back(std::get<0>(row));
146  }
147  return q.retrievedRows();
148  }
149 
150  size_t IOV::Table::selectSnapshotGroups( const std::string& tag, const boost::posix_time::ptime& snapshotTime, std::vector<cond::Time_t>& groups ){
151  Query< SINCE_GROUP > q( m_schema, true );
152  q.addCondition<TAG_NAME>( tag );
153  q.addCondition<INSERTION_TIME>( snapshotTime,"<=" );
156  for( auto row : q ){
157  groups.push_back(std::get<0>(row));
158  }
159  return q.retrievedRows();
160  }
161 
162  size_t IOV::Table::selectLatestByGroup( const std::string& tag, cond::Time_t lowerSinceGroup, cond::Time_t upperSinceGroup ,
163  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs ){
164  Query< SINCE, PAYLOAD_HASH > q( m_schema );
165  q.addCondition<TAG_NAME>( tag );
166  if( lowerSinceGroup > 0 ) q.addCondition<SINCE>( lowerSinceGroup, ">=" );
167  if( upperSinceGroup < cond::time::MAX_VAL ) q.addCondition<SINCE>( upperSinceGroup, "<" );
168  q.addOrderClause<SINCE>();
170  size_t initialSize = iovs.size();
171  for( auto row : q ){
172  // starting from the second iov in the array, skip the rows with older timestamp
173  if( iovs.size()-initialSize && std::get<0>(iovs.back()) == std::get<0>(row) ) continue;
174  iovs.push_back( row );
175  }
176  return iovs.size()-initialSize;
177  }
178 
179  size_t IOV::Table::selectSnapshotByGroup( const std::string& tag, cond::Time_t lowerSinceGroup, cond::Time_t upperSinceGroup,
180  const boost::posix_time::ptime& snapshotTime,
181  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs ){
182  Query< SINCE, PAYLOAD_HASH > q( m_schema );
183  q.addCondition<TAG_NAME>( tag );
184  if( lowerSinceGroup > 0 ) q.addCondition<SINCE>( lowerSinceGroup, ">=" );
185  if( upperSinceGroup < cond::time::MAX_VAL ) q.addCondition<SINCE>( upperSinceGroup, "<" );
186  q.addCondition<INSERTION_TIME>( snapshotTime,"<=" );
187  q.addOrderClause<SINCE>();
189  size_t initialSize = iovs.size();
190  for ( auto row : q ) {
191  // starting from the second iov in the array, skip the rows with older timestamp
192  if( iovs.size()-initialSize && std::get<0>(iovs.back()) == std::get<0>(row) ) continue;
193  iovs.push_back( row );
194  }
195  return iovs.size()-initialSize;
196  }
197 
199  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs ){
200  Query< SINCE, PAYLOAD_HASH > q( m_schema );
201  q.addCondition<TAG_NAME>( tag );
202  q.addOrderClause<SINCE>();
204  size_t initialSize = iovs.size();
205  for ( auto row : q ) {
206  // starting from the second iov in the array, skip the rows with older timestamp
207  if( iovs.size()-initialSize && std::get<0>(iovs.back()) == std::get<0>(row) ) continue;
208  iovs.push_back( row );
209  }
210  return iovs.size()-initialSize;
211  }
212 
214  const boost::posix_time::ptime& snapshotTime,
215  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
216  Query< SINCE, PAYLOAD_HASH > q( m_schema );
217  q.addCondition<TAG_NAME>( tag );
218  q.addCondition<INSERTION_TIME>( snapshotTime,"<=" );
219  q.addOrderClause<SINCE>();
221  size_t initialSize = iovs.size();
222  for ( auto row : q ) {
223  // starting from the second iov in the array, skip the rows with older timestamp
224  if( iovs.size()-initialSize && std::get<0>(iovs.back()) == std::get<0>(row) ) continue;
225  iovs.push_back( row );
226  }
227  return iovs.size()-initialSize;
228  }
229 
231  Query< SINCE, PAYLOAD_HASH > q( m_schema );
232  q.addCondition<TAG_NAME>( tag );
233  q.addOrderClause<SINCE>( false );
235  for ( auto row : q ) {
236  since = std::get<0>(row);
237  hash = std::get<1>(row);
238  return true;
239  }
240  return false;
241  }
242 
243  bool IOV::Table::getSnapshotLastIov( const std::string& tag, const boost::posix_time::ptime& snapshotTime, cond::Time_t& since, cond::Hash& hash ){
244  Query< SINCE, PAYLOAD_HASH > q( m_schema );
245  q.addCondition<TAG_NAME>( tag );
246  q.addCondition<INSERTION_TIME>( snapshotTime,"<=" );
247  q.addOrderClause<SINCE>( false );
249  for ( auto row : q ) {
250  since = std::get<0>(row);
251  hash = std::get<1>(row);
252  return true;
253  }
254  return false;
255  }
256 
257  bool IOV::Table::getSize( const std::string& tag, size_t& size ){
258  Query< SEQUENCE_SIZE > q( m_schema );
259  q.addCondition<TAG_NAME>( tag );
260  for ( auto row : q ) {
261  size = std::get<0>(row);
262  return true;
263  }
264  return false;
265  }
266 
267  bool IOV::Table::getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size ){
268  Query< SEQUENCE_SIZE > q( m_schema );
269  q.addCondition<TAG_NAME>( tag );
270  q.addCondition<INSERTION_TIME>( snapshotTime,"<=" );
271  for ( auto row : q ) {
272  size = std::get<0>(row);
273  return true;
274  }
275  return false;
276  }
277 
279  cond::Time_t since,
280  cond::Hash payloadHash,
281  const boost::posix_time::ptime& insertTimeStamp ){
282  RowBuffer< TAG_NAME, SINCE, PAYLOAD_HASH, INSERTION_TIME > dataToInsert( std::tie( tag, since, payloadHash, insertTimeStamp ) );
283  insertInTable( m_schema, tname, dataToInsert.get() );
284  }
285 
287  const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ){
289  for( auto row : iovs ) inserter.insert( std::tuple_cat( std::tie(tag),row ) );
290 
291  inserter.flush();
292  }
293 
295  DeleteBuffer buffer;
296  buffer.addWhereCondition<TAG_NAME>( tag );
297  deleteFromTable( m_schema, tname, buffer );
298  }
299 
300  PAYLOAD::Table::Table( coral::ISchema& schema ):
301  m_schema( schema ){
302  }
303 
305  return existsTable( m_schema, tname );
306  }
307 
309  if( exists()){
310  throwException( "Payload table already exists in this schema.",
311  "PAYLOAD::Schema::create");
312  }
313 
315  descr.setPrimaryKey<HASH>();
316  createTable( m_schema, descr.get() );
317  }
318 
319  bool PAYLOAD::Table::select( const cond::Hash& payloadHash ){
320  Query< HASH > q( m_schema );
321  q.addCondition<HASH>( payloadHash );
322  for ( auto row : q ) {}
323 
324  return q.retrievedRows();
325  }
326 
327  bool PAYLOAD::Table::getType( const cond::Hash& payloadHash, std::string& objectType ){
328  Query< OBJECT_TYPE > q( m_schema );
329  q.addCondition<HASH>( payloadHash );
330  for ( auto row : q ) {
331  objectType = std::get<0>(row);
332  }
333 
334  return q.retrievedRows();
335  }
336 
337  bool PAYLOAD::Table::select( const cond::Hash& payloadHash,
338  std::string& objectType,
339  cond::Binary& payloadData,
340  cond::Binary& streamerInfoData ){
342  q.addCondition<HASH>( payloadHash );
343  for ( auto row : q ) {
344  std::tie( payloadData, streamerInfoData, objectType ) = row;
345  }
346  return q.retrievedRows();
347  }
348 
349  bool PAYLOAD::Table::insert( const cond::Hash& payloadHash,
350  const std::string& objectType,
351  const cond::Binary& payloadData,
352  const cond::Binary& streamerInfoData,
353  const boost::posix_time::ptime& insertionTime ){
354  std::string version("dummy");
355  cond::Binary sinfoData( streamerInfoData );
356  if( !sinfoData.size() ) sinfoData.copy( std::string("0") );
357  RowBuffer< HASH, OBJECT_TYPE, DATA, STREAMER_INFO, VERSION, INSERTION_TIME > dataToInsert( std::tie( payloadHash, objectType, payloadData, sinfoData, version, insertionTime ) );
358  bool failOnDuplicate = false;
359  return insertInTable( m_schema, tname, dataToInsert.get(), failOnDuplicate );
360  }
361 
363  const cond::Binary& payloadData,
364  const cond::Binary& streamerInfoData,
365  const boost::posix_time::ptime& insertionTime ){
366  cond::Hash payloadHash = makeHash( payloadObjectType, payloadData );
367  // the check on the hash existance is only required to avoid the error message printing in SQLite! once this is removed, this check is useless...
368  if( !select( payloadHash ) ){
369  insert( payloadHash, payloadObjectType, payloadData, streamerInfoData, insertionTime );
370  }
371  return payloadHash;
372  }
373 
375  m_schema( schema ){
376  }
377 
379  return existsTable( m_schema, tname );
380  }
381 
383  if( exists() ){
384  throwException( "TAG_MIGRATION table already exists in this schema.",
385  "TAG_MIGRATION::create");
386  }
389  descr.setForeignKey< TAG_NAME, TAG::NAME >( "TAG_NAME_FK" );
390  createTable( m_schema, descr.get() );
391  }
392 
393  bool TAG_MIGRATION::Table::select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName, int& statusCode ){
394  Query< TAG_NAME, STATUS_CODE > q( m_schema );
395  q.addCondition<SOURCE_ACCOUNT>( sourceAccount );
397  for ( auto row : q ) {
398  std::tie( tagName, statusCode ) = row;
399  }
400 
401  return q.retrievedRows();
402 
403  }
404 
405  void TAG_MIGRATION::Table::insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
406  int statusCode, const boost::posix_time::ptime& insertionTime ){
408  dataToInsert( std::tie( sourceAccount, sourceTag, tagName, statusCode, insertionTime ) );
409  insertInTable( m_schema, tname, dataToInsert.get() );
410  }
411 
412  void TAG_MIGRATION::Table::updateValidationCode( const std::string& sourceAccount, const std::string& sourceTag, int statusCode ){
413  UpdateBuffer buffer;
414  buffer.setColumnData< STATUS_CODE >( std::tie( statusCode ) );
415  buffer.addWhereCondition<SOURCE_ACCOUNT>( sourceAccount );
417  updateTable( m_schema, tname, buffer );
418  }
419 
421  m_schema( schema ){
422  }
423 
425  return existsTable( m_schema, tname );
426  }
427 
429  if( exists() ){
430  throwException( "PAYLOAD_MIGRATION table already exists in this schema.",
431  "PAYLOAD_MIGRATION::create");
432  }
435  descr.setForeignKey< PAYLOAD_HASH, PAYLOAD::HASH >( "PAYLOAD_HASH_FK" );
436  createTable( m_schema, descr.get() );
437  }
438 
439  bool PAYLOAD_MIGRATION::Table::select( const std::string& sourceAccount, const std::string& sourceToken, std::string& payloadId ){
440  Query< PAYLOAD_HASH > q( m_schema );
441  q.addCondition<SOURCE_ACCOUNT>( sourceAccount );
442  q.addCondition<SOURCE_TOKEN>( sourceToken );
443  for ( auto row : q ) {
444  std::tie( payloadId ) = row;
445  }
446 
447  return q.retrievedRows();
448  }
449 
450  void PAYLOAD_MIGRATION::Table::insert( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
451  const boost::posix_time::ptime& insertionTime ){
453  dataToInsert( std::tie( sourceAccount, sourceToken, payloadId, insertionTime ) );
454  insertInTable( m_schema, tname, dataToInsert.get() );
455  }
456 
457  void PAYLOAD_MIGRATION::Table::update( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
458  const boost::posix_time::ptime& insertionTime ){
459  UpdateBuffer buffer;
460  buffer.setColumnData< PAYLOAD_HASH, INSERTION_TIME >( std::tie( payloadId, insertionTime ) );
461  buffer.addWhereCondition<SOURCE_ACCOUNT>( sourceAccount );
462  buffer.addWhereCondition<SOURCE_TOKEN>( sourceToken );
463  updateTable( m_schema, tname, buffer );
464  }
465 
466  IOVSchema::IOVSchema( coral::ISchema& schema ):
467  m_tagTable( schema ),
468  m_iovTable( schema ),
469  m_payloadTable( schema ),
470  m_tagMigrationTable( schema ),
471  m_payloadMigrationTable( schema ){
472  }
473 
475  if( !m_tagTable.exists() ) return false;
476  if( !m_payloadTable.exists() ) return false;
477  if( !m_iovTable.exists() ) return false;
478  return true;
479  }
480 
482  bool created = false;
483  if( !exists() ){
484  m_tagTable.create();
486  m_iovTable.create();
487  created = true;
488  }
489  return created;
490  }
491 
493  return m_tagTable;
494  }
495 
497  return m_iovTable;
498  }
499 
501  return m_payloadTable;
502  }
503 
505  return m_tagMigrationTable;
506  }
507 
510  }
511 
513  throwException("CondDB V2 can't parse a pool token.","IOVSchema::parsePoolToken");
514  }
515  }
516 }
517 
void updateValidationCode(const std::string &sourceAccount, const std::string &sourceTag, int statusCode)
Definition: IOVSchema.cc:412
int i
Definition: DBlmapReader.cc:9
bool getSnapshotLastIov(const std::string &tag, const boost::posix_time::ptime &snapshotTime, cond::Time_t &since, cond::Hash &hash)
Definition: IOVSchema.cc:243
bool select(const std::string &sourceAccount, const std::string &sourceToken, std::string &payloadId)
Definition: IOVSchema.cc:439
bool getSnapshotSize(const std::string &tag, const boost::posix_time::ptime &snapshotTime, size_t &size)
Definition: IOVSchema.cc:267
static std::string group()
Definition: IOVSchema.h:93
static char const * tname
Definition: IOVSchema.h:139
bool getSize(const std::string &tag, size_t &size)
Definition: IOVSchema.cc:257
const coral::TableDescription & get()
Definition: DbCore.h:266
void insert(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId, const boost::posix_time::ptime &insertionTime)
Definition: IOVSchema.cc:450
void updateValidity(const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)
Definition: IOVSchema.cc:109
void insert(const P &params)
Definition: DbCore.h:588
size_t selectLatest(const std::string &tag, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)
Definition: IOVSchema.cc:198
bool getLastIov(const std::string &tag, cond::Time_t &since, cond::Hash &hash)
Definition: IOVSchema.cc:230
PAYLOAD::Table m_payloadTable
Definition: IOVSchema.h:201
TimeType
Definition: Time.h:21
size_t size() const
Definition: Binary.cc:57
std::string parsePoolToken(const std::string &)
Definition: IOVSchema.cc:512
void insertMany(const std::string &tag, const std::vector< std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > > &iovs)
Definition: IOVSchema.cc:286
size_t selectGroups(const std::string &tag, std::vector< cond::Time_t > &groups)
Definition: IOVSchema.cc:139
static char const * tname
Definition: IOVSchema.h:48
void update(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId, const boost::posix_time::ptime &insertionTime)
Definition: IOVSchema.cc:457
void setForeignKey(const std::string &name)
Definition: DbCore.h:261
bool select(const cond::Hash &payloadHash)
Definition: IOVSchema.cc:319
unsigned long long Time_t
Definition: Time.h:16
void addCondition(const T &value, const std::string condition="=")
Definition: DbCore.h:428
static char const * tname
Definition: IOVSchema.h:13
bool select(const std::string &sourceAccount, const std::string &sourceTag, std::string &tagName, int &statusCode)
Definition: IOVSchema.cc:393
const coral::AttributeList & get() const
Definition: DbCore.h:171
void addOrderClause(bool ascending=true)
Definition: DbCore.h:439
TAG_MIGRATION::Table m_tagMigrationTable
Definition: IOVSchema.h:202
std::string Hash
Definition: Types.h:47
void erase(const std::string &tag)
Definition: IOVSchema.cc:294
void copy(const std::string &source)
Definition: Binary.cc:42
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: IOVSchema.cc:98
IPayloadTable & payloadTable()
Definition: IOVSchema.cc:500
PAYLOAD_MIGRATION::Table m_payloadMigrationTable
Definition: IOVSchema.h:203
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
bool select(const std::string &name)
Definition: IOVSchema.cc:53
ITagMigrationTable & tagMigrationTable()
Definition: IOVSchema.cc:504
bool getType(const cond::Hash &payloadHash, std::string &objectType)
Definition: IOVSchema.cc:327
const void * data() const
Definition: Binary.cc:48
tuple description
Definition: idDealer.py:66
void setColumnData(const Params &params)
Definition: DbCore.h:512
Table(coral::ISchema &schema)
Definition: IOVSchema.cc:300
IOVSchema(coral::ISchema &schema)
Definition: IOVSchema.cc:466
cond::Hash insertIfNew(const std::string &objectType, const cond::Binary &payloadData, const cond::Binary &streamerInfoData, const boost::posix_time::ptime &insertionTime)
Definition: IOVSchema.cc:362
size_t selectSnapshot(const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)
Definition: IOVSchema.cc:213
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void groupBy(const std::string &expression)
Definition: DbCore.h:445
cond::Hash makeHash(const std::string &objectType, const cond::Binary &data)
Definition: IOVSchema.cc:10
SynchronizationType
Definition: Types.h:31
Table(coral::ISchema &schema)
Definition: IOVSchema.cc:35
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: IOVSchema.cc:179
bool insert(const cond::Hash &payloadHash, const std::string &objectType, const cond::Binary &payloadData, const cond::Binary &streamerInfoData, const boost::posix_time::ptime &insertionTime)
Definition: IOVSchema.cc:349
volatile std::atomic< bool > shutdown_flag false
void insert(const std::string &sourceAccount, const std::string &sourceTag, const std::string &tagName, int statusCode, const boost::posix_time::ptime &insertionTime)
Definition: IOVSchema.cc:405
IPayloadMigrationTable & payloadMigrationTable()
Definition: IOVSchema.cc:508
Table(coral::ISchema &schema)
Definition: IOVSchema.cc:118
static char const * tname
Definition: IOVSchema.h:79
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: IOVSchema.cc:85
void addWhereCondition(const P &param, const std::string condition="=")
Definition: DbCore.h:521
bool getMetadata(const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime)
Definition: IOVSchema.cc:75
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
void insertOne(const std::string &tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime &insertTime)
Definition: IOVSchema.cc:278
tuple size
Write out results.
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
size_t selectSnapshotGroups(const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::vector< cond::Time_t > &groups)
Definition: IOVSchema.cc:150
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: IOVSchema.cc:162
void addWhereCondition(const P &param, const std::string condition="=")
Definition: DbCore.h:555