8 namespace persistency {
33 std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >
iovBuffer;
53 const boost::posix_time::ptime& creationTime ):
58 m_data->payloadType = payloadObjectType;
60 m_data->creationTime = creationTime;
66 m_session( rhs.m_session ){
108 m_data->changes.insert(
"SynchronizationType");
118 m_data->endOfValidity = time;
120 m_data->changes.insert(
"EndOfValidity");
132 m_data->changes.insert(
"Description");
142 m_data->lastValidatedTime = time;
144 m_data->changes.insert(
"LastValidatedTime");
153 boost::posix_time::ptime
now = boost::posix_time::microsec_clock::universal_time();
154 insert( since, payloadHash, now, checkType );
160 m_data->iovBuffer.push_back( std::tie( since, payloadHash, insertionTime ) );
164 bool iovSorter(
const std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime>&
f,
const std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime>&
s ){
165 return std::get<0>(
f) < std::get<0>(s);
172 if( lt.empty() ) lt =
"-";
174 if(
m_data->description.empty() )
throwException(
"A non-empty description string is mandatory.",
"IOVEditor::flush" );
175 if(
m_data->validationMode )
m_session->iovSchema().tagTable().setValidationMode();
178 if(
m_data->creationTime.is_not_a_date_time() )
m_data->creationTime = operationTime;
182 if(
m_session->iovSchema().tagLogTable().exists() )
183 m_session->iovSchema().tagLogTable().insert(
m_data->tag,
m_data->creationTime, cond::getUserName(),cond::getHostName(), cond::getCommand(),
189 m_data->lastValidatedTime, operationTime );
190 if(
m_session->iovSchema().tagLogTable().exists() ){
195 if( i==(
m_data->changes.size()-1) ) action +=
".";
199 m_session->iovSchema().tagLogTable().insert(
m_data->tag, operationTime, cond::getUserName(),cond::getHostName(), cond::getCommand(),
206 if(
m_data->iovBuffer.size() ) {
220 std::stringstream
msg;
221 msg <<
"Can't insert iov since "<<l<<
" on the tag "<<
m_data->tag<<
": last since is "<<last<<
228 boost::posix_time::ptime& insertionTime = std::get<2>(
iov);
229 if( insertionTime.is_not_a_date_time() ) insertionTime = operationTime;
233 std::stringstream
msg;
234 msg <<
m_data->iovBuffer.size() <<
" iov(s) inserted.";
235 if(
m_session->iovSchema().tagLogTable().exists() ){
236 m_session->iovSchema().tagLogTable().insert(
m_data->tag, operationTime, cond::getUserName(), cond::getHostName(), cond::getCommand(),
239 m_data->iovBuffer.clear();
247 return flush( logText, boost::posix_time::microsec_clock::universal_time(),
false );
255 return flush(
std::string(
"-"), boost::posix_time::microsec_clock::universal_time(),
false );
259 return flush( logText, boost::posix_time::microsec_clock::universal_time(), forceInsertion );
tuple ret
prodAgent to be discontinued
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::string synchronizationTypeNames(SynchronizationType type)
void checkTransaction(const std::string &ctx)
cond::Time_t lastValidatedTime
void load(const std::string &tag)
void setDescription(const std::string &description)
std::set< std::string > changes
void setLastValidatedTime(cond::Time_t time)
std::shared_ptr< SessionImpl > m_session
void throwException(const std::string &message, const std::string &methodName)
std::string description() const
unsigned long long Time_t
IOVEditor & operator=(const IOVEditor &rhs)
cond::SynchronizationType synchronizationType() const
cond::Time_t endOfValidity() const
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
cond::Time_t endOfValidity
std::shared_ptr< IOVEditorData > m_data
bool iovSorter(const std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > &f, const std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > &s)
cond::TimeType timeType() const
boost::posix_time::ptime creationTime
cond::Time_t lastValidatedTime() const
cond::SynchronizationType synchronizationType
< trclass="colgroup">< tdclass="colgroup"colspan=5 > DT local reconstruction</td ></tr >< tr >< td >< ahref="classDTRecHit1DPair.html"> DTRecHit1DPair</a ></td >< td >< ahref="DataFormats_DTRecHit.html"> edm::RangeMap & lt
std::vector< std::tuple< cond::Time_t, cond::Hash, boost::posix_time::ptime > > iovBuffer
void setEndOfValidity(cond::Time_t validity)
void setSynchronizationType(cond::SynchronizationType synchronizationType)
std::string payloadType() const
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
void throwException(const std::string &message, const std::string &methodName)