11 #include "RelationalAccess/ISchema.h"
15 namespace persistency {
35 return metadata.
hasTag( t );
58 if( token.empty() )
return false;
84 boost::posix_time::ptime&, boost::posix_time::ptime& ){
103 if( tok.empty() )
throwException(
"Tag \""+name+
"\" has not been found in the database.",
"OraTagTable::update");
110 const boost::posix_time::ptime& ){
115 m_session( session ){
131 const boost::posix_time::ptime& ){
153 std::vector<cond::Time_t>& groups ){
159 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
163 for(
auto iov : range ){
164 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
171 const boost::posix_time::ptime&,
172 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
182 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
191 since = last.
since();
208 const boost::posix_time::ptime& ){
210 "OraIOVTable::insertOne");
215 const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ){
217 "OraIOVTable::insertOne");
218 std::vector<std::pair<cond::Time_t, std::string > >
data;
219 data.reserve( iovs.size() );
220 for(
auto v : iovs ){
221 data.push_back( std::make_pair( std::get<0>(
v), std::get<1>(
v) ) );
228 m_tagTable( m_cache ),
229 m_iovTable( m_cache ),
230 m_payloadTable( session ){
254 throwException(
"Tag Migration interface is not available in this implementation.",
255 "OraIOVSchema::tagMigrationTabl");
259 m_session( session ){
272 snapshotTime = boost::posix_time::ptime();
278 std::string&, boost::posix_time::ptime& snapshotTime){
279 return select( name, validity, snapshotTime );
283 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
288 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
293 m_session( session ){
301 std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
302 std::set<cond::TagMetadata>
tmp;
305 if( tmp.size() )
tags.resize( tmp.size() );
307 for(
const auto&
m : tmp ){
309 tags[
i ] = std::make_tuple(
m.recordname,
m.labelname, tagFullName );
320 m_session( session ),
321 m_gtTable( session ),
322 m_gtMapTable( session ){
OraGTMapTable m_gtMapTable
bool select(const std::string &name)
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)
bool getSnapshotSize(const std::string &tag, const boost::posix_time::ptime &snapshotTime, size_t &size)
size_t selectGroups(const std::string &tag, std::vector< cond::Time_t > &groups)
std::string create(cond::TimeType timetype)
std::string getToken(const std::string &tag)
IGTMapTable & gtMapTable()
IPayloadTable & payloadTable()
bool selectTagCollection(const std::string &globaltag, std::set< cond::TagMetadata > &result)
OraTagTable(IOVCache &cache)
void load(const std::string &token)
std::string classNameForItem(const std::string &objectId)
IOVRange range(cond::Time_t since, cond::Time_t till) const
std::string typeName() const
bool existsTag(const std::string &tag)
cond::DbSession & session()
cond::DbSession m_session
void fromOraObject(const ora::Object &object)
bool select(const std::string >Name, std::vector< std::tuple< std::string, std::string, std::string > > &tags)
bool select(const std::string &name)
std::string const & token() const
std::set< std::string > const & payloadClasses() const
cond::DbSession m_session
void update(const std::string &name, cond::Time_t &endOfValidity, const std::string &description, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)
void addTag(const std::string &tag, const std::string token)
const_iterator end() const
cond::DbSession m_session
bool getLastIov(const std::string &tag, cond::Time_t &since, cond::Hash &hash)
bool select(const cond::Hash &payloadHash, std::string &objectType, cond::Binary &payloadData)
OraGTTable(DbSession &session)
IOVRange tail(int n) const
void insert(const std::string >Name, const std::vector< std::tuple< std::string, std::string, std::string > > &tags)
unsigned long long Time_t
cond::IOVProxy iovSequence()
cond::Time_t lastTill() const
bool getMetadata(const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime)
std::string const & token() const
OraIOVSchema(DbSession &session)
bool load(const std::string &tag)
bool getSize(const std::string &tag, size_t &size)
ora::Object oraObject() const
void insertMany(const std::string &tag, const std::vector< std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > > &iovs)
void insertOne(const std::string &tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime &insertTime)
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)
std::string storeObject(const T *object, const std::string &containerName)
bool existsTagCollection(const std::string &globaltag)
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)
cond::IOVProxy proxy() const
void updateClosure(cond::Time_t newtillTime)
Update the closure of the iov sequence.
unsigned int append(cond::Time_t sinceTime, const std::string &payloadToken)
OraPayloadTable(DbSession &session)
cond::Time_t since() const
cond::Time_t firstSince() const
std::vector< std::vector< double > > tmp
OraGTSchema(DbSession &session)
bool getType(const cond::Hash &payloadHash, std::string &objectType)
OraPayloadTable m_payloadTable
char data[epos_bytes_allocation]
ITagMigrationTable & tagMigrationTable()
OraIOVTable(IOVCache &cache)
void bulkAppend(std::vector< std::pair< cond::Time_t, std::string > > &values)
Bulk append of iov chunck.
TimeType timetype() const
OraGTMapTable(DbSession &session)
void stamp(std::string const &icomment, bool append=false)
cond::IOVEditor m_iovAccess
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)
ora::Object getObject(const std::string &objectId)
size_t selectSnapshotGroups(const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::vector< cond::Time_t > &groups)
cond::Hash insertIfNew(const std::string &objectType, const cond::Binary &payloadData, const boost::posix_time::ptime &insertionTime)
cond::DbSession m_session
ora::Database & storage()
size_t selectLatest(const std::string &tag, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)
void updateValidity(const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime)
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
tuple size
Write out results.
void throwException(const std::string &message, const std::string &methodName)
std::string comment() const
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)
IOVElementProxy back() const
IOVCache(cond::DbSession &s)