1 #ifndef CondCore_PoolDBOutputService_h
2 #define CondCore_PoolDBOutputService_h
63 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
66 Hash thePayloadHash(
"");
78 if (time <= lastSince) {
79 m_logger.
logInfo() <<
"Won't append iov with since " << std::to_string(time)
80 <<
", because is less or equal to last available since = " << lastSince;
84 return thePayloadHash;
90 createNewIOV(thePayloadHash, payloadType, time, myrecord);
105 return thePayloadHash;
109 template <
typename T>
112 throwException(
"Provided payload pointer is invalid.",
"PoolDBOutputService::writeOne");
113 std::unique_ptr<const T>
payload(payloadPtr);
117 template <
typename T>
119 if (iovAndPayloads.empty())
121 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
145 for (
auto& iovEntry : iovAndPayloads) {
146 Time_t time = iovEntry.first;
147 auto payload = iovEntry.second;
149 if (time <= lastSince) {
150 m_logger.
logInfo() <<
"Won't append iov with since " << std::to_string(time)
151 <<
", because is less or equal to last available since = " << lastSince;
156 editor.
insert(time, payloadHash);
173 template <
typename T>
175 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
185 createNewIOV(payloadId, cond::demangledName(
typeid(payload)), firstSinceTime, myrecord);
193 template <
typename T>
196 throwException(
"Provided payload pointer is invalid.",
"PoolDBOutputService::createNewIOV");
197 std::unique_ptr<const T>
payload(payloadPtr);
201 template <
typename T>
203 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
207 "PoolDBOutputService::appendSinceTime");
220 template <
typename T>
223 throwException(
"Provided payload pointer is invalid.",
"PoolDBOutputService::appendSinceTime");
224 std::unique_ptr<const T>
payload(payloadPtr);
const TimeTypeSpecs timeTypeSpecs[]
void preEventProcessing(edm::StreamContext const &)
void fillRecord(edm::ParameterSet &pset, const std::string &gTimeTypeStr)
std::map< std::string, cond::UserLogInfo > m_logheaders
EchoedLogStream< edm::LogWarning > logWarning()
cond::persistency::Session session() const
void doStartTransaction()
std::vector< cond::Time_t > m_currentTimes
IOVEditor createIov(const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
void setDescription(const std::string &description)
void preGlobalBeginLumi(edm::GlobalContext const &)
Transaction & transaction()
void throwException(const std::string &message, const std::string &methodName)
Hash writeOne(const T *payloadPtr, Time_t time, const std::string &recordName)
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
std::string tag(const std::string &recordName)
void appendSinceTime(const T *payloadPtr, cond::Time_t sinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
void closeIOV(Time_t lastTill, const std::string &recordName)
unsigned long long Time_t
bool isNewTagRequest(const std::string &recordName)
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Logger & logger()
cond::persistency::ConnectionPool m_connection
cond::Time_t beginOfTime() const
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
cond::persistency::Session m_session
cond::TimeType m_timetype
void setLogHeaderForRecord(const std::string &recordName, const std::string &provenance, const std::string &usertext)
std::map< std::string, Record > m_records
cond::persistency::Logger m_logger
IOVEditor editIov(const std::string &tag)
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
virtual ~PoolDBOutputService()
unsigned int m_writeTransactionDelay
cond::Time_t endOfTime() const
void preGlobalBeginRun(edm::GlobalContext const &)
bool m_onlyAppendUpdatePolicy
std::string timetypestr() const
bool getTagInfo(const std::string &recordName, cond::TagInfo_t &result)
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
void writeMany(const std::map< Time_t, std::shared_ptr< T > > &iovAndPayloads, const std::string &recordName)
std::recursive_mutex m_mutex
cond::persistency::Session newReadOnlySession(const std::string &connectionString, const std::string &transactionId)
cond::Time_t currentTime() const
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
cond::TimeType m_timetype
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
EchoedLogStream< edm::LogInfo > logInfo()
bool tagInfo(const std::string &recordName, cond::TagInfo_t &result)
void eraseSinceTime(const std::string &payloadId, cond::Time_t sinceTime, const std::string &recordName)
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
PoolDBOutputService(const edm::ParameterSet &iConfig, edm::ActivityRegistry &iAR)
void createNewIOV(const T *payloadPtr, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
void doCommitTransaction()