57 m_closeIOV=iConfig.getUntrackedParameter<
bool>(
"closeIOV",m_closeIOV);
59 m_timetypestr=iConfig.getUntrackedParameter<
std::string >(
"timetype",
"runnumber");
65 connection.configure();
69 m_session = connection.createSession( connectionString,
true, backType );
77 typedef std::vector< edm::ParameterSet >
Parameters;
78 Parameters
toPut=iConfig.getParameter<Parameters>(
"toPut");
79 for(Parameters::iterator itToPut = toPut.begin(); itToPut != toPut.end(); ++itToPut)
80 fillRecord( *itToPut);
111 return this->lookUpRecord(recordName).m_tag;
116 Record& myrecord=this->lookUpRecord(recordName);
123 std::lock_guard<std::recursive_mutex>
lock(m_mutex);
124 m_session.transaction().start(
false);
128 if( !m_session.existsDatabase() ) m_session.createDatabase();
146 m_session.transaction().commit();
169 for(
auto&
time : m_currentTimes) {
176 for(
auto&
time : m_currentTimes) {
208 std::lock_guard<std::recursive_mutex>
lock(m_mutex);
211 Record& myrecord=this->lookUpRecord(recordName);
212 if(!myrecord.m_isNewTag) {
213 cond::throwException( myrecord.m_tag +
" is not a new tag",
"PoolDBOutputService::createNewIOV");
227 editor.
insert( firstSinceTime, firstPayloadId );
229 myrecord.m_isNewTag=
false;
242 "PoolDBOutputService::createNewIOV");
253 std::lock_guard<std::recursive_mutex>
lock(m_mutex);
255 Record& myrecord=this->lookUpRecord(recordName);
256 if(!myrecord.m_isNewTag) {
257 cond::throwException( myrecord.m_tag +
" is not a new tag",
"PoolDBOutputService::createNewIOV");
264 editor.
insert( firstSinceTime, firstPayloadId );
266 myrecord.m_isNewTag=
false;
269 "PoolDBOutputService::createNewIOV");
279 std::lock_guard<std::recursive_mutex>
lock(m_mutex);
281 Record& myrecord=this->lookUpRecord(recordName);
282 if( myrecord.m_isNewTag ) {
284 "PoolDBOutputService::appendSinceTime");
294 editor.
insert( time, payloadId );
309 "PoolDBOutputService::appendSinceTime");
316 std::lock_guard<std::recursive_mutex>
lock(m_mutex);
317 if (!m_dbstarted) this->initDB(
false );
319 std::map<std::string,Record>::iterator it=m_callbacks.find(recordName);
320 if(it==m_callbacks.end()) {
321 cond::throwException(
"The record \""+recordName +
"\" has not been registered.",
"PoolDBOutputService::lookUpRecord");
323 if( !m_session.existsIov( it->second.m_tag) ){
324 it->second.m_isNewTag=
true;
326 it->second.m_isNewTag=
false;
342 std::lock_guard<std::recursive_mutex>
lock(m_mutex);
344 Record & myrecord = lookUpRecord(recordName);
349 "PoolDBOutputService::closeIOV");
377 std::lock_guard<std::recursive_mutex>
lock(m_mutex);
static thread_local int s_streamIndex
const TimeTypeSpecs timeTypeSpecs[]
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void closeIOV(Time_t lastTill, const std::string &recordName, bool withlogging=false)
void initDB(bool forReading=true)
void preEventProcessing(edm::StreamContext const &)
void fillRecord(edm::ParameterSet &pset)
cond::persistency::Session session() const
boost::uint64_t value() const
LuminosityBlockID const & luminosityBlockID() const
std::pair< Time_t, Time_t > ValidityInterval
void setDescription(const std::string &description)
void preGlobalBeginLumi(edm::GlobalContext const &)
void setParameters(const edm::ParameterSet &connectionPset)
std::string tag(const std::string &recordName)
unsigned int maxNumberOfStreams() const
cond::ValidityInterval lastInterval
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
unsigned long long Time_t
vector< ParameterSet > Parameters
TimeType timeTypeFromName(const std::string &name)
bool isNewTagRequest(const std::string &recordName)
Record & lookUpRecord(const std::string &recordName)
cond::Time_t beginOfTime() const
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void setLogHeaderForRecord(const std::string &recordName, const std::string &provenance, const std::string &usertext)
StreamID const & streamID() const
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
unsigned int value() const
virtual ~PoolDBOutputService()
void throwException(std::string const &message, std::string const &methodName)
void tagInfo(const std::string &recordName, cond::TagInfo_t &result)
std::string lastPayloadToken
cond::Time_t endOfTime() const
void preGlobalBeginRun(edm::GlobalContext const &)
static constexpr BackendType DEFAULT_DB
cond::Time_t currentTime() const
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
void setEndOfValidity(cond::Time_t validity)
cond::TimeType m_timetype
std::map< std::string, Record > m_callbacks
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::string m_timetypestr
TimeValue_t value() const
PoolDBOutputService(const edm::ParameterSet &iConfig, edm::ActivityRegistry &iAR)
Timestamp const & timestamp() const