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() ) );
214 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
222 since = last.
since();
245 const boost::posix_time::ptime& ){
247 "OraIOVTable::insertOne");
256 const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ){
258 "OraIOVTable::insertOne");
260 std::vector<std::pair<cond::Time_t, std::string > >
data;
261 data.reserve( iovs.size() );
262 for(
auto v : iovs ){
263 data.push_back( std::make_pair( std::get<0>(
v), std::get<1>(
v) ) );
268 insertOne( tag, std::get<0>(
v), std::get<1>(
v), std::get<2>(
v) );
275 "OraIOVTable::erase" );
280 m_tagTable( m_cache ),
281 m_iovTable( m_cache ),
282 m_payloadTable( session ){
306 throwException(
"Tag Migration interface is not available in this implementation.",
307 "OraIOVSchema::tagMigrationTable");
311 throwException(
"Payload Migration interface is not available in this implementation.",
312 "OraIOVSchema::payloadMigrationTable");
317 return parser.parse( poolToken ).toString();
321 m_session( session ){
334 snapshotTime = boost::posix_time::ptime();
340 std::string&, boost::posix_time::ptime& snapshotTime){
341 return select( name, validity, snapshotTime );
345 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
350 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
355 m_session( session ){
363 std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
364 std::set<cond::TagMetadata>
tmp;
367 if( tmp.size() )
tags.resize( tmp.size() );
369 for(
const auto&
m : tmp ){
371 tags[
i ] = std::make_tuple(
m.recordname,
m.labelname, tagFullName );
382 m_session( session ),
383 m_gtTable( session ),
384 m_gtMapTable( session ){
389 throwException(
"GT Schema can't be create in ORA implementation.",
390 "OraGTSchema::create");
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)
bool getSnapshotLastIov(const std::string &tag, const boost::posix_time::ptime &snapshotTime, cond::Time_t &since, cond::Hash &hash)
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)
size_t selectSnapshot(const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)
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)