6 namespace persistency {
37 m_lastTill(cond::time::
MIN_VAL),
38 m_endOfValidity(cond::time::
MAX_VAL){
45 m_timeType( timeType ),
46 m_lastTill( lastTill ),
47 m_endOfValidity( endOfValidity ){
51 m_current( rhs.m_current ),
53 m_timeType( rhs.m_timeType ),
54 m_lastTill( rhs.m_lastTill ),
55 m_endOfValidity( rhs.m_endOfValidity ){
71 retVal.
since = std::get<0>(*m_current);
72 auto next = m_current;
76 retVal.
till = m_endOfValidity;
82 retVal.
till = m_lastTill;
84 retVal.
payloadId = std::get<1>(*m_current);
100 if( m_current != rhs.
m_current )
return false;
101 if( m_end != rhs.
m_end )
return false;
116 m_session( session ){
120 m_data( rhs.m_data ),
121 m_session( rhs.m_session ){
132 boost::posix_time::ptime notime;
133 load( tag, notime, full );
137 const boost::posix_time::ptime& snapshotTime,
139 if( !
m_data.get() )
return;
148 m_data->endOfValidity, dummy,
m_data->lastValidatedTime ) ){
149 throwException(
"Tag \""+tag+
"\" has not been found in the database "+
m_session->connectionString,
"IOVProxy::load");
156 if( snapshotTime.is_not_a_date_time() ){
164 if( snapshotTime.is_not_a_date_time() ){
167 m_session->iovSchema().iovTable().selectSnapshotGroups(
m_data->tag, snapshotTime,
m_data->sinceGroups );
170 m_data->snapshotTime = snapshotTime;
181 m_data->sinceGroups.clear();
182 m_data->iovSequence.clear();
183 m_data->numberOfQueries = 0;
214 std::tuple<std::string, boost::posix_time::ptime, boost::posix_time::ptime >
ret;
215 if(!
m_session->iovSchema().tagTable().getMetadata(
m_data->tag, std::get<0>( ret ), std::get<1>( ret ), std::get<2>( ret ) ) ){
216 throwException(
"Metadata for tag \""+
m_data->tag+
"\" have not been found in the database.",
"IOVProxy::getMetadata()");
222 return m_data.get() ? (
m_data->sinceGroups.size()==0 &&
m_data->iovSequence.size()==0 ) :
true;
231 m_data->iovSequence.clear();
232 if(
m_data->snapshotTime.is_not_a_date_time() ){
233 m_session->iovSchema().iovTable().selectLatestByGroup(
m_data->tag, lowerGroup, higherGroup,
m_data->iovSequence );
235 m_session->iovSchema().iovTable().selectSnapshotByGroup(
m_data->tag, lowerGroup, higherGroup,
m_data->snapshotTime,
m_data->iovSequence );
238 if(
m_data->iovSequence.empty() ){
243 m_data->groupLowerIov = std::get<0>(
m_data->iovSequence.front() );
248 m_data->groupHigherIov = higherGroup-1;
254 m_data->numberOfQueries++;
282 template <
typename T>
typename std::vector<T>::const_iterator
search(
const cond::Time_t& val,
const std::vector<T>& container ){
283 if( !container.size() )
return container.end();
284 auto p = std::upper_bound( container.begin(), container.end(), val,
IOVComp() );
285 return (
p!= container.begin()) ?
p-1 : container.end();
293 time < m_data->groupLowerIov || time >=
m_data->groupHigherIov ){
298 if( iGLow ==
m_data->sinceGroups.end() ){
306 if( iGHigh !=
m_data->sinceGroups.end() ) highG = *iGHigh;
319 if( valid ==
end() ){
320 throwException(
"Can't find a valid interval for the specified time.",
"IOVProxy::getInterval");
329 if(
m_data->snapshotTime.is_not_a_date_time() ){
345 if(
m_data->snapshotTime.is_not_a_date_time() ){
void fetchSequence(cond::Time_t lowerGroup, cond::Time_t higherGroup)
cond::Time_t endOfValidity
void checkTransaction(const std::string &ctx) const
cond::Time_t m_endOfValidity
tuple ret
prodAgent to be discontinued
cond::SynchronizationType synchronizationType() const
std::shared_ptr< SessionImpl > m_session
bool operator()(const cond::Time_t &x, const std::tuple< cond::Time_t, cond::Hash > &y)
bool operator()(const cond::Time_t &x, const cond::Time_t &y)
IOVProxy & operator=(const IOVProxy &rhs)
void load(const std::string &tag, bool full=false)
std::vector< T >::const_iterator search(const cond::Time_t &val, const std::vector< T > &container)
std::pair< cond::Time_t, cond::Time_t > loadedGroup() const
std::string payloadObjectType() const
bool operator!=(const Iterator &rhs) const
IOVProxy::IOVContainer iovSequence
Iterator & operator=(const Iterator &rhs)
std::tuple< std::string, boost::posix_time::ptime, boost::posix_time::ptime > getMetadata() const
cond::TimeType timeType() const
unsigned long long Time_t
IOVContainer::const_iterator m_current
std::vector< std::tuple< cond::Time_t, cond::Hash > > IOVContainer
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
Iterator find(cond::Time_t time)
cond::Iov_t getInterval(cond::Time_t time)
IOVContainer::const_iterator m_end
cond::Time_t endOfValidity() const
boost::posix_time::ptime snapshotTime
cond::TimeType m_timeType
cond::Time_t lastValidatedTime
cond::Time_t lastValidatedTime() const
std::shared_ptr< IOVProxyData > m_data
Time_t tillTimeFromNextSince(Time_t nextSince, TimeType timeType)
std::vector< std::vector< double > > tmp
cond::Time_t groupHigherIov
cond::Time_t groupLowerIov
cond::SynchronizationType synchronizationType
bool operator==(const Iterator &rhs) const
std::vector< cond::Time_t > sinceGroups
size_t numberOfQueries() const
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
void throwException(const std::string &message, const std::string &methodName)
const std::shared_ptr< SessionImpl > & session() const