4 #include <openssl/sha.h> 8 namespace persistency {
12 bool RUN_INFO::Table::Table::exists() {
return existsTable(m_schema,
tname); }
16 throwException(
"RUN_INFO table already exists in this schema.",
"RUN_INFO::Table::create");
20 createTable(m_schema, descr.
get());
24 boost::posix_time::ptime&
start,
25 boost::posix_time::ptime&
end) {
44 }
catch (
const coral::AttributeException&
e) {
46 if (message.find(
"Attempt to access data of NULL attribute") != 0)
56 std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData) {
61 upper = std::get<0>(
r);
64 q1.addCondition<
RUN_NUMBER>(lower,
">=").addCondition<RUN_NUMBER>(upper,
"<=");
65 size_t prevSize = runData.size();
69 return runData.size() > prevSize;
73 const boost::posix_time::ptime& lower,
74 const boost::posix_time::ptime& upper,
75 std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData) {
76 boost::posix_time::ptime
up = upper;
80 bool found =
q0.retrievedRows();
89 q2.addCondition<
END_TIME>(lower,
">=").addCondition<START_TIME>(
up,
"<=");
90 size_t prevSize = runData.size();
94 return runData.size() > prevSize;
98 const boost::posix_time::ptime&
start,
99 const boost::posix_time::ptime&
end) {
101 insertInTable(m_schema,
tname, dataToInsert.
get());
105 const std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >&
runs) {
128 bool created =
false;
bool getInclusiveRunRange(cond::Time_t lower, cond::Time_t upper, std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runData) override
IRunInfoTable & runInfoTable() override
ret
prodAgent to be discontinued
const coral::TableDescription & get()
RUN_INFO::Table m_runInfoTable
void insert(const P ¶ms)
void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime &end) override
unsigned long long Time_t
Query & addCondition(const T &value, const std::string condition="=")
const coral::AttributeList & get() const
static constexpr char const * tname
void insertOne(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end) override
bool select(cond::Time_t runNumber, boost::posix_time::ptime &start, boost::posix_time::ptime &end) override
void insert(const std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runs) override
Table(coral::ISchema &schema)
bool getInclusiveTimeRange(const boost::posix_time::ptime &lower, const boost::posix_time::ptime &upper, std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runData) override
RunInfoSchema(coral::ISchema &schema)
cond::Time_t getLastInserted(boost::posix_time::ptime &start, boost::posix_time::ptime &end) override
void throwException(const std::string &message, const std::string &methodName)