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) {
31 std::tie(start, end) =
r;
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;
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) {
116 updateTable(m_schema,
tname, buffer);
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
tuple ret
prodAgent to be discontinued
IRunInfoTable & runInfoTable() override
const coral::TableDescription & get()
RUN_INFO::Table m_runInfoTable
void insert(const P ¶ms)
size_t retrievedRows() const
void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime &end) override
unsigned long long Time_t
const coral::AttributeList & get() const
Query & addCondition(const T &value, const std::string condition="=")
static constexpr char const * tname
void insertOne(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end) override
void setColumnData(const Params ¶ms)
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 addWhereCondition(const P ¶m, const std::string condition="=")
void throwException(const std::string &message, const std::string &methodName)