1 #ifndef CondCore_PoolDBOutputService_h 2 #define CondCore_PoolDBOutputService_h 63 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
66 Hash thePayloadHash(
"");
69 auto& myrecord = this->
getRecord(recordName);
72 if (myrecord.m_onlyAppendUpdatePolicy && !newTag) {
78 if (
time <= lastSince) {
80 <<
", because is less or equal to last available since = " << lastSince;
84 return thePayloadHash;
101 return thePayloadHash;
104 template <
typename T>
106 if (iovAndPayloads.empty())
108 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
113 auto& myrecord = this->
getRecord(recordName);
124 if (myrecord.m_onlyAppendUpdatePolicy) {
132 for (
auto& iovEntry : iovAndPayloads) {
134 auto payload = iovEntry.second;
135 if (myrecord.m_onlyAppendUpdatePolicy && !newTag) {
136 if (
time <= lastSince) {
138 <<
", because is less or equal to last available since = " << lastSince;
160 template <
typename T>
162 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
167 auto& myrecord = this->
getRecord(recordName);
168 if (!myrecord.m_isNewTag) {
169 cond::throwException(myrecord.m_tag +
" is not a new tag",
"PoolDBOutputService::createNewIOV");
182 template <
typename T>
184 std::lock_guard<std::recursive_mutex>
lock(
m_mutex);
188 bool dbexists = this->
initDB(
true);
191 "PoolDBOutputService::appendSinceTime");
194 if (myrecord.m_isNewTag) {
196 "PoolDBOutputService::appendSinceTime");
289 bool initDB(
bool readOnly =
false);
const TimeTypeSpecs timeTypeSpecs[]
unsigned int m_refreshTime
void preEventProcessing(edm::StreamContext const &)
void fillRecord(edm::ParameterSet &pset, const std::string &gTimeTypeStr)
const Record & lookUpRecord(const std::string &recordName)
std::map< std::string, cond::UserLogInfo > m_logheaders
cond::Time_t beginOfTime() 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)
std::string to_string(const V &value)
void setDescription(const std::string &description)
bool initDB(bool readOnly=false)
void preGlobalBeginLumi(edm::GlobalContext const &)
Transaction & transaction()
void throwException(const std::string &message, const std::string &methodName)
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
std::string tag(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)
cond::Time_t currentTime() const
cond::persistency::Logger & logger()
cond::persistency::ConnectionPool m_connection
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
cond::persistency::Session m_session
cond::TimeType m_timetype
cond::Time_t endOfTime() const
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()
Record & getRecord(const std::string &recordName)
unsigned int m_writeTransactionDelay
void preGlobalBeginRun(edm::GlobalContext const &)
bool appendSinceTime(const std::string &payloadId, cond::Time_t sinceTime, const std::string &recordName)
bool m_onlyAppendUpdatePolicy
void createNewIOV(const std::string &firstPayloadId, cond::Time_t firstSinceTime, const std::string &recordName)
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)
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
cond::TimeType m_timetype
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
EchoedLogStream< edm::LogInfo > logInfo()
std::string timetypestr() const
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)
cond::persistency::Session session() const
void doCommitTransaction()