CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PopCon.cc
Go to the documentation of this file.
5 #include <iostream>
6 
7 namespace popcon {
8 
10  m_record(pset.getParameter<std::string> ("record")),
11  m_payload_name(pset.getUntrackedParameter<std::string> ("name","")),
12  m_LoggingOn(pset.getUntrackedParameter< bool > ("loggingOn",true)),
13  m_IsDestDbCheckedInQueryLog(pset.getUntrackedParameter< bool > ("IsDestDbCheckedInQueryLog",true)),
14  m_close(pset.getUntrackedParameter< bool > ("closeIOV",false)),
15  m_lastTill(pset.getUntrackedParameter< bool > ("lastTill",0))
16  {
17  //TODO set the policy (cfg or global configuration?)
18  //Policy if corrupted data found
19 
20  edm::LogInfo ("PopCon") << "This is PopCon (Populator of Condition) V4.0\n"
21  << "Please report any problem and feature request through the savannah portal under the category conditions\n" ;
22 
23  }
24 
26 
27 
29  edm::LogInfo ("PopCon")<<"payload name "<<m_payload_name<<std::endl;
30  if(!m_dbService.isAvailable() ) throw Exception("DBService not available");
31  const std::string & connectionStr = m_dbService->session().connectionString();
47  edm::LogInfo ("PopCon") << "DB: " << connectionStr << "\n"
48  << "TAG: " << m_tag
49  << ", last since/till: " << m_tagInfo.lastInterval.first
50  << "/" << m_tagInfo.lastInterval.second
51  << ", , size: " << m_tagInfo.size << "\n" ;
52  //<< "Last writer: " << m_logDBEntry.provenance
53  // << ", size: " << m_logDBEntry.payloadIdx+1 << std::endl;
54  } else {
55  edm::LogInfo ("PopCon") << "DB: " << connectionStr << "\n"
56  << "TAG: " << m_tag
57  << "; First writer to this new tag." << std::endl;
58  }
59  }
60 
61 
62  void PopCon::finalize(Time_t lastTill) {
63 
64  if (m_close) {
65  // avoid to close it before lastSince
66  if (m_lastTill>lastTill) lastTill=m_lastTill;
67  m_dbService->closeIOV(lastTill,m_record);
68  }
69  }
70 
71 }
void closeIOV(Time_t lastTill, const std::string &recordName, bool withlogging=false)
void finalize(Time_t lastTill)
Definition: PopCon.cc:62
Time_t m_lastTill
Definition: PopCon.h:77
cond::persistency::Session session() const
bool m_close
Definition: PopCon.h:76
cond::Time_t Time_t
Definition: PopCon.h:37
size_t size
Definition: Types.h:72
std::string m_tag
Definition: PopCon.h:70
std::string m_record
Definition: PopCon.h:62
std::string tag(const std::string &recordName)
std::string name
Definition: Types.h:68
cond::ValidityInterval lastInterval
Definition: Types.h:70
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:46
cond::TagInfo_t m_tagInfo
Definition: PopCon.h:72
std::string connectionString()
Definition: Session.cc:215
PopCon(const edm::ParameterSet &pset)
Definition: PopCon.cc:9
void tagInfo(const std::string &recordName, cond::TagInfo_t &result)
void initialize()
Definition: PopCon.cc:28
virtual ~PopCon()
Definition: PopCon.cc:25
volatile std::atomic< bool > shutdown_flag false
std::string m_payload_name
Definition: PopCon.h:64
edm::Service< cond::service::PoolDBOutputService > m_dbService
Definition: PopCon.h:60