CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

cond::service::PoolDBOutputService Class Reference

#include <PoolDBOutputService.h>

List of all members.

Classes

struct  Record

Public Member Functions

template<typename T >
void appendSinceTime (T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
template<typename T >
void appendSinceTime (T *payloadObj, Summary *summary, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
void appendSinceTime (const std::string &payloadToken, 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)
void createNewIOV (const std::string &firstPayloadToken, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, 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)
template<typename T >
void createNewIOV (T *firstPayloadObj, Summary *summary, 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 ()
void postModule (const edm::ModuleDescription &desc)
void preBeginLumi (const edm::LuminosityBlockID &, const edm::Timestamp &)
void preEventProcessing (const edm::EventID &evtID, const edm::Timestamp &iTime)
void preModule (const edm::ModuleDescription &desc)
const cond::LoggerqueryLog () const
cond::DbSession 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 &result)
template<typename T >
void writeOne (T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
template<typename T >
void writeOne (T *payload, Summary *summary, Time_t time, const std::string &recordName, bool withlogging=false)
virtual ~PoolDBOutputService ()

Private Member Functions

void add (GetToken const &token, cond::Time_t time, const std::string &recordName, bool withlogging=false)
unsigned int appendIOV (cond::DbSession &, Record &record, const std::string &payloadToken, cond::Time_t sinceTime)
void connect ()
void createNewIOV (GetToken const &token, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void disconnect ()
void fillRecord (edm::ParameterSet &pset)
void initDB ()
unsigned int insertIOV (cond::DbSession &pooldb, Record &record, const std::string &payloadToken, cond::Time_t tillTime)
 Returns payload location index.
RecordlookUpRecord (const std::string &recordName)
cond::UserLogInfolookUpUserLogInfo (const std::string &recordName)

Private Attributes

std::map< std::string, Recordm_callbacks
bool m_closeIOV
cond::DbConnection m_connection
cond::Time_t m_currentTime
bool m_dbstarted
bool m_freeInsert
cond::Loggerm_logdb
bool m_logdbOn
std::map< std::string,
cond::UserLogInfo
m_logheaders
cond::DbSession m_logSession
std::vector< std::pair
< std::string, std::string > > 
m_newtags
cond::DbSession m_session
cond::TimeType m_timetype
std::string m_timetypestr
bool m_withWrapper

Detailed Description

Definition at line 98 of file PoolDBOutputService.h.


Constructor & Destructor Documentation

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

Definition at line 59 of file PoolDBOutputService.cc.

References cond::DbConnection::configuration(), cond::DbConnection::configure(), connect(), cond::DbConnection::createSession(), edm::ParameterSet::exists(), fillRecord(), cond::findSpecs(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), popcon_last_value_cfg::logconnect, m_closeIOV, m_connection, m_freeInsert, m_logdbOn, m_logSession, m_session, m_timetype, m_timetypestr, cond::DbSession::open(), postEndJob(), postModule(), preBeginLumi(), preEventProcessing(), preModule(), cond::DbConnectionConfiguration::setParameters(), upload_serial_tpl::toPut, cond::TimeTypeSpecs::type, edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPreBeginLumi(), edm::ActivityRegistry::watchPreModule(), and edm::ActivityRegistry::watchPreProcessEvent().

                                                                                                             : 
  m_currentTime( 0 ),
  m_connection(),
  m_session(),
  m_logSession(),
  m_dbstarted( false ),
  m_logdb( 0 ),
  m_logdbOn( false ),
  m_closeIOV(false),
  m_freeInsert(false),
  m_withWrapper(false)
{

  m_closeIOV=iConfig.getUntrackedParameter<bool>("closeIOV",m_closeIOV);

  if( iConfig.exists("outOfOrder") ){
     m_freeInsert=iConfig.getUntrackedParameter<bool>("outOfOrder");
  }  

  m_timetypestr=iConfig.getUntrackedParameter< std::string >("timetype","runnumber");
  m_timetype=cond::findSpecs( m_timetypestr).type;

  std::string connect=iConfig.getParameter<std::string>("connect");
  std::string logconnect("");
  if( iConfig.exists("logconnect") ){
    logconnect=iConfig.getUntrackedParameter<std::string>("logconnect");
  }  

  edm::ParameterSet connectionPset = iConfig.getParameter<edm::ParameterSet>("DBParameters");
  m_connection.configuration().setParameters( connectionPset );
  m_connection.configure();
  
  m_session = m_connection.createSession();

  m_session.open( connect );
  
  if( !logconnect.empty() ){
    m_logdbOn=true;
    m_logSession = m_connection.createSession();
    m_logSession.open( logconnect );
  }

  typedef std::vector< edm::ParameterSet > Parameters;
  Parameters toPut=iConfig.getParameter<Parameters>("toPut");
  for(Parameters::iterator itToPut = toPut.begin(); itToPut != toPut.end(); ++itToPut)
    fillRecord( *itToPut);


  iAR.watchPreProcessEvent(this,&cond::service::PoolDBOutputService::preEventProcessing);
  iAR.watchPostEndJob(this,&cond::service::PoolDBOutputService::postEndJob);
  iAR.watchPreModule(this,&cond::service::PoolDBOutputService::preModule);
  iAR.watchPostModule(this,&cond::service::PoolDBOutputService::postModule);
  iAR.watchPreBeginLumi(this,&cond::service::PoolDBOutputService::preBeginLumi);
}
PoolDBOutputService::~PoolDBOutputService ( ) [virtual]

Definition at line 199 of file PoolDBOutputService.cc.

                                                    {
}

Member Function Documentation

void PoolDBOutputService::add ( GetToken const &  token,
cond::Time_t  time,
const std::string &  recordName,
bool  withlogging = false 
) [private]

Definition at line 279 of file PoolDBOutputService.cc.

References a, cond::DbScopedTransaction::commit(), exception, Exception, cond::service::PoolDBOutputService::Record::m_tag, cond::service::PoolDBOutputService::Record::m_withWrapper, cond::DbScopedTransaction::start(), cond::rpcobgas::time, cond::service::PoolDBOutputService::Record::timetypestr(), and python::IdGenerator::transaction.

Referenced by appendSinceTime().

                                                           {
  Record& myrecord=this->lookUpRecord(recordName);
  if (!m_dbstarted) this->initDB();
  if(withlogging){
    if(!m_logdb) throw cond::Exception("Log db was not set from PoolDBOutputService::add");
    m_logdb->getWriteLock();
  }

  std::string objToken;
  unsigned int payloadIdx=0;

  try{
    cond::DbScopedTransaction transaction(m_session);
    transaction.start(false);
    objToken = payloadToken(m_session,myrecord.m_withWrapper);
    payloadIdx= appendIOV(m_session,myrecord,objToken,time);
    transaction.commit();
    if(withlogging){
      std::string destconnect=m_session.connectionString();
      cond::UserLogInfo a=this->lookUpUserLogInfo(recordName);
      m_logdb->logOperationNow(a,destconnect,objToken,myrecord.m_tag,myrecord.timetypestr(),payloadIdx,time);
    }
  }catch(const std::exception& er){
    if(withlogging){
      std::string destconnect=m_session.connectionString();
      cond::UserLogInfo a=this->lookUpUserLogInfo(recordName);
      m_logdb->logFailedOperationNow(a,destconnect,objToken,myrecord.m_tag,myrecord.timetypestr(),payloadIdx,time,std::string(er.what()));
      m_logdb->releaseWriteLock();
    }
    throw cond::Exception(std::string(er.what()) + " from PoolDBOutputService::add ");
  }
  if(withlogging){
    m_logdb->releaseWriteLock();
  }
}
unsigned int PoolDBOutputService::appendIOV ( cond::DbSession pooldb,
Record record,
const std::string &  payloadToken,
cond::Time_t  sinceTime 
) [private]

Definition at line 334 of file PoolDBOutputService.cc.

References cond::IOVEditor::append(), idDealer::editor, Exception, cond::IOVEditor::freeInsert(), cond::service::PoolDBOutputService::Record::m_closeIOV, cond::service::PoolDBOutputService::Record::m_freeInsert, cond::service::PoolDBOutputService::Record::m_iovtoken, cond::service::PoolDBOutputService::Record::m_isNewTag, cond::service::PoolDBOutputService::Record::m_tag, cond::IOVEditor::stamp(), cond::IOVEditor::updateClosure(), and cond::userInfo().

                                                                        {
  if( record.m_isNewTag ) {
    throw cond::Exception(std::string("Cannot append to non-existing tag ") + record.m_tag + std::string(" from PoolDBOutputService::appendIOV"));  
  }

  cond::IOVEditor editor(pooldb,record.m_iovtoken);
  
  unsigned int payloadIdx =  record.m_freeInsert ? 
    editor.freeInsert(sinceTime,payloadToken) :
    editor.append(sinceTime,payloadToken);
  if (record.m_closeIOV) editor.updateClosure(sinceTime);
  editor.stamp(cond::userInfo(),false);
  return payloadIdx;
}
template<typename T >
void cond::service::PoolDBOutputService::appendSinceTime ( T payloadObj,
Summary summary,
cond::Time_t  sinceTime,
const std::string &  recordName,
bool  withlogging = false 
) [inline]

Definition at line 199 of file PoolDBOutputService.h.

References add().

                                                   {
        add( GetTokenFromPointer<T>(payloadObj,summary),
             sinceTime,
             recordName,
             withlogging);
      }
void cond::service::PoolDBOutputService::appendSinceTime ( const std::string &  payloadToken,
cond::Time_t  sinceTime,
const std::string &  recordName,
bool  withlogging = false 
) [inline]

Definition at line 214 of file PoolDBOutputService.h.

References add().

                                                    {
        add(GetTrivialToken(payloadToken),
            sinceTime,
            recordName,
            withlogging);
      }
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 191 of file PoolDBOutputService.h.

References ecalTPGAnalyzer_cfg::recordName.

Referenced by HLTPrescaleRecorder::endRun().

                                                                        {
        this->appendSinceTime<T>(payloadObj, 0, sinceTime, recordName, withlogging);
      }
cond::Time_t PoolDBOutputService::beginOfTime ( ) const

Definition at line 209 of file PoolDBOutputService.cc.

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

Referenced by HLTPrescaleRecorder::endRun().

                                                 {
  return timeTypeSpecs[m_timetype].beginValue;
}
void PoolDBOutputService::closeIOV ( Time_t  lastTill,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 353 of file PoolDBOutputService.cc.

References cond::DbScopedTransaction::commit(), idDealer::editor, Exception, cond::service::PoolDBOutputService::Record::m_iovtoken, cond::service::PoolDBOutputService::Record::m_isNewTag, cond::service::PoolDBOutputService::Record::m_tag, record, cond::IOVEditor::stamp(), cond::DbScopedTransaction::start(), python::IdGenerator::transaction, cond::IOVEditor::updateClosure(), and cond::userInfo().

                                                               {
  // not fully working.. not be used for now...
  Record & record  = lookUpRecord(recordName);
  if( record.m_isNewTag ) {
    throw cond::Exception(std::string("Cannot close non-existing tag ") + record.m_tag + std::string(" from PoolDBOutputService::closeIOV"));
  }
  cond::DbScopedTransaction transaction(m_session);
  transaction.start(false); 
  cond::IOVEditor editor(m_session,record.m_iovtoken);
  editor.updateClosure(lastTill);
  editor.stamp(cond::userInfo(),false);
  transaction.commit();
}
void cond::service::PoolDBOutputService::connect ( ) [private]

Referenced by PoolDBOutputService().

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 152 of file PoolDBOutputService.h.

Referenced by createNewIOV(), and HLTPrescaleRecorder::endRun().

                                                {
        this->createNewIOV(firstPayloadObj, 0, firstSinceTime, firstTillTime, recordName,withlogging);
      }
void PoolDBOutputService::createNewIOV ( GetToken const &  token,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
) [private]

Definition at line 219 of file PoolDBOutputService.cc.

References a, cond::MetaData::addMapping(), cond::IOVEditor::append(), cond::DbScopedTransaction::commit(), cond::IOVEditor::create(), idDealer::editor, exception, Exception, cond::service::PoolDBOutputService::Record::m_iovtoken, cond::service::PoolDBOutputService::Record::m_isNewTag, cond::service::PoolDBOutputService::Record::m_tag, cond::service::PoolDBOutputService::Record::m_timetype, cond::service::PoolDBOutputService::Record::m_withWrapper, cond::IOVEditor::stamp(), cond::DbScopedTransaction::start(), cond::service::PoolDBOutputService::Record::timetypestr(), cond::IOVEditor::token(), python::IdGenerator::transaction, and cond::userInfo().

                                                                                                                                                                             {
  Record& myrecord=this->lookUpRecord(recordName);
  if (!m_dbstarted) this->initDB();
  if(!myrecord.m_isNewTag) throw cond::Exception(myrecord.m_tag + " is not a new tag from PoolDBOutputService::createNewIOV");
  std::string iovToken;
  if(withlogging){
    if(!m_logdb) throw cond::Exception("Log db was not set from PoolDBOutputService::createNewIOV");
    m_logdb->getWriteLock();
  }
 
  std::string objToken;
  unsigned int payloadIdx=0;
  try{
    cond::DbScopedTransaction transaction(m_session);
    transaction.start(false);
    
    cond::IOVEditor editor(m_session);
    editor.create(myrecord.m_timetype, firstTillTime);
    objToken = payloadToken(m_session,myrecord.m_withWrapper);
    unsigned int payloadIdx=editor.append(firstSinceTime, objToken);
    iovToken=editor.token();
    editor.stamp(cond::userInfo(),false);
    
    cond::MetaData metadata(m_session);

    /*
    MetaDataEntry imetadata;
    imetadata.tagname=myrecord.m_tag;
    imetadata.iovtoken=iovToken;
    imetadata.timetype=m_timetype;
    imetadata.firstsince=firstSinceTime;
    metadata.addMapping(imetadata);
   */
    metadata.addMapping(myrecord.m_tag,iovToken,myrecord.m_timetype);
    transaction.commit();

    m_newtags.push_back( std::pair<std::string,std::string>(myrecord.m_tag,iovToken) );
    myrecord.m_iovtoken=iovToken;
    myrecord.m_isNewTag=false;
    if(withlogging){
      std::string destconnect=m_session.connectionString();
      cond::UserLogInfo a=this->lookUpUserLogInfo(recordName);
      m_logdb->logOperationNow(a,destconnect,objToken,myrecord.m_tag,myrecord.timetypestr(),payloadIdx,firstSinceTime);
    }
  }catch(const std::exception& er){ 
    if(withlogging){
      std::string destconnect=m_session.connectionString();
      cond::UserLogInfo a=this->lookUpUserLogInfo(recordName);
      m_logdb->logFailedOperationNow(a,destconnect,objToken,myrecord.m_tag,myrecord.timetypestr(),payloadIdx,firstSinceTime,std::string(er.what()));
      m_logdb->releaseWriteLock();
    }
    throw cond::Exception(std::string(er.what()) + " from PoolDBOutputService::createNewIOV ");
  }
  if(withlogging){
    m_logdb->releaseWriteLock();
  }
}
template<typename T >
void cond::service::PoolDBOutputService::createNewIOV ( T firstPayloadObj,
Summary summary,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
) [inline]

Definition at line 165 of file PoolDBOutputService.h.

References createNewIOV().

                                                                     {
        createNewIOV( GetTokenFromPointer<T>(firstPayloadObj, summary),
                      firstSinceTime,
                      firstTillTime,
                      recordName,
                      withlogging);     
      }
void cond::service::PoolDBOutputService::createNewIOV ( const std::string &  firstPayloadToken,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
) [inline]

Definition at line 177 of file PoolDBOutputService.h.

References createNewIOV().

                                                 {
        createNewIOV( GetTrivialToken(firstPayloadToken),
                      firstSinceTime,
                      firstTillTime,
                      recordName,
                      withlogging);
      }
cond::Time_t PoolDBOutputService::currentTime ( ) const

Definition at line 214 of file PoolDBOutputService.cc.

                                                 {
  return m_currentTime;
}
void cond::service::PoolDBOutputService::disconnect ( ) [private]
cond::Time_t PoolDBOutputService::endOfTime ( ) const

Definition at line 204 of file PoolDBOutputService.cc.

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

Referenced by HLTPrescaleRecorder::endRun(), and writeOne().

                                               {
  return timeTypeSpecs[m_timetype].endValue;
}
void PoolDBOutputService::fillRecord ( edm::ParameterSet pset) [private]

Definition at line 31 of file PoolDBOutputService.cc.

References cond::findSpecs(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cond::service::PoolDBOutputService::Record::m_closeIOV, cond::service::PoolDBOutputService::Record::m_freeInsert, cond::service::PoolDBOutputService::Record::m_idName, cond::service::PoolDBOutputService::Record::m_tag, cond::service::PoolDBOutputService::Record::m_timetype, cond::service::PoolDBOutputService::Record::m_withWrapper, and cond::TimeTypeSpecs::type.

Referenced by PoolDBOutputService().

                                                                  {
  Record thisrecord;

  thisrecord.m_idName = pset.getParameter<std::string>("record");
  thisrecord.m_tag = pset.getParameter<std::string>("tag");
  
  thisrecord.m_closeIOV =
    pset.getUntrackedParameter<bool>("closeIOV", m_closeIOV);

  thisrecord.m_withWrapper =  
    pset.getUntrackedParameter<bool>("withWrapper", m_withWrapper);
 
  thisrecord.m_freeInsert = 
    pset.getUntrackedParameter<bool>("outOfOrder",m_freeInsert);
  
  thisrecord.m_timetype=cond::findSpecs(pset.getUntrackedParameter< std::string >("timetype",m_timetypestr)).type;

  m_callbacks.insert(std::make_pair(thisrecord.m_idName,thisrecord));
 
  if(m_logdbOn){
      cond::UserLogInfo userloginfo;
      m_logheaders.insert(std::make_pair(thisrecord.m_idName,userloginfo));
  }
 

}
void PoolDBOutputService::initDB ( ) [private]

Definition at line 133 of file PoolDBOutputService.cc.

References cond::DbScopedTransaction::commit(), cond::IOVSchemaUtility::create(), exception, Exception, cond::MetaData::getToken(), cond::MetaData::hasTag(), cond::DbScopedTransaction::start(), and python::IdGenerator::transaction.

{
  if(m_dbstarted) return;
  try{
    cond::DbScopedTransaction transaction( m_session );
    transaction.start(false);
    IOVSchemaUtility ut(m_session);
    ut.create();
    cond::MetaData metadata(m_session);
    for(std::map<std::string,Record>::iterator it=m_callbacks.begin(); it!=m_callbacks.end(); ++it){
      //std::string iovtoken;
      if( !metadata.hasTag(it->second.m_tag) ){
        it->second.m_iovtoken="";
        it->second.m_isNewTag=true;
      }else{
        it->second.m_iovtoken=metadata.getToken(it->second.m_tag);
        it->second.m_isNewTag=false;
      }
    }
    transaction.commit();    
    //init logdb if required
    if(m_logdbOn){
      m_logdb=new cond::Logger(m_logSession);
      //m_logdb->getWriteLock();
      m_logdb->createLogDBIfNonExist();
      //m_logdb->releaseWriteLock();
    }
  }catch( const std::exception& er ){
    throw cond::Exception( std::string(er.what()) + " from PoolDBOutputService::initDB" );
  }
  m_dbstarted=true;
}
unsigned int cond::service::PoolDBOutputService::insertIOV ( cond::DbSession pooldb,
Record record,
const std::string &  payloadToken,
cond::Time_t  tillTime 
) [private]

Returns payload location index.

bool PoolDBOutputService::isNewTagRequest ( const std::string &  recordName)

Definition at line 125 of file PoolDBOutputService.cc.

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

Referenced by HLTPrescaleRecorder::endRun(), and writeOne().

                                                                            {
  Record& myrecord=this->lookUpRecord(recordName);
  if(!m_dbstarted) this->initDB();
  return myrecord.m_isNewTag;
}
cond::service::PoolDBOutputService::Record & PoolDBOutputService::lookUpRecord ( const std::string &  recordName) [private]

Definition at line 319 of file PoolDBOutputService.cc.

                                                                       {
  std::map<std::string,Record>::iterator it=m_callbacks.find(recordName);
  if(it==m_callbacks.end()) throw cond::UnregisteredRecordException(recordName + " from PoolDBOutputService::lookUpRecord");
  return it->second;
}
cond::UserLogInfo & PoolDBOutputService::lookUpUserLogInfo ( const std::string &  recordName) [private]

Definition at line 326 of file PoolDBOutputService.cc.

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

Definition at line 167 of file PoolDBOutputService.cc.

Referenced by PoolDBOutputService().

{
  if(m_logdb){
    delete m_logdb;
  }
}
void PoolDBOutputService::postModule ( const edm::ModuleDescription desc)

Definition at line 196 of file PoolDBOutputService.cc.

Referenced by PoolDBOutputService().

                                                                          {
}
void PoolDBOutputService::preBeginLumi ( const edm::LuminosityBlockID iLumiid,
const edm::Timestamp iTime 
)

Definition at line 189 of file PoolDBOutputService.cc.

References cond::lumiid, and edm::LuminosityBlockID::value().

Referenced by PoolDBOutputService().

                                                                                                            {
  if( m_timetype == cond::lumiid ){
    m_currentTime=iLumiid.value();
  }
}
void PoolDBOutputService::preEventProcessing ( const edm::EventID evtID,
const edm::Timestamp iTime 
)

Definition at line 175 of file PoolDBOutputService.cc.

References edm::EventID::run(), cond::runnumber, cond::timestamp, and edm::Timestamp::value().

Referenced by PoolDBOutputService().

{
  if( m_timetype == cond::runnumber ){//runnumber
    m_currentTime=iEvtid.run();
  }else if( m_timetype == cond::timestamp ){ //timestamp
    m_currentTime=iTime.value();
  }
}
void PoolDBOutputService::preModule ( const edm::ModuleDescription desc)

Definition at line 185 of file PoolDBOutputService.cc.

Referenced by PoolDBOutputService().

                                                                         {
}
const cond::Logger & PoolDBOutputService::queryLog ( ) const

Definition at line 380 of file PoolDBOutputService.cc.

References Exception.

                                             {
  if(!m_logdb) throw cond::Exception("Log database is not set from PoolDBOutputService::queryLog");
  return *m_logdb;
}
cond::DbSession PoolDBOutputService::session ( ) const

Definition at line 115 of file PoolDBOutputService.cc.

                                             {
  return m_session;
}
void PoolDBOutputService::setLogHeaderForRecord ( const std::string &  recordName,
const std::string &  provenance,
const std::string &  usertext 
)

Definition at line 371 of file PoolDBOutputService.cc.

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

{
  cond::UserLogInfo& myloginfo=this->lookUpUserLogInfo(recordName);
  myloginfo.provenance=dataprovenance;
  myloginfo.usertext=usertext;
}
std::string PoolDBOutputService::tag ( const std::string &  recordName)

Definition at line 120 of file PoolDBOutputService.cc.

                                                                {
  return this->lookUpRecord(recordName).m_tag;
}
void PoolDBOutputService::tagInfo ( const std::string &  recordName,
cond::TagInfo result 
)
template<typename T >
void cond::service::PoolDBOutputService::writeOne ( T payload,
Time_t  time,
const std::string &  recordName,
bool  withlogging = false 
) [inline]

Definition at line 125 of file PoolDBOutputService.h.

References ecalTPGAnalyzer_cfg::recordName, and cond::rpcobgas::time.

                                            {
        this->writeOne<T>(payload, 0, time, recordName, withlogging);
      }
template<typename T >
void cond::service::PoolDBOutputService::writeOne ( T payload,
Summary summary,
Time_t  time,
const std::string &  recordName,
bool  withlogging = false 
) [inline]

Definition at line 135 of file PoolDBOutputService.h.

References endOfTime(), isNewTagRequest(), ecalTPGAnalyzer_cfg::recordName, summarizeEdmComparisonLogfiles::summary, and cond::rpcobgas::time.

                                            {
        if (isNewTagRequest(recordName) ){
          createNewIOV<T>(payload, summary,
                          time, endOfTime(), recordName, withlogging);
        }else{
          appendSinceTime<T>(payload, summary, time, recordName, withlogging);
        }       
      }

Member Data Documentation

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

Definition at line 323 of file PoolDBOutputService.h.

Definition at line 329 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

Definition at line 320 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

Definition at line 319 of file PoolDBOutputService.h.

Definition at line 325 of file PoolDBOutputService.h.

Definition at line 331 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

Definition at line 326 of file PoolDBOutputService.h.

Definition at line 327 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

Definition at line 335 of file PoolDBOutputService.h.

Definition at line 322 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

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

Definition at line 324 of file PoolDBOutputService.h.

Definition at line 321 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

Definition at line 317 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

Definition at line 318 of file PoolDBOutputService.h.

Referenced by PoolDBOutputService().

Definition at line 333 of file PoolDBOutputService.h.