1 #ifndef CondCore_CondDB_IOVSchema_h
2 #define CondCore_CondDB_IOVSchema_h
7 #include <boost/date_time/posix_time/posix_time.hpp>
11 namespace persistency {
22 column( INSERTION_TIME, boost::posix_time::ptime );
23 column( MODIFICATION_TIME, boost::posix_time::ptime );
27 explicit Table( coral::ISchema&
schema );
35 boost::posix_time::ptime& insertionTime, boost::posix_time::ptime& modificationTime );
38 cond::Time_t lastValidatedTime,
const boost::posix_time::ptime& insertionTime );
40 cond::Time_t lastValidatedTime,
const boost::posix_time::ptime& updateTime );
41 void updateValidity(
const std::string& name,
cond::Time_t lastValidatedTime,
const boost::posix_time::ptime& updateTime );
42 void setValidationMode(){}
44 coral::ISchema& m_schema;
50 static constexpr unsigned int PAYLOAD_HASH_SIZE = 40;
57 column( INSERTION_TIME, boost::posix_time::ptime );
61 explicit Table( coral::ISchema&
schema );
71 const boost::posix_time::ptime& insertionTime);
73 const cond::Binary& streamerInfoData,
const boost::posix_time::ptime& insertionTime );
75 coral::ISchema& m_schema;
84 column( INSERTION_TIME, boost::posix_time::ptime );
89 static std::string tableName(){
return SINCE::tableName(); }
91 return std::string(
"MAX(")+SINCE::fullyQualifiedName()+
")";
97 static std::string tableName(){
return SINCE::tableName(); }
100 return "("+SINCE::fullyQualifiedName()+
"/"+sgroupSize+
")*"+sgroupSize;
104 struct SEQUENCE_SIZE {
105 typedef unsigned int type;
107 static std::string tableName(){
return SINCE::tableName(); }
115 explicit Table( coral::ISchema&
schema );
119 size_t selectGroups(
const std::string&
tag, std::vector<cond::Time_t>& groups );
120 size_t selectSnapshotGroups(
const std::string& tag,
const boost::posix_time::ptime& snapshotTime,
121 std::vector<cond::Time_t>& groups );
123 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
125 const boost::posix_time::ptime& snapshotTime,
126 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
127 size_t selectLatest(
const std::string& tag, std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
130 bool getSnapshotSize(
const std::string& tag,
const boost::posix_time::ptime& snapshotTime,
size_t& size );
132 void insertMany(
const std::string& tag,
const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs );
135 coral::ISchema& m_schema;
145 column( STATUS_CODE,
int );
146 column( INSERTION_TIME, boost::posix_time::ptime );
150 explicit Table( coral::ISchema&
schema );
156 int statusCode,
const boost::posix_time::ptime& insertionTime);
157 void updateValidationCode(
const std::string& sourceAccount,
const std::string& sourceTag,
int statusCode );
159 coral::ISchema& m_schema;
static constexpr unsigned int SINCE_GROUP_SIZE
PAYLOAD::Table m_payloadTable
unsigned long long Time_t
TAG_MIGRATION::Table m_tagMigrationTable
IPayloadTable & payloadTable()
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
ITagMigrationTable & tagMigrationTable()
IOVSchema(coral::ISchema &schema)
tuple size
Write out results.