11 #include "RelationalAccess/ISchema.h"
15 namespace persistency {
35 return metadata.
hasTag( t );
58 if( token.empty() )
return false;
88 boost::posix_time::ptime&, boost::posix_time::ptime& ){
109 if( tok.empty() )
throwException(
"Tag \""+name+
"\" has not been found in the database.",
"OraTagTable::update");
116 const boost::posix_time::ptime& ){
125 m_session( session ){
147 const boost::posix_time::ptime& ){
169 std::vector<cond::Time_t>& groups ){
175 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
179 for(
auto iov : range ){
180 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
187 const boost::posix_time::ptime&,
188 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
198 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
207 since = last.
since();
224 const boost::posix_time::ptime& ){
226 "OraIOVTable::insertOne");
231 const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ){
233 "OraIOVTable::insertOne");
234 std::vector<std::pair<cond::Time_t, std::string > >
data;
235 data.reserve( iovs.size() );
236 for(
auto v : iovs ){
237 data.push_back( std::make_pair( std::get<0>(
v), std::get<1>(
v) ) );
244 "OraIOVTable::erase" );
249 m_tagTable( m_cache ),
250 m_iovTable( m_cache ),
251 m_payloadTable( session ){
275 throwException(
"Tag Migration interface is not available in this implementation.",
276 "OraIOVSchema::tagMigrationTabl");
280 m_session( session ){
293 snapshotTime = boost::posix_time::ptime();
299 std::string&, boost::posix_time::ptime& snapshotTime){
300 return select( name, validity, snapshotTime );
304 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
309 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
314 m_session( session ){
322 std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
323 std::set<cond::TagMetadata>
tmp;
326 if( tmp.size() )
tags.resize( tmp.size() );
328 for(
const auto&
m : tmp ){
330 tags[
i ] = std::make_tuple(
m.recordname,
m.labelname, tagFullName );
341 m_session( session ),
342 m_gtTable( session ),
343 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
cond::DbSession m_session
IOVRange head(int n) const
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, cond::Binary &streamerInfoData)
IOVElementProxy front() const
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)
void erase(const std::string &tag)
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)
cond::Hash insertIfNew(const std::string &objectType, const cond::Binary &payloadData, const cond::Binary &streamerInfoData, const boost::posix_time::ptime &insertionTime)
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::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)