CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
cond::service::PoolDBOutputService Class Reference

#include <PoolDBOutputService.h>

Classes

struct  Record
 

Public Member Functions

template<typename T >
void appendSinceTime (T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
 
void appendSinceTime (const std::string &payloadId, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
 
cond::Time_t beginOfTime () const
 
void closeIOV (Time_t lastTill, const std::string &recordName, bool withlogging=false)
 
template<typename T >
void createNewIOV (T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
 
void createNewIOV (const std::string &firstPayloadId, const std::string payloadType, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
 
void createNewIOV (const std::string &firstPayloadId, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
 
cond::Time_t currentTime () const
 
cond::Time_t endOfTime () const
 
bool isNewTagRequest (const std::string &recordName)
 
 PoolDBOutputService (const edm::ParameterSet &iConfig, edm::ActivityRegistry &iAR)
 
void postEndJob ()
 
const cond::LoggerqueryLog () const
 
cond::persistency::Session session () const
 
void setLogHeaderForRecord (const std::string &recordName, const std::string &provenance, const std::string &usertext)
 
std::string tag (const std::string &recordName)
 
void tagInfo (const std::string &recordName, cond::TagInfo_t &result)
 
template<typename T >
void writeOne (T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
 
virtual ~PoolDBOutputService ()
 

Private Member Functions

void connect ()
 
void disconnect ()
 
void fillRecord (edm::ParameterSet &pset)
 
void initDB (bool forReading=true)
 
RecordlookUpRecord (const std::string &recordName)
 
cond::UserLogInfolookUpUserLogInfo (const std::string &recordName)
 
void postModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preEventProcessing (edm::StreamContext const &)
 
void preGlobalBeginLumi (edm::GlobalContext const &)
 
void preGlobalBeginRun (edm::GlobalContext const &)
 
void preModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 

Private Attributes

std::map< std::string, Recordm_callbacks
 
bool m_closeIOV
 
std::vector< cond::Time_tm_currentTimes
 
bool m_dbstarted
 
std::string m_logConnectionString
 
std::auto_ptr< cond::Loggerm_logdb
 
std::map< std::string,
cond::UserLogInfo
m_logheaders
 
std::recursive_mutex m_mutex
 
std::vector< std::pair
< std::string, std::string > > 
m_newtags
 
cond::persistency::Session m_session
 
cond::TimeType m_timetype
 
std::string m_timetypestr
 

Detailed Description

Definition at line 39 of file PoolDBOutputService.h.

Constructor & Destructor Documentation

PoolDBOutputService::PoolDBOutputService ( const edm::ParameterSet iConfig,
edm::ActivityRegistry iAR 
)

Definition at line 46 of file PoolDBOutputService.cc.

46  :
47  m_timetypestr(""),
49  m_session(),
51  m_logdb(),
52  m_dbstarted( false ),
53  m_callbacks(),
54  m_closeIOV(false),
55  m_logheaders()
56 {
57  m_closeIOV=iConfig.getUntrackedParameter<bool>("closeIOV",m_closeIOV);
58 
59  m_timetypestr=iConfig.getUntrackedParameter< std::string >("timetype","runnumber");
60  m_timetype = cond::time::timeTypeFromName( m_timetypestr );
61 
62  edm::ParameterSet connectionPset = iConfig.getParameter<edm::ParameterSet>("DBParameters");
64  connection.setParameters( connectionPset );
65  connection.configure();
66  std::string connectionString = iConfig.getParameter<std::string>("connect");
67  BackendType backType = (BackendType) iConfig.getUntrackedParameter<int>("dbFormat", DEFAULT_DB );
68  if( backType == UNKNOWN_DB ) backType = DEFAULT_DB;
69  m_session = connection.createSession( connectionString, true, backType );
70 
71  if( iConfig.exists("logconnect") ){
74  conn.configuration().setParameters( connectionPset );
75  conn.configure();
76  cond::DbSession logSession = conn.createSession();
77  m_logdb.reset( new cond::Logger( logSession ) );
78  }
79 
80  typedef std::vector< edm::ParameterSet > Parameters;
81  Parameters toPut=iConfig.getParameter<Parameters>("toPut");
82  for(Parameters::iterator itToPut = toPut.begin(); itToPut != toPut.end(); ++itToPut)
83  fillRecord( *itToPut);
84 
85 
87  iAR.watchPreallocate([this](edm::service::SystemBounds const& iBounds) {
88  m_currentTimes.resize(iBounds.maxNumberOfStreams());
89  });
90  if( m_timetype == cond::timestamp ){ //timestamp
94  } else if( m_timetype == cond::runnumber ){//runnumber
95  //NOTE: this assumes only one run is being processed at a time.
96  // This is true for 7_1_X but plan are to allow multiple in flight at a time
97  s_streamIndex = 0;
99  } else if( m_timetype == cond::lumiid ){
100  //NOTE: this assumes only one lumi is being processed at a time.
101  // This is true for 7_1_X but plan are to allow multiple in flight at a time
102  s_streamIndex = 0;
104  }
105 }
static thread_local int s_streamIndex
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void watchPreEvent(PreEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void preEventProcessing(edm::StreamContext const &)
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void fillRecord(edm::ParameterSet &pset)
std::map< std::string, cond::UserLogInfo > m_logheaders
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< cond::Time_t > m_currentTimes
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void preGlobalBeginLumi(edm::GlobalContext const &)
void setParameters(const edm::ParameterSet &connectionPset)
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
vector< ParameterSet > Parameters
TimeType timeTypeFromName(const std::string &name)
Definition: Time.cc:24
cond::persistency::Session m_session
BackendType
Definition: Types.h:23
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
void preGlobalBeginRun(edm::GlobalContext const &)
static constexpr BackendType DEFAULT_DB
Definition: Types.h:24
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::map< std::string, Record > m_callbacks
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
tuple conn
Definition: results_mgr.py:53
std::auto_ptr< cond::Logger > m_logdb
PoolDBOutputService::~PoolDBOutputService ( )
virtual

Definition at line 184 of file PoolDBOutputService.cc.

184  {
185 }

Member Function Documentation

template<typename T >
void cond::service::PoolDBOutputService::appendSinceTime ( T payloadObj,
cond::Time_t  sinceTime,
const std::string &  recordName,
bool  withlogging = false 
)
inline

Definition at line 108 of file PoolDBOutputService.h.

References m_session, ecalTPGAnalyzer_cfg::recordName, cond::persistency::Session::storePayload(), and cond::throwException().

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), SiStripFEDErrorsDQM::analyze(), EcalTestDevDB::analyze(), BTagCalibrationDbCreator::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), JetCorrectorDBWriter::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob(), QGLikelihoodDBWriter::beginJob(), SiStripFedCablingBuilder::beginRun(), CocoaDBMgr::DumpCocoaResults(), BeamSpotWrite2DB::endJob(), UETableProducer::endJob(), CentralityTableProducer::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), HLTPrescaleRecorder::endRun(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), CaloGeometryDBWriter::writeIndexed(), and writeOne().

111  {
112  if( !payloadObj ) throwException( "Provided payload pointer is invalid.","PoolDBOutputService::appendSinceTime");
113  appendSinceTime( m_session.storePayload( *payloadObj ),
114  sinceTime,
115  recordName,
116  withlogging);
117  }
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
cond::persistency::Session m_session
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:198
void PoolDBOutputService::appendSinceTime ( const std::string &  payloadId,
cond::Time_t  sinceTime,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 291 of file PoolDBOutputService.cc.

References a, idDealer::editor, cppFunctionSkipper::exception, cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), CommonMethods::lock(), cond::persistency::IOVEditor::payloadType(), HLT_25ns14e33_v1_cff::payloadType, AlCaHLTBitMon_QueryRunRegistry::string, cond::throwException(), and cond::rpcobgas::time.

294  {
295  std::lock_guard<std::recursive_mutex> lock(m_mutex);
297  Record& myrecord=this->lookUpRecord(recordName);
298  if( myrecord.m_isNewTag ) {
299  cond::throwException(std::string("Cannot append to non-existing tag ") + myrecord.m_tag,
300  "PoolDBOutputService::appendSinceTime");
301  }
302  if( withlogging && m_logConnectionString.empty() )
303  cond::throwException("Log db was not set from PoolDBOutputService::createNewIOV",
304  "PoolDBOutputService::createNewIOV");
306  try{
308  payloadType = editor.payloadType();
309  editor.insert( time, payloadId );
310  editor.flush();
311 
312  if(withlogging){
313  std::string destconnect=m_session.connectionString();
315  m_logdb->logOperationNow(a,destconnect,payloadType,payloadId,myrecord.m_tag,myrecord.timetypestr(),0,time);
316  }
317  }catch(const std::exception& er){
318  if(withlogging){
319  std::string destconnect=m_session.connectionString();
321  m_logdb->logFailedOperationNow(a,destconnect,payloadType,payloadId,myrecord.m_tag,myrecord.timetypestr(),0,time,std::string(er.what()));
322  }
324  "PoolDBOutputService::appendSinceTime");
325  }
326  scope.close();
327 }
Transaction & transaction()
Definition: Session.cc:66
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
std::string connectionString()
Definition: Session.cc:259
IOVEditor editIov(const std::string &tag)
Definition: Session.cc:132
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
Definition: IOVEditor.cc:138
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
tuple editor
Definition: idDealer.py:73
double a
Definition: hdecay.h:121
std::string payloadType() const
Definition: IOVEditor.cc:93
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
std::auto_ptr< cond::Logger > m_logdb
cond::Time_t PoolDBOutputService::beginOfTime ( ) const

Definition at line 194 of file PoolDBOutputService.cc.

References cond::TimeTypeSpecs::beginValue, and cond::timeTypeSpecs.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripApvGainBuilder::analyze(), GBRForestWriter::analyze(), SurveyInputTrackerFromDB::analyze(), TrackerSystematicMisalignments::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), SiStripFEDErrorsDQM::analyze(), EcalTestDevDB::analyze(), TrackerGeometryCompare::analyze(), XMLGeometryBuilder::beginJob(), BTagCalibrationDbCreator::beginJob(), GeometricDetLoader::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), JetCorrectorDBWriter::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), QGLikelihoodDBWriter::beginJob(), WriteOneGeometryFromXML::beginRun(), PTrackerParametersDBBuilder::beginRun(), RPCRecoIdealDBLoader::beginRun(), SiStripFedCablingBuilder::beginRun(), CSCRecoIdealDBLoader::beginRun(), DTRecoIdealDBLoader::beginRun(), PGeometricDetExtraBuilder::beginRun(), PGeometricDetBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), ESDBCopy::copyToDB(), EcalTPGDBCopy::copyToDB(), EcalDBCopy::copyToDB(), CocoaDBMgr::DumpCocoaResults(), PhysicsTools::MVATrainerSave::endJob(), PhysicsTools::MVATrainerContainerSave::endJob(), BeamSpotWrite2DB::endJob(), UETableProducer::endJob(), CentralityTableProducer::endJob(), BeamProfile2DB::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun(), HLTPrescaleRecorder::endRun(), LaserAlignment::endRunProduce(), MisalignedMuonESProducer::saveToDB(), ConditionDBWriter< SiStripApvGain >::storeOnDb(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), CaloGeometryDBWriter::writeIndexed(), and DTCalibDBUtils::writeToDB().

194  {
196 }
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
Time_t beginValue
Definition: Time.h:45
void PoolDBOutputService::closeIOV ( Time_t  lastTill,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 355 of file PoolDBOutputService.cc.

References idDealer::editor, cond::persistency::IOVEditor::flush(), CommonMethods::lock(), cond::service::PoolDBOutputService::Record::m_isNewTag, cond::service::PoolDBOutputService::Record::m_tag, cond::persistency::IOVEditor::setEndOfValidity(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().

Referenced by popcon::PopCon::finalize().

356  {
357  std::lock_guard<std::recursive_mutex> lock(m_mutex);
358  // not fully working.. not be used for now...
359  Record & myrecord = lookUpRecord(recordName);
361 
362  if( myrecord.m_isNewTag ) {
363  cond::throwException(std::string("Cannot close non-existing tag ") + myrecord.m_tag,
364  "PoolDBOutputService::closeIOV");
365  }
367  editor.setEndOfValidity( lastTill );
368  editor.flush();
369  scope.close();
370 }
Transaction & transaction()
Definition: Session.cc:66
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
IOVEditor editIov(const std::string &tag)
Definition: Session.cc:132
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
tuple editor
Definition: idDealer.py:73
void setEndOfValidity(cond::Time_t validity)
Definition: IOVEditor.cc:105
void cond::service::PoolDBOutputService::connect ( )
private

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea::__init__(), Vispa.Views.PropertyView.BooleanProperty::__init__(), Vispa.Gui.FindDialog.FindDialog::_addScript(), Vispa.Gui.FindDialog.FindDialog::_addStringProperty(), Vispa.Main.Application.Application::_connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView::_createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog::addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer::addWidget(), Vispa.Views.PropertyView.PropertyView::append(), Vispa.Views.PropertyView.PropertyView::appendAddRow(), Vispa.Main.Application.Application::createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createButton(), Vispa.Views.LineDecayView.LineDecayView::createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createLineEdit(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createTextEdit(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Gui.PortWidget.PortWidget::mouseMoveEvent(), Vispa.Views.PropertyView.BooleanProperty::setChecked(), Vispa.Main.SplitterTab.SplitterTab::setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab::setController(), Vispa.Views.PropertyView.BooleanProperty::setReadOnly(), Vispa.Views.PropertyView.DropDownProperty::setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty::setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setTab(), Vispa.Views.PropertyView.IntegerProperty::setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController::updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::updateViewMenu().

template<typename T >
void cond::service::PoolDBOutputService::createNewIOV ( T firstPayloadObj,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
)
inline

Definition at line 77 of file PoolDBOutputService.h.

References ora::ClassUtils::demangledName(), initDB(), CommonMethods::lock(), m_dbstarted, m_mutex, m_session, ecalTPGAnalyzer_cfg::recordName, cond::persistency::Session::storePayload(), and cond::throwException().

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), SiStripFEDErrorsDQM::analyze(), EcalTestDevDB::analyze(), XMLGeometryBuilder::beginJob(), BTagCalibrationDbCreator::beginJob(), GeometricDetLoader::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), JetCorrectorDBWriter::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob(), QGLikelihoodDBWriter::beginJob(), WriteOneGeometryFromXML::beginRun(), PTrackerParametersDBBuilder::beginRun(), RPCRecoIdealDBLoader::beginRun(), SiStripFedCablingBuilder::beginRun(), DTRecoIdealDBLoader::beginRun(), CSCRecoIdealDBLoader::beginRun(), PGeometricDetBuilder::beginRun(), PGeometricDetExtraBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), EcalTPGDBCopy::copyToDB(), EcalDBCopy::copyToDB(), ESDBCopy::copyToDB(), CocoaDBMgr::DumpCocoaResults(), PhysicsTools::MVATrainerSave::endJob(), PhysicsTools::MVATrainerContainerSave::endJob(), BeamSpotWrite2DB::endJob(), UETableProducer::endJob(), CentralityTableProducer::endJob(), BeamProfile2DB::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), HLTPrescaleRecorder::endRun(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), CaloGeometryDBWriter::writeIndexed(), and writeOne().

81  {
82  if( !firstPayloadObj ) throwException( "Provided payload pointer is invalid.","PoolDBOutputService::createNewIOV");
83  std::lock_guard<std::recursive_mutex> lock(m_mutex);
84  if (!m_dbstarted) this->initDB( false );
85  createNewIOV( m_session.storePayload( *firstPayloadObj ),
86  cond::demangledName(typeid(T)),
87  firstSinceTime,
88  firstTillTime,
89  recordName,
90  withlogging);
91  }
std::string demangledName(const std::type_info &typeInfo)
Definition: ClassUtils.cc:156
cond::persistency::Session m_session
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:198
long double T
void PoolDBOutputService::createNewIOV ( const std::string &  firstPayloadId,
const std::string  payloadType,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 205 of file PoolDBOutputService.cc.

References a, idDealer::editor, cppFunctionSkipper::exception, cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), CommonMethods::lock(), cond::OFFLINE, cond::persistency::IOVEditor::setDescription(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().

210  {
211  std::lock_guard<std::recursive_mutex> lock(m_mutex);
212 
214  Record& myrecord=this->lookUpRecord(recordName);
215  if(!myrecord.m_isNewTag) {
216  cond::throwException( myrecord.m_tag + " is not a new tag", "PoolDBOutputService::createNewIOV");
217  }
218  std::string iovToken;
219  if( withlogging && m_logConnectionString.empty() )
220  cond::throwException("Log db was not set from PoolDBOutputService::createNewIOV",
221  "PoolDBOutputService::createNewIOV");
222 
223  try{
224  // FIX ME: synchronization type and description have to be passed as the other parameters?
225  cond::persistency::IOVEditor editor = m_session.createIov( payloadType, myrecord.m_tag, myrecord.m_timetype, cond::OFFLINE );
226  editor.setDescription( "New Tag" );
227  editor.insert( firstSinceTime, firstPayloadId );
228  editor.flush();
229  myrecord.m_isNewTag=false;
230  if(withlogging){
231  std::string destconnect=m_session.connectionString();
233  m_logdb->logOperationNow(a,destconnect,payloadType,firstPayloadId,myrecord.m_tag,myrecord.timetypestr(),0,firstSinceTime);
234  }
235  }catch(const std::exception& er){
236  if(withlogging){
237  std::string destconnect=m_session.connectionString();
239  m_logdb->logFailedOperationNow(a,destconnect,payloadType,firstPayloadId,myrecord.m_tag,myrecord.timetypestr(),0,firstSinceTime,std::string(er.what()));
240  }
241  cond::throwException(std::string(er.what()) + " from PoolDBOutputService::createNewIOV ",
242  "PoolDBOutputService::createNewIOV");
243  }
244  scope.close();
245 }
void setDescription(const std::string &description)
Definition: IOVEditor.cc:116
Transaction & transaction()
Definition: Session.cc:66
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
std::string connectionString()
Definition: Session.cc:259
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
Definition: IOVEditor.cc:138
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
tuple editor
Definition: idDealer.py:73
IOVEditor createIov(const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::OFFLINE)
Definition: Session.h:194
double a
Definition: hdecay.h:121
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
std::auto_ptr< cond::Logger > m_logdb
void PoolDBOutputService::createNewIOV ( const std::string &  firstPayloadId,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 248 of file PoolDBOutputService.cc.

References a, idDealer::editor, cppFunctionSkipper::exception, cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), CommonMethods::lock(), cond::OFFLINE, cond::persistency::IOVEditor::payloadType(), HLT_25ns14e33_v1_cff::payloadType, cond::persistency::IOVEditor::setDescription(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().

252  {
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");
258  }
259  std::string iovToken;
260  if( withlogging && m_logConnectionString.empty() )
261  cond::throwException("Log db was not set from PoolDBOutputService::createNewIOV",
262  "PoolDBOutputService::createNewIOV");
263 
265  try{
266  // FIX ME: synchronization type and description have to be passed as the other parameters?
267  cond::persistency::IOVEditor editor = m_session.createIovForPayload( firstPayloadId, myrecord.m_tag, myrecord.m_timetype, cond::OFFLINE );
268  editor.setDescription( "New Tag" );
269  payloadType = editor.payloadType();
270  editor.insert( firstSinceTime, firstPayloadId );
271  editor.flush();
272  myrecord.m_isNewTag=false;
273  if(withlogging){
274  std::string destconnect=m_session.connectionString();
276  m_logdb->logOperationNow(a,destconnect,payloadType,firstPayloadId,myrecord.m_tag,myrecord.timetypestr(),0,firstSinceTime);
277  }
278  }catch(const std::exception& er){
279  if(withlogging){
280  std::string destconnect=m_session.connectionString();
282  m_logdb->logFailedOperationNow(a,destconnect,payloadType,firstPayloadId,myrecord.m_tag,myrecord.timetypestr(),0,firstSinceTime,std::string(er.what()));
283  }
284  cond::throwException(std::string(er.what()) + " from PoolDBOutputService::createNewIOV ",
285  "PoolDBOutputService::createNewIOV");
286  }
287  scope.close();
288 }
void setDescription(const std::string &description)
Definition: IOVEditor.cc:116
Transaction & transaction()
Definition: Session.cc:66
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
std::string connectionString()
Definition: Session.cc:259
IOVEditor createIovForPayload(const Hash &payloadHash, const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::OFFLINE)
Definition: Session.cc:120
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
Definition: IOVEditor.cc:138
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
tuple editor
Definition: idDealer.py:73
double a
Definition: hdecay.h:121
std::string payloadType() const
Definition: IOVEditor.cc:93
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
std::auto_ptr< cond::Logger > m_logdb
cond::Time_t PoolDBOutputService::currentTime ( ) const

Definition at line 199 of file PoolDBOutputService.cc.

References assert(), and s_streamIndex.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), BufferedBoostIODBWriter::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), SiStripFEDErrorsDQM::analyze(), BoostIODBWriter< DataType >::analyze(), FFTJetCorrectorDBWriter::analyze(), SiStripFedCablingBuilder::beginRun(), CocoaDBMgr::DumpCocoaResults(), BeamSpotWrite2DB::endJob(), UETableProducer::endJob(), SurveyDBUploader::endJob(), Mixing2DB::endJob(), CentralityTableProducer::endJob(), SiStripFedCablingManipulator::endRun(), DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun(), popcon::L1RPCHwConfigSourceHandler::getNewObjects(), popcon::RPCEMapSourceHandler::getNewObjects(), MisalignedTrackerESProducer::produce(), MuonAlignment::saveCSCSurveyToDB(), MuonAlignment::saveCSCtoDB(), MuonAlignment::saveDTSurveyToDB(), MuonAlignment::saveDTtoDB(), TrackerAlignment::saveToDB(), ConditionDBWriter< SiStripApvGain >::setTime(), CaloGeometryDBWriter::write(), WriteESAlignments::write(), BeamFitter::write2DB(), GlobalTrackerMuonAlignment::writeGlPosRcd(), CaloGeometryDBWriter::writeIndexed(), and DTCalibDBUtils::writeToDB().

199  {
200  assert(-1 != s_streamIndex);
202 }
static thread_local int s_streamIndex
assert(m_qm.get())
std::vector< cond::Time_t > m_currentTimes
void cond::service::PoolDBOutputService::disconnect ( )
private
cond::Time_t PoolDBOutputService::endOfTime ( ) const

Definition at line 189 of file PoolDBOutputService.cc.

References cond::TimeTypeSpecs::endValue, and cond::timeTypeSpecs.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), EcalDQMStatusWriter::analyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), SiStripFEDErrorsDQM::analyze(), EcalTestDevDB::analyze(), XMLGeometryBuilder::beginJob(), BTagCalibrationDbCreator::beginJob(), GeometricDetLoader::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), JetCorrectorDBWriter::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), QGLikelihoodDBWriter::beginJob(), WriteOneGeometryFromXML::beginRun(), PTrackerParametersDBBuilder::beginRun(), RPCRecoIdealDBLoader::beginRun(), SiStripFedCablingBuilder::beginRun(), CSCRecoIdealDBLoader::beginRun(), DTRecoIdealDBLoader::beginRun(), PGeometricDetBuilder::beginRun(), PGeometricDetExtraBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), EcalDBCopy::copyToDB(), ESDBCopy::copyToDB(), EcalTPGDBCopy::copyToDB(), CocoaDBMgr::DumpCocoaResults(), PhysicsTools::MVATrainerSave::endJob(), PhysicsTools::MVATrainerContainerSave::endJob(), BeamSpotWrite2DB::endJob(), UETableProducer::endJob(), CentralityTableProducer::endJob(), BeamProfile2DB::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), HLTPrescaleRecorder::endRun(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), CaloGeometryDBWriter::writeIndexed(), and writeOne().

189  {
191 }
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
Time_t endValue
Definition: Time.h:46
void PoolDBOutputService::fillRecord ( edm::ParameterSet pset)
private

Definition at line 26 of file PoolDBOutputService.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_callbacks, cond::service::PoolDBOutputService::Record::m_closeIOV, m_closeIOV, cond::service::PoolDBOutputService::Record::m_idName, m_logConnectionString, m_logheaders, cond::service::PoolDBOutputService::Record::m_tag, cond::service::PoolDBOutputService::Record::m_timetype, m_timetypestr, AlCaHLTBitMon_QueryRunRegistry::string, and cond::time::timeTypeFromName().

26  {
27  Record thisrecord;
28 
29  thisrecord.m_idName = pset.getParameter<std::string>("record");
30  thisrecord.m_tag = pset.getParameter<std::string>("tag");
31 
32  thisrecord.m_closeIOV =
33  pset.getUntrackedParameter<bool>("closeIOV", m_closeIOV);
34 
35  thisrecord.m_timetype = cond::time::timeTypeFromName( pset.getUntrackedParameter< std::string >("timetype",m_timetypestr) );
36 
37  m_callbacks.insert(std::make_pair(thisrecord.m_idName,thisrecord));
38 
39  // *** THE NEW LOGGING has still to be defined and implemented.
40  if( !m_logConnectionString.empty() ){
41  cond::UserLogInfo userloginfo;
42  m_logheaders.insert(std::make_pair(thisrecord.m_idName,userloginfo));
43  }
44 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, cond::UserLogInfo > m_logheaders
TimeType timeTypeFromName(const std::string &name)
Definition: Time.cc:24
std::map< std::string, Record > m_callbacks
void PoolDBOutputService::initDB ( bool  forReading = true)
private

Definition at line 124 of file PoolDBOutputService.cc.

References cppFunctionSkipper::exception, CommonMethods::lock(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().

Referenced by createNewIOV(), and writeOne().

125 {
126  std::lock_guard<std::recursive_mutex> lock(m_mutex);
127  m_session.transaction().start(false);
129  try{
130  if(!forReading) {
132  }
133  //init logdb if required
134  if(!m_logConnectionString.empty()){
135  m_logdb->connect( m_logConnectionString );
136  m_logdb->createLogDBIfNonExist();
137  }
138  } catch( const std::exception& er ){
139  cond::throwException( std::string(er.what()),"PoolDBOutputService::initDB" );
140  }
141  scope.close();
142  m_dbstarted=true;
143 }
void start(bool readOnly=true)
Definition: Session.cc:22
Transaction & transaction()
Definition: Session.cc:66
cond::persistency::Session m_session
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
std::auto_ptr< cond::Logger > m_logdb
bool PoolDBOutputService::isNewTagRequest ( const std::string &  recordName)

Definition at line 118 of file PoolDBOutputService.cc.

References cond::service::PoolDBOutputService::Record::m_isNewTag.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), SiStripFEDErrorsDQM::analyze(), EcalTestDevDB::analyze(), XMLGeometryBuilder::beginJob(), BTagCalibrationDbCreator::beginJob(), GeometricDetLoader::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), JetCorrectorDBWriter::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), QGLikelihoodDBWriter::beginJob(), WriteOneGeometryFromXML::beginRun(), PTrackerParametersDBBuilder::beginRun(), RPCRecoIdealDBLoader::beginRun(), SiStripFedCablingBuilder::beginRun(), DTRecoIdealDBLoader::beginRun(), CSCRecoIdealDBLoader::beginRun(), PGeometricDetExtraBuilder::beginRun(), PGeometricDetBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), CocoaDBMgr::DumpCocoaResults(), BeamSpotWrite2DB::endJob(), UETableProducer::endJob(), CentralityTableProducer::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), AlcaBeamSpotHarvester::endRun(), HLTPrescaleRecorder::endRun(), ConditionDBWriter< SiStripApvGain >::storeOnDb(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), CaloGeometryDBWriter::writeIndexed(), writeOne(), and DTCalibDBUtils::writeToDB().

118  {
119  Record& myrecord=this->lookUpRecord(recordName);
120  return myrecord.m_isNewTag;
121 }
Record & lookUpRecord(const std::string &recordName)
cond::service::PoolDBOutputService::Record & PoolDBOutputService::lookUpRecord ( const std::string &  recordName)
private

Definition at line 330 of file PoolDBOutputService.cc.

References CommonMethods::lock(), and cond::throwException().

330  {
331  std::lock_guard<std::recursive_mutex> lock(m_mutex);
332  if (!m_dbstarted) this->initDB( false );
334  std::map<std::string,Record>::iterator it=m_callbacks.find(recordName);
335  if(it==m_callbacks.end()) {
336  cond::throwException("The record \""+recordName +"\" has not been registered.","PoolDBOutputService::lookUpRecord");
337  }
338  if( !m_session.existsIov( it->second.m_tag) ){
339  it->second.m_isNewTag=true;
340  } else {
341  it->second.m_isNewTag=false;
342  }
343  scope.close();
344  return it->second;
345 }
Transaction & transaction()
Definition: Session.cc:66
cond::persistency::Session m_session
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
bool existsIov(const std::string &tag)
Definition: Session.cc:88
std::map< std::string, Record > m_callbacks
cond::UserLogInfo & PoolDBOutputService::lookUpUserLogInfo ( const std::string &  recordName)
private

Definition at line 348 of file PoolDBOutputService.cc.

348  {
349  std::map<std::string,cond::UserLogInfo>::iterator it=m_logheaders.find(recordName);
350  if(it==m_logheaders.end()) throw cond::Exception("Log db was not set for record " + recordName + " from PoolDBOutputService::lookUpUserLogInfo");
351  return it->second;
352 }
std::map< std::string, cond::UserLogInfo > m_logheaders
void PoolDBOutputService::postEndJob ( )

Definition at line 146 of file PoolDBOutputService.cc.

147 {
148  if( m_dbstarted) {
150  m_dbstarted = false;
151  }
152 }
Transaction & transaction()
Definition: Session.cc:66
cond::persistency::Session m_session
void PoolDBOutputService::postModuleEvent ( edm::StreamContext const &  iContext,
edm::ModuleCallingContext const &   
)
private

Definition at line 166 of file PoolDBOutputService.cc.

References s_streamIndex.

166  {
167  s_streamIndex = -1;
168 }
static thread_local int s_streamIndex
void PoolDBOutputService::preEventProcessing ( edm::StreamContext const &  iContext)
private

Definition at line 155 of file PoolDBOutputService.cc.

References edm::StreamContext::streamID(), edm::StreamContext::timestamp(), edm::StreamID::value(), and edm::Timestamp::value().

156 {
157  m_currentTimes[iContext.streamID().value()] = iContext.timestamp().value();
158 }
std::vector< cond::Time_t > m_currentTimes
void PoolDBOutputService::preGlobalBeginLumi ( edm::GlobalContext const &  iContext)
private

Definition at line 178 of file PoolDBOutputService.cc.

References edm::GlobalContext::luminosityBlockID(), cond::rpcobgas::time, and edm::LuminosityBlockID::value().

178  {
179  for( auto& time : m_currentTimes) {
180  time = iContext.luminosityBlockID().value();
181  }
182 }
std::vector< cond::Time_t > m_currentTimes
void PoolDBOutputService::preGlobalBeginRun ( edm::GlobalContext const &  iContext)
private

Definition at line 171 of file PoolDBOutputService.cc.

References edm::GlobalContext::luminosityBlockID(), edm::LuminosityBlockID::run(), and cond::rpcobgas::time.

171  {
172  for( auto& time : m_currentTimes) {
173  time = iContext.luminosityBlockID().run();
174  }
175 }
std::vector< cond::Time_t > m_currentTimes
void PoolDBOutputService::preModuleEvent ( edm::StreamContext const &  iContext,
edm::ModuleCallingContext const &   
)
private

Definition at line 161 of file PoolDBOutputService.cc.

References s_streamIndex, edm::StreamContext::streamID(), and edm::StreamID::value().

161  {
162  s_streamIndex = iContext.streamID().value();
163 }
static thread_local int s_streamIndex
const cond::Logger & PoolDBOutputService::queryLog ( ) const

Definition at line 383 of file PoolDBOutputService.cc.

Referenced by popcon::PopCon::initialize().

383  {
384  if( !m_logdb.get() ) throw cond::Exception("Log database is not set from PoolDBOutputService::queryLog");
385  return *m_logdb;
386 }
std::auto_ptr< cond::Logger > m_logdb
cond::persistency::Session PoolDBOutputService::session ( ) const
void PoolDBOutputService::setLogHeaderForRecord ( const std::string &  recordName,
const std::string &  provenance,
const std::string &  usertext 
)

Definition at line 374 of file PoolDBOutputService.cc.

References cond::UserLogInfo::provenance, and cond::UserLogInfo::usertext.

Referenced by popcon::PopCon::write().

375 {
377  myloginfo.provenance=dataprovenance;
378  myloginfo.usertext=usertext;
379 }
std::string usertext
Definition: LogDBEntry.h:9
std::string provenance
Definition: LogDBEntry.h:8
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
std::string PoolDBOutputService::tag ( const std::string &  recordName)
void PoolDBOutputService::tagInfo ( const std::string &  recordName,
cond::TagInfo_t result 
)

Definition at line 390 of file PoolDBOutputService.cc.

References cond::persistency::IOVProxy::getLast(), o2o::iov, prof2calltree::last, cond::TagInfo_t::lastInterval, cond::TagInfo_t::lastPayloadToken, CommonMethods::lock(), cond::service::PoolDBOutputService::Record::m_tag, cond::TagInfo_t::name, cond::Iov_t::payloadId, record, cond::persistency::IOVProxy::sequenceSize(), cond::Iov_t::since, cond::TagInfo_t::size, and cond::Iov_t::till.

Referenced by l1t::DataWriter::lastPayloadToken(), and l1t::DataWriter::updateIOV().

390  {
391  //
392  std::lock_guard<std::recursive_mutex> lock(m_mutex);
394  result.name=record.m_tag;
395  //use iovproxy to find out.
397  result.size=iov.sequenceSize();
398  if (result.size>0) {
399  cond::Iov_t last = iov.getLast();
400  result.lastInterval = cond::ValidityInterval( last.since, last.till );
401  result.lastPayloadToken = last.payloadId;
402  }
403 }
JetCorrectorParameters::Record record
Definition: classes.h:7
Time_t since
Definition: Types.h:51
size_t size
Definition: Types.h:72
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::string name
Definition: Types.h:68
cond::ValidityInterval lastInterval
Definition: Types.h:70
IOVProxy readIov(const std::string &tag, bool full=false)
Definition: Session.cc:81
tuple iov
Definition: o2o.py:307
Record & lookUpRecord(const std::string &recordName)
Hash payloadId
Definition: Types.h:53
cond::persistency::Session m_session
std::string lastPayloadToken
Definition: Types.h:71
Time_t till
Definition: Types.h:52
template<typename T >
void cond::service::PoolDBOutputService::writeOne ( T payload,
Time_t  time,
const std::string &  recordName,
bool  withlogging = false 
)
inline

Definition at line 58 of file PoolDBOutputService.h.

References appendSinceTime(), createNewIOV(), ora::ClassUtils::demangledName(), endOfTime(), initDB(), isNewTagRequest(), CommonMethods::lock(), m_dbstarted, m_mutex, m_session, HLT_25ns14e33_v1_cff::payloadType, cond::persistency::Session::storePayload(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::throwException().

Referenced by EcalDQMStatusWriter::analyze(), GBRForestWriter::analyze(), SurveyInputTrackerFromDB::analyze(), BufferedBoostIODBWriter::analyze(), TrackerSystematicMisalignments::analyze(), BoostIODBWriter< DataType >::analyze(), FFTJetCorrectorDBWriter::analyze(), MoveFlatParamsToDB::analyze(), TrackerGeometryCompare::analyze(), DTUserKeyedConfigHandler::chkConfigList(), DTKeyedConfigHandler::chkConfigList(), EcalDBCopy::copyToDB(), SurveyDBUploader::endJob(), Mixing2DB::endJob(), DTKeyedConfigDBInit::endJob(), SiStripLorentzAngleCalibration::endOfJob(), SiStripBackplaneCalibration::endOfJob(), SiPixelLorentzAngleCalibration::endOfJob(), AlcaBeamSpotHarvester::endRun(), DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun(), LaserAlignment::endRunProduce(), MisalignedTrackerESProducer::produce(), MuonAlignment::saveCSCSurveyToDB(), MuonAlignment::saveCSCtoDB(), MuonAlignment::saveDTSurveyToDB(), MuonAlignment::saveDTtoDB(), TrackerAlignment::saveToDB(), MisalignedMuonESProducer::saveToDB(), ConditionDBWriter< SiStripApvGain >::storeOnDb(), WriteESAlignments::write(), AlignmentProducer::writeDB(), GlobalTrackerMuonAlignment::writeGlPosRcd(), popcon::PopCon::writeOne(), and DTCalibDBUtils::writeToDB().

58  {
59  if( !payload ) throwException( "Provided payload pointer is invalid.","PoolDBOutputService::writeOne");
60  std::lock_guard<std::recursive_mutex> lock(m_mutex);
61  if (!m_dbstarted) this->initDB( false );
62  Hash payloadId = m_session.storePayload( *payload );
65  createNewIOV(payloadId, payloadType, time, endOfTime(), recordName, withlogging);
66  } else {
67  appendSinceTime(payloadId, time, recordName, withlogging);
68  }
69  }
std::string demangledName(const std::type_info &typeInfo)
Definition: ClassUtils.cc:156
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
std::string Hash
Definition: Types.h:43
cond::persistency::Session m_session
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:198
long double T

Member Data Documentation

std::map<std::string, Record> cond::service::PoolDBOutputService::m_callbacks
private

Definition at line 206 of file PoolDBOutputService.h.

Referenced by fillRecord().

bool cond::service::PoolDBOutputService::m_closeIOV
private

Definition at line 208 of file PoolDBOutputService.h.

Referenced by fillRecord().

std::vector<cond::Time_t> cond::service::PoolDBOutputService::m_currentTimes
private

Definition at line 199 of file PoolDBOutputService.h.

bool cond::service::PoolDBOutputService::m_dbstarted
private

Definition at line 204 of file PoolDBOutputService.h.

Referenced by createNewIOV(), and writeOne().

std::string cond::service::PoolDBOutputService::m_logConnectionString
private

Definition at line 202 of file PoolDBOutputService.h.

Referenced by fillRecord().

std::auto_ptr<cond::Logger> cond::service::PoolDBOutputService::m_logdb
private

Definition at line 203 of file PoolDBOutputService.h.

std::map<std::string, cond::UserLogInfo> cond::service::PoolDBOutputService::m_logheaders
private

Definition at line 209 of file PoolDBOutputService.h.

Referenced by fillRecord().

std::recursive_mutex cond::service::PoolDBOutputService::m_mutex
private

Definition at line 196 of file PoolDBOutputService.h.

Referenced by createNewIOV(), and writeOne().

std::vector< std::pair<std::string,std::string> > cond::service::PoolDBOutputService::m_newtags
private

Definition at line 207 of file PoolDBOutputService.h.

cond::persistency::Session cond::service::PoolDBOutputService::m_session
private

Definition at line 201 of file PoolDBOutputService.h.

Referenced by appendSinceTime(), createNewIOV(), and writeOne().

cond::TimeType cond::service::PoolDBOutputService::m_timetype
private

Definition at line 197 of file PoolDBOutputService.h.

std::string cond::service::PoolDBOutputService::m_timetypestr
private

Definition at line 198 of file PoolDBOutputService.h.

Referenced by fillRecord().