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& ){
132 void* ptr = payloadData.
share().get();
154 std::vector<cond::Time_t>& groups ){
160 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
164 for(
auto iov : range ){
165 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
172 const boost::posix_time::ptime&,
173 std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs){
183 iovs.push_back( std::make_tuple(
iov.since(),
iov.token() ) );
192 since = last.
since();
209 const boost::posix_time::ptime& ){
211 "OraIOVTable::insertOne");
216 const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs ){
218 "OraIOVTable::insertOne");
219 std::vector<std::pair<cond::Time_t, std::string > >
data;
220 data.reserve( iovs.size() );
221 for(
auto v : iovs ){
222 data.push_back( std::make_pair( std::get<0>(
v), std::get<1>(
v) ) );
229 m_tagTable( m_cache ),
230 m_iovTable( m_cache ),
231 m_payloadTable( session ){
255 throwException(
"Tag Migration interface is not available in this implementation.",
256 "OraIOVSchema::tagMigrationTabl");
260 m_session( session ){
273 snapshotTime = boost::posix_time::ptime();
279 std::string&, boost::posix_time::ptime& snapshotTime){
280 return select( name, validity, snapshotTime );
284 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
289 const boost::posix_time::ptime&,
const boost::posix_time::ptime& ){
294 m_session( session ){
302 std::vector<std::tuple<std::string,std::string,std::string> >&
tags ){
303 std::set<cond::TagMetadata>
tmp;
306 if( tmp.size() )
tags.resize( tmp.size() );
308 for(
const auto&
m : tmp ){
310 tags[
i ] = std::make_tuple(
m.recordname,
m.labelname, tagFullName );
321 m_session( session ),
322 m_gtTable( session ),
323 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
boost::shared_ptr< void > makeShared() const
std::string typeName() const
bool existsTag(const std::string &tag)
cond::DbSession & session()
cond::DbSession m_session
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)
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
boost::shared_ptr< void > share() const
IOVCache(cond::DbSession &s)