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& modificationTime){
110 if( tok.empty() )
throwException(
"Tag \""+name+
"\" has not been found in the database.",
"OraTagTable::update");
117 const boost::posix_time::ptime& ){
126 m_session( session ){
139 if( e.
explainSelf().find(
"has not been found in the database. from ReadBuffer::read") != std::string::npos ) {
156 const boost::posix_time::ptime& ){
178 std::vector<cond::Time_t>& groups ){
184 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
188 for(
auto iov : range ){
189 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
196 const boost::posix_time::ptime&,
197 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
207 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
216 since = last.
since();
233 const boost::posix_time::ptime& ){
235 "OraIOVTable::insertOne");
244 const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ){
246 "OraIOVTable::insertOne");
248 std::vector<std::pair<cond::Time_t, std::string > >
data;
249 data.reserve( iovs.size() );
250 for(
auto v : iovs ){
251 data.push_back( std::make_pair( std::get<0>(
v), std::get<1>(
v) ) );
256 insertOne( tag, std::get<0>(
v), std::get<1>(
v), std::get<2>(
v) );
263 "OraIOVTable::erase" );
268 m_tagTable( m_cache ),
269 m_iovTable( m_cache ),
270 m_payloadTable( session ){
294 throwException(
"Tag Migration interface is not available in this implementation.",
295 "OraIOVSchema::tagMigrationTable");
299 throwException(
"Payload Migration interface is not available in this implementation.",
300 "OraIOVSchema::payloadMigrationTable");
305 return parser.parse( poolToken ).toString();
309 m_session( session ){
322 snapshotTime = boost::posix_time::ptime();
328 std::string&, boost::posix_time::ptime& snapshotTime){
329 return select( name, validity, snapshotTime );
333 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
338 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
343 m_session( session ){
351 std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
352 std::set<cond::TagMetadata>
tmp;
355 if( tmp.size() )
tags.resize( tmp.size() );
357 for(
const auto&
m : tmp ){
359 tags[
i ] = std::make_tuple(
m.recordname,
m.labelname, tagFullName );
370 m_session( session ),
371 m_gtTable( session ),
372 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)
virtual std::string explainSelf() const
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
unsigned int freeInsert(cond::Time_t sinceTime, const std::string &payloadToken)
insert a payload with known since in any position
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
Base exception class for the object to relational access.
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
TimeType timetype() const
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
cond::Time_t timestamp() 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)
IPayloadMigrationTable & payloadMigrationTable()
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())
std::string parsePoolToken(const std::string &poolToken)
tuple size
Write out results.
void throwException(const std::string &message, const std::string &methodName)
std::string comment() const
boost::posix_time::ptime to_boost(Time_t iValue)
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)