diff --git a/CondCore/CondDB/interface/IOVProxy.h b/CondCore/CondDB/interface/IOVProxy.h index bf6c877e6ab7d..6216ccac67a74 100644 --- a/CondCore/CondDB/interface/IOVProxy.h +++ b/CondCore/CondDB/interface/IOVProxy.h @@ -75,6 +75,9 @@ namespace cond { // full=true load the full iovSequence void load( const std::string& tag, bool full=false ); + // loads in memory the tag information and the iov groups + void load( const std::string& tag, const boost::posix_time::ptime& snapshottime, bool full=false ); + // reset the data in memory and execute again the queries for the current tag void reload(); diff --git a/CondCore/CondDB/interface/PayloadProxy.h b/CondCore/CondDB/interface/PayloadProxy.h index 9d6dc9031cc27..52fc895cc2242 100644 --- a/CondCore/CondDB/interface/PayloadProxy.h +++ b/CondCore/CondDB/interface/PayloadProxy.h @@ -28,6 +28,8 @@ namespace cond { void setUp( Session dbSession ); void loadTag( const std::string& tag ); + + void loadTag( const std::string& tag, const boost::posix_time::ptime& snapshotTime ); void reload(); diff --git a/CondCore/CondDB/interface/Session.h b/CondCore/CondDB/interface/Session.h index 8d89cea9ebd9d..53e13a5865d96 100644 --- a/CondCore/CondDB/interface/Session.h +++ b/CondCore/CondDB/interface/Session.h @@ -86,10 +86,14 @@ namespace cond { void createDatabase(); // read access to the iov sequence. - // by default ( full=false ) the iovs are lazy-loaded in groups when required, with repeatable queries ( for FronTier ) - // full=true will load the entire sequence in memory. Mainly for test/debugging. + // the iovs are lazy-loaded in groups when required, with repeatable queries ( for FronTier ) + IOVProxy readIov( const std::string& tag, bool full=false ); + + // read access to the iov sequence. + // the iovs are lazy-loaded in groups when required, with repeatable queries ( for FronTier ) IOVProxy readIov( const std::string& tag, - bool full=false );//,const boost::posix_time::ptime& snapshottime ) + const boost::posix_time::ptime& snapshottime, + bool full=false ); // bool existsIov( const std::string& tag ); diff --git a/CondCore/CondDB/interface/Time.h b/CondCore/CondDB/interface/Time.h index fd904765b12b4..a161f5921cc41 100644 --- a/CondCore/CondDB/interface/Time.h +++ b/CondCore/CondDB/interface/Time.h @@ -19,6 +19,8 @@ namespace cond { const Time_t MAX_VAL(std::numeric_limits::max()); const Time_t MIN_VAL(0); + + static constexpr const char* const MAX_TIMESTAMP = "9999-12-31 23:59:59.000"; typedef cond::UnpackedTime UnpackedTime; diff --git a/CondCore/CondDB/interface/Types.h b/CondCore/CondDB/interface/Types.h index 03dcf1a48ace8..d10ad30330290 100644 --- a/CondCore/CondDB/interface/Types.h +++ b/CondCore/CondDB/interface/Types.h @@ -98,6 +98,14 @@ namespace cond { std::string execmessage; }; + struct GTMetadata_t { + Time_t validity; + std::string description; + std::string release; + boost::posix_time::ptime insertionTime; + boost::posix_time::ptime snapshotTime; + }; + class GTEntry_t { public: GTEntry_t(): diff --git a/CondCore/CondDB/interface/Utils.h b/CondCore/CondDB/interface/Utils.h index 6865aad251e15..175faf673f648 100644 --- a/CondCore/CondDB/interface/Utils.h +++ b/CondCore/CondDB/interface/Utils.h @@ -84,7 +84,7 @@ namespace cond { inline std::string convertoToOracleConnection(const std::string & input){ // leave the connection string unmodified for sqlite - if( input.find("sqlite") == 0 ) return input; + if( input.find("sqlite") == 0 || input.find("oracle") == 0) return input; //static const boost::regex trivial("oracle://(cms_orcon_adg|cms_orcoff_prep)/([_[:alnum:]]+?)"); static const boost::regex short_frontier("frontier://([[:alnum:]]+?)/([_[:alnum:]]+?)"); diff --git a/CondCore/CondDB/python/CondDB_cfi.py b/CondCore/CondDB/python/CondDB_cfi.py index 045d3287b3f0e..b5ce561eee9fc 100644 --- a/CondCore/CondDB/python/CondDB_cfi.py +++ b/CondCore/CondDB/python/CondDB_cfi.py @@ -6,7 +6,8 @@ authenticationSystem = cms.untracked.int32(0), messageLevel = cms.untracked.int32(0), ), - connect = cms.string(''), ##db/schema" + connect = cms.string(''), + snapshotTime = cms.string(''), dbFormat = cms.untracked.int32(0) ) diff --git a/CondCore/CondDB/src/IDbSchema.h b/CondCore/CondDB/src/IDbSchema.h index b019eb0233122..92f64379bb445 100644 --- a/CondCore/CondDB/src/IDbSchema.h +++ b/CondCore/CondDB/src/IDbSchema.h @@ -54,7 +54,10 @@ namespace cond { const boost::posix_time::ptime& snapshotTime, std::vector >& iovs) = 0; virtual size_t selectLatest( const std::string& tag, std::vector >& iovs) = 0; + virtual size_t selectSnapshot( const std::string& tag, const boost::posix_time::ptime& snapshotTime, + std::vector >& iovs) = 0; virtual bool getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ) = 0; + virtual bool getSnapshotLastIov( const std::string& tag, const boost::posix_time::ptime& snapshotTime, cond::Time_t& since, cond::Hash& hash ) = 0; virtual bool getSize( const std::string& tag, size_t& size ) = 0; virtual bool getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size ) = 0; virtual void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash, diff --git a/CondCore/CondDB/src/IOVProxy.cc b/CondCore/CondDB/src/IOVProxy.cc index 210d8cb8a7f9d..30e92658f1717 100644 --- a/CondCore/CondDB/src/IOVProxy.cc +++ b/CondCore/CondDB/src/IOVProxy.cc @@ -16,6 +16,7 @@ namespace cond { // tag data std::string tag; + boost::posix_time::ptime snapshotTime; cond::TimeType timeType; std::string payloadType; cond::SynchronizationType synchronizationType = cond::OFFLINE; @@ -121,7 +122,15 @@ namespace cond { return *this; } - void IOVProxy::load( const std::string& tag, bool full ){ + void IOVProxy::load( const std::string& tag, + bool full ){ + boost::posix_time::ptime notime; + load( tag, notime, full ); + } + + void IOVProxy::load( const std::string& tag, + const boost::posix_time::ptime& snapshotTime, + bool full ){ if( !m_data.get() ) return; // clear @@ -139,16 +148,25 @@ namespace cond { // now get the iov sequence when required if( full ) { // load the full iov sequence in this case! - m_session->iovSchema().iovTable().selectLatest( m_data->tag, m_data->iovSequence ); + if( snapshotTime.is_not_a_date_time() ){ + m_session->iovSchema().iovTable().selectLatest( m_data->tag, m_data->iovSequence ); + } else { + m_session->iovSchema().iovTable().selectSnapshot( m_data->tag, snapshotTime, m_data->iovSequence ); + } m_data->groupLowerIov = cond::time::MIN_VAL; m_data->groupHigherIov = cond::time::MAX_VAL; } else { - m_session->iovSchema().iovTable().selectGroups( m_data->tag, m_data->sinceGroups ); + if( snapshotTime.is_not_a_date_time() ){ + m_session->iovSchema().iovTable().selectGroups( m_data->tag, m_data->sinceGroups ); + } else { + m_session->iovSchema().iovTable().selectSnapshotGroups( m_data->tag, snapshotTime, m_data->sinceGroups ); + } } + m_data->snapshotTime = snapshotTime; } void IOVProxy::reload(){ - if(m_data.get() && !m_data->tag.empty()) load( m_data->tag ); + if(m_data.get() && !m_data->tag.empty()) load( m_data->tag, m_data->snapshotTime ); } void IOVProxy::reset(){ @@ -206,7 +224,11 @@ namespace cond { void IOVProxy::fetchSequence( cond::Time_t lowerGroup, cond::Time_t higherGroup ){ m_data->iovSequence.clear(); - m_session->iovSchema().iovTable().selectLatestByGroup( m_data->tag, lowerGroup, higherGroup, m_data->iovSequence ); + if( m_data->snapshotTime.is_not_a_date_time() ){ + m_session->iovSchema().iovTable().selectLatestByGroup( m_data->tag, lowerGroup, higherGroup, m_data->iovSequence ); + } else { + m_session->iovSchema().iovTable().selectSnapshotByGroup( m_data->tag, lowerGroup, higherGroup, m_data->snapshotTime, m_data->iovSequence ); + } if( m_data->iovSequence.empty() ){ m_data->groupLowerIov = cond::time::MAX_VAL; @@ -297,9 +319,13 @@ namespace cond { cond::Iov_t IOVProxy::getLast(){ checkTransaction( "IOVProxy::getLast" ); cond::Iov_t ret; - if( m_session->iovSchema().iovTable().getLastIov( m_data->tag, ret.since, ret.payloadId ) ){ - ret.till = cond::time::MAX_VAL; + bool ok = false; + if( m_data->snapshotTime.is_not_a_date_time() ){ + ok = m_session->iovSchema().iovTable().getLastIov( m_data->tag, ret.since, ret.payloadId ); + } else { + ok = m_session->iovSchema().iovTable().getSnapshotLastIov( m_data->tag, m_data->snapshotTime, ret.since, ret.payloadId ); } + if(ok) ret.till = cond::time::MAX_VAL; return ret; } @@ -310,7 +336,11 @@ namespace cond { int IOVProxy::sequenceSize() const { checkTransaction( "IOVProxy::sequenceSize" ); size_t ret = 0; - m_session->iovSchema().iovTable().getSize( m_data->tag, ret ); + if( m_data->snapshotTime.is_not_a_date_time() ){ + m_session->iovSchema().iovTable().getSize( m_data->tag, ret ); + } else { + m_session->iovSchema().iovTable().getSnapshotSize( m_data->tag, m_data->snapshotTime, ret ); + } return ret; } diff --git a/CondCore/CondDB/src/IOVSchema.cc b/CondCore/CondDB/src/IOVSchema.cc index 7612f2c31d7fd..427679ada9efa 100644 --- a/CondCore/CondDB/src/IOVSchema.cc +++ b/CondCore/CondDB/src/IOVSchema.cc @@ -210,6 +210,23 @@ namespace cond { return iovs.size()-initialSize; } + size_t IOV::Table::selectSnapshot( const std::string& tag, + const boost::posix_time::ptime& snapshotTime, + std::vector >& iovs){ + Query< SINCE, PAYLOAD_HASH > q( m_schema ); + q.addCondition( tag ); + q.addCondition( snapshotTime,"<=" ); + q.addOrderClause(); + q.addOrderClause( false ); + size_t initialSize = iovs.size(); + for ( auto row : q ) { + // starting from the second iov in the array, skip the rows with older timestamp + if( iovs.size()-initialSize && std::get<0>(iovs.back()) == std::get<0>(row) ) continue; + iovs.push_back( row ); + } + return iovs.size()-initialSize; + } + bool IOV::Table::getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ){ Query< SINCE, PAYLOAD_HASH > q( m_schema ); q.addCondition( tag ); @@ -223,6 +240,20 @@ namespace cond { return false; } + bool IOV::Table::getSnapshotLastIov( const std::string& tag, const boost::posix_time::ptime& snapshotTime, cond::Time_t& since, cond::Hash& hash ){ + Query< SINCE, PAYLOAD_HASH > q( m_schema ); + q.addCondition( tag ); + q.addCondition( snapshotTime,"<=" ); + q.addOrderClause( false ); + q.addOrderClause( false ); + for ( auto row : q ) { + since = std::get<0>(row); + hash = std::get<1>(row); + return true; + } + return false; + } + bool IOV::Table::getSize( const std::string& tag, size_t& size ){ Query< SEQUENCE_SIZE > q( m_schema ); q.addCondition( tag ); diff --git a/CondCore/CondDB/src/IOVSchema.h b/CondCore/CondDB/src/IOVSchema.h index 0a999c875ab4d..6a450e83e2f78 100644 --- a/CondCore/CondDB/src/IOVSchema.h +++ b/CondCore/CondDB/src/IOVSchema.h @@ -120,7 +120,11 @@ namespace cond { const boost::posix_time::ptime& snapshotTime, std::vector >& iovs); size_t selectLatest( const std::string& tag, std::vector >& iovs); + size_t selectSnapshot( const std::string& tag, + const boost::posix_time::ptime& snapshotTime, + std::vector >& iovs); bool getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ); + bool getSnapshotLastIov( const std::string& tag, const boost::posix_time::ptime& snapshotTime, cond::Time_t& since, cond::Hash& hash ); bool getSize( const std::string& tag, size_t& size ); bool getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size ); void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime& insertTime); diff --git a/CondCore/CondDB/src/OraDbSchema.cc b/CondCore/CondDB/src/OraDbSchema.cc index 18da671c097d7..27bff70643a77 100644 --- a/CondCore/CondDB/src/OraDbSchema.cc +++ b/CondCore/CondDB/src/OraDbSchema.cc @@ -210,7 +210,13 @@ namespace cond { return ret; } - bool OraIOVTable::getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ){ + size_t OraIOVTable::selectSnapshot( const std::string& tag, const boost::posix_time::ptime&, + std::vector >& iovs){ + // no (easy) way to do it... + return selectLatest( tag, iovs ); + } + + bool OraIOVTable::getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ){ if(!m_cache.load( tag ) || m_cache.iovSequence().size()==0 ) return false; cond::IOVElementProxy last = *(--m_cache.iovSequence().end()); since = last.since(); @@ -218,6 +224,12 @@ namespace cond { return true; } + bool OraIOVTable::getSnapshotLastIov( const std::string& tag, const boost::posix_time::ptime&, + cond::Time_t& since, cond::Hash& hash ){ + // no (easy) way to do it... + return getLastIov( tag, since, hash ); + } + bool OraIOVTable::getSize( const std::string& tag, size_t& size ){ if(!m_cache.load( tag )) return false; size = m_cache.iovSequence().size(); diff --git a/CondCore/CondDB/src/OraDbSchema.h b/CondCore/CondDB/src/OraDbSchema.h index c791033a9fcf1..d1087a7dffb9e 100644 --- a/CondCore/CondDB/src/OraDbSchema.h +++ b/CondCore/CondDB/src/OraDbSchema.h @@ -100,7 +100,9 @@ namespace cond { const boost::posix_time::ptime& snapshotTime, std::vector >& iovs); size_t selectLatest( const std::string& tag, std::vector >& iovs); + size_t selectSnapshot( const std::string& tag, const boost::posix_time::ptime& snapshotTime, std::vector >& iovs); bool getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash ); + bool getSnapshotLastIov( const std::string& tag, const boost::posix_time::ptime& snapshotTime, cond::Time_t& since, cond::Hash& hash ); bool getSize( const std::string& tag, size_t& size ); bool getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size ); void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash, diff --git a/CondCore/CondDB/src/PayloadProxy.cc b/CondCore/CondDB/src/PayloadProxy.cc index 78c2bfa30d8b0..012d2e8593d87 100644 --- a/CondCore/CondDB/src/PayloadProxy.cc +++ b/CondCore/CondDB/src/PayloadProxy.cc @@ -22,9 +22,16 @@ namespace cond { invalidateCache(); } + void BasePayloadProxy::loadTag( const std::string& tag, const boost::posix_time::ptime& snapshotTime ){ + m_session.transaction().start(true); + m_iovProxy = m_session.readIov( tag, snapshotTime ); + m_session.transaction().commit(); + invalidateCache(); + } + void BasePayloadProxy::reload(){ std::string tag = m_iovProxy.tag(); - if( !tag.empty() ) loadTag( tag ); + if( !tag.empty() ) m_iovProxy.reload(); } ValidityInterval BasePayloadProxy::setIntervalFor(cond::Time_t time, bool load) { diff --git a/CondCore/CondDB/src/Session.cc b/CondCore/CondDB/src/Session.cc index 2b3e4ea432577..8af24a724cd3b 100644 --- a/CondCore/CondDB/src/Session.cc +++ b/CondCore/CondDB/src/Session.cc @@ -85,6 +85,15 @@ namespace cond { return proxy; } + IOVProxy Session::readIov( const std::string& tag, + const boost::posix_time::ptime& snapshottime, + bool full ){ + m_session->openIovDb(); + IOVProxy proxy( m_session ); + proxy.load( tag, snapshottime, full ); + return proxy; + } + bool Session::existsIov( const std::string& tag ){ m_session->openIovDb(); return m_session->iovSchema().tagTable().select( tag ); diff --git a/CondCore/CondDB/test/BuildFile.xml b/CondCore/CondDB/test/BuildFile.xml index 98e47b33eaad8..5d93e6a0e35f9 100644 --- a/CondCore/CondDB/test/BuildFile.xml +++ b/CondCore/CondDB/test/BuildFile.xml @@ -9,6 +9,8 @@ + + diff --git a/CondCore/CondDB/test/testConditionDatabase_0.cpp b/CondCore/CondDB/test/testConditionDatabase_0.cpp index 3c9ea9bdc454c..911eee0a36a7e 100644 --- a/CondCore/CondDB/test/testConditionDatabase_0.cpp +++ b/CondCore/CondDB/test/testConditionDatabase_0.cpp @@ -126,7 +126,7 @@ int main (int argc, char** argv) int ret = 0; edmplugin::PluginManager::Config config; edmplugin::PluginManager::configure(edmplugin::standard::config()); - std::string connectionString0("sqlite_file:cms_conditions.db"); + std::string connectionString0("sqlite_file:cms_conditions_0.db"); std::cout <<"## Running with CondDBV2 format..."< +#include +#include +#include + +using namespace cond::persistency; + +void readTag( const std::string& tag, Session& session, const boost::posix_time::ptime& snapshotTime ){ + IOVProxy proxy; + if( snapshotTime.is_not_a_date_time() ) proxy = session.readIov( tag ); + else proxy = session.readIov( tag, snapshotTime ); + std::cout <<"> iov loaded size="< iov sequence size="<[0] not found!"<[1] not found!"< Connecting with db in "<( "MyTag", cond::runnumber ); + editor.setDescription("Test for timestamp selection"); + editor.insert( 1, p0 ); + editor.insert( 101, p1 ); + editor.insert( 201, p2 ); + std::cout <<"> inserted 3 iovs..."< iov changes flushed..."< iov changes committed!..."<setUp( session ); - m_proxy->loadTag( tag); + m_proxy->loadTag( tag, snapshotTime ); m_edmProxy.reset(new DataProxy(m_proxy)); addInfo(il, cs, tag); } diff --git a/CondCore/ESSources/plugins/CondDBESSource.cc b/CondCore/ESSources/plugins/CondDBESSource.cc index 08de26cb18877..198f523321ca0 100644 --- a/CondCore/ESSources/plugins/CondDBESSource.cc +++ b/CondCore/ESSources/plugins/CondDBESSource.cc @@ -132,6 +132,11 @@ CondDBESSource::CondDBESSource( const edm::ParameterSet& iConfig ) : } else if( iConfig.exists("connect") ) // default connection string m_connectionString= iConfig.getParameter("connect"); + // snapshot + boost::posix_time::ptime snapshotTime; + if( iConfig.exists( "snapshotTime" ) ) + snapshotTime = boost::posix_time::time_from_string( iConfig.getParameter("snapshotTime" ) ); + // connection configuration if( iConfig.exists("DBParameters") ) { edm::ParameterSet connectionPset = iConfig.getParameter( "DBParameters" ); @@ -170,11 +175,14 @@ CondDBESSource::CondDBESSource( const edm::ParameterSet& iConfig ) : fillList(pfnPostfix, pfnPostfixList, globaltagList.size(), "pfnPostfix"); } + cond::GTMetadata_t gtMetadata; fillTagCollectionFromDB(connectList, pfnPrefixList, pfnPostfixList, globaltagList, - replacements); + replacements, + gtMetadata); + if(snapshotTime.is_not_a_date_time()) snapshotTime = gtMetadata.snapshotTime; TagCollection::iterator it; TagCollection::iterator itBeg = m_tagCollection.begin(); @@ -227,7 +235,7 @@ CondDBESSource::CondDBESSource( const edm::ParameterSet& iConfig ) : // instert in the map m_proxies.insert(std::make_pair(it->second.recordName(), proxy)); // initialize - proxy->lateInit(nsess, tag, it->second.recordLabel(), connStr); + proxy->lateInit(nsess, tag, snapshotTime, it->second.recordLabel(), connStr); } // one loaded expose all other tags to the Proxy! @@ -380,11 +388,7 @@ CondDBESSource::setIntervalFor( const edm::eventsetup::EventSetupRecordKey& iKey cond::Time_t abtime = cond::time::fromIOVSyncValue( iTime, timetype ); userTime = ( 0 == abtime ); - //std::cout<<"abtime "< & tagcoll ) + std::set< cond::GTEntry_t > & tagcoll, + cond::GTMetadata_t& gtMetadata ) { if ( !roottag.empty() ) { if ( connectionString.empty() ) @@ -555,7 +560,8 @@ void CondDBESSource::fillTagCollectionFromGT( const std::string & connectionStri } cond::persistency::Session session = m_connection.createSession( connectionString ); session.transaction().start( true ); - cond::persistency::GTProxy gtp = session.readGlobalTag( roottag, prefix, postfix ); + cond::persistency::GTProxy gtp = session.readGlobalTag( roottag, prefix, postfix ); + gtMetadata.snapshotTime = gtp.snapshotTime(); for( const auto& gte : gtp ){ tagcoll.insert( gte ); } @@ -569,7 +575,8 @@ void CondDBESSource::fillTagCollectionFromDB( const std::vector & c const std::vector & prefixList, const std::vector & postfixList, const std::vector & roottagList, - std::map& replacement ) + std::map& replacement, + cond::GTMetadata_t& gtMetadata ) { std::set< cond::GTEntry_t > tagcoll; @@ -577,7 +584,7 @@ void CondDBESSource::fillTagCollectionFromDB( const std::vector & c auto prefix = prefixList.begin(); auto postfix = postfixList.begin(); for( auto roottag = roottagList.begin(); roottag != roottagList.end(); ++roottag, ++connectionString, ++prefix, ++postfix) { - fillTagCollectionFromGT(*connectionString, *prefix, *postfix, *roottag, tagcoll); + fillTagCollectionFromGT(*connectionString, *prefix, *postfix, *roottag, tagcoll, gtMetadata); } std::set::iterator tagCollIter; @@ -605,11 +612,6 @@ void CondDBESSource::fillTagCollectionFromDB( const std::vector & c std::map::iterator replacementBegin = replacement.begin(); std::map::iterator replacementEnd = replacement.end(); for( replacementIter = replacementBegin; replacementIter != replacementEnd; ++replacementIter ){ - // std::cout<<"appending"<second.pfn<second.objectname<second.tag<second.recordname< & tagcoll); + std::set< cond::GTEntry_t > & tagcoll, + cond::GTMetadata_t& gtMetadata); void fillTagCollectionFromDB( const std::vector & connectionStringList, const std::vector & prefixList, const std::vector & postfixList, const std::vector & roottagList, - std::map& replacement); + std::map& replacement, + cond::GTMetadata_t& gtMetadata); }; #endif diff --git a/CondCore/ESSources/python/PoolDBESSource_cfi.py b/CondCore/ESSources/python/PoolDBESSource_cfi.py index 2a028c35eba8c..66ae3ac470648 100644 --- a/CondCore/ESSources/python/PoolDBESSource_cfi.py +++ b/CondCore/ESSources/python/PoolDBESSource_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from CondCore.DBCommon.CondDBSetup_cfi import * +from CondCore.CondDB.CondDB_cfi import * GlobalTag = cms.ESSource("PoolDBESSource", CondDBSetup, @@ -8,8 +8,8 @@ RefreshOpenIOVs = cms.untracked.bool(False), RefreshEachRun = cms.untracked.bool(False), ReconnectEachRun = cms.untracked.bool(False), - connect = cms.string('frontier://FrontierProd/CMS_COND_31X_GLOBALTAG'), - globaltag = cms.string('UNSPECIFIED::All'), - toGet = cms.VPSet( ), # hook to override or add single payloads - BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService') + snapshotTime = cms.string(''), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), + globaltag = cms.string(''), + toGet = cms.VPSet( ) # hook to override or add single payloads ) diff --git a/CondCore/ESSources/test/python/loadall_from_gt_cfg.py b/CondCore/ESSources/test/python/loadall_from_gt_cfg.py index d70b3d4955cea..92182845455ee 100644 --- a/CondCore/ESSources/test/python/loadall_from_gt_cfg.py +++ b/CondCore/ESSources/test/python/loadall_from_gt_cfg.py @@ -7,7 +7,7 @@ VarParsing.VarParsing.varType.int, "Run number; default gives latest IOV") options.register('globalTag', - 'GR_P_V32', #default value + 'GR_P_V50', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "GlobalTag") @@ -18,25 +18,20 @@ process = cms.Process("TEST") -process.add_(cms.Service("PrintEventSetupDataRetrieval", printProviders=cms.untracked.bool(True))) +#process.add_(cms.Service("PrintEventSetupDataRetrieval", printProviders=cms.untracked.bool(True))) -CondDBSetup = cms.PSet( DBParameters = cms.PSet(authenticationPath = cms.untracked.string('.'), - connectionRetrialPeriod = cms.untracked.int32(10), - idleConnectionCleanupPeriod = cms.untracked.int32(10), - messageLevel = cms.untracked.int32(0), - enablePoolAutomaticCleanUp = cms.untracked.bool(False), - enableConnectionSharing = cms.untracked.bool(True), - connectionRetrialTimeOut = cms.untracked.int32(60), - connectionTimeOut = cms.untracked.int32(0), - enableReadOnlySessionOnUpdateConnection = cms.untracked.bool(False) +CondDBSetup = cms.PSet( DBParameters = cms.PSet( + messageLevel = cms.untracked.int32(1), ) ) process.GlobalTag = cms.ESSource("PoolDBESSource", CondDBSetup, - connect = cms.string('frontier://FrontierProd/CMS_COND_31X_GLOBALTAG'), + #connect = cms.string('oracle://cms_orcon_adg/CMS_CONDITIONS'), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), # connect = cms.string('sqlite_fip:CondCore/TagCollection/data/GlobalTag.db'), #For use during release integration - globaltag = cms.string('UNSPECIFIED::All'), + globaltag = cms.string(''), + snapshotTime = cms.string('2012-01-20 23:59:59.000'), RefreshEachRun=cms.untracked.bool(False), DumpStat=cms.untracked.bool(False), pfnPrefix=cms.untracked.string(''), @@ -44,7 +39,7 @@ ) -process.GlobalTag.globaltag = options.globalTag+'::All' +process.GlobalTag.globaltag = options.globalTag process.GlobalTag.DumpStat = True # 'GR09_P_V6::All' #'CRAFT09_R_V9::All' diff --git a/CondCore/ESSources/test/python/loadall_from_gt_empty_source_cfg.py b/CondCore/ESSources/test/python/loadall_from_gt_empty_source_cfg.py index ae62eee2d96c0..406647aab3a2a 100644 --- a/CondCore/ESSources/test/python/loadall_from_gt_empty_source_cfg.py +++ b/CondCore/ESSources/test/python/loadall_from_gt_empty_source_cfg.py @@ -15,7 +15,7 @@ VarParsing.VarParsing.varType.int, "Message level; default to 0") options.register('globalTag', - 'START70_V2::All', #default value + 'GR_P_V50', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "GlobalTag") @@ -97,9 +97,9 @@ process.GlobalTag = cms.ESSource( "PoolDBESSource", CondDBSetup, - connect = cms.string( 'frontier://FrontierProd/CMS_COND_31X_GLOBALTAG' ), + connect = cms.string( 'frontier://FrontierProd/CMS_CONDITIONS' ), #connect = cms.string('sqlite_fip:CondCore/TagCollection/data/GlobalTag.db'), #For use during release integration - globaltag = cms.string( 'UNSPECIFIED::All' ), + globaltag = cms.string( '' ), RefreshAlways = cms.untracked.bool( refreshAlways ), RefreshOpenIOVs = cms.untracked.bool( refreshOpenIOVs ), RefreshEachRun=cms.untracked.bool( refreshEachRun ),