CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Classes | Enumerations | Functions
cond::persistency Namespace Reference

Namespaces

 GLOBAL_TAG
 
 GLOBAL_TAG_MAP
 
 IOV
 
 PAYLOAD
 
 TAG
 
 TAG_MIGRATION
 

Classes

struct  AttributeTypeName
 
struct  AttributeTypeName< boost::posix_time::ptime >
 
struct  AttributeTypeName< cond::Binary >
 
struct  AttributeTypeName< cond::SynchronizationType >
 
struct  AttributeTypeName< cond::TimeType >
 
class  BasePayloadProxy
 
class  BulkInserter
 
class  CondDBTransaction
 
class  CondGetter
 
class  ConnectionPool
 
struct  DefineQueryOutput
 
struct  DefineQueryOutput< boost::posix_time::ptime >
 
struct  DefineQueryOutput< cond::Binary >
 
struct  DefineQueryOutput< cond::SynchronizationType >
 
struct  DefineQueryOutput< cond::TimeType >
 
struct  DefineQueryOutput< std::array< char, n > >
 
class  DeleteBuffer
 
class  Exception
 Base exception class for the object to relational access. More...
 
struct  GetFromRow
 
struct  GetFromRow< boost::posix_time::ptime >
 
struct  GetFromRow< cond::Binary >
 
struct  GetFromRow< cond::SynchronizationType >
 
struct  GetFromRow< cond::TimeType >
 
struct  GetFromRow< std::array< char, n > >
 
class  GTEditor
 
class  GTEditorData
 
class  GTProxy
 
class  GTProxyData
 
class  GTSchema
 
class  IGTMapTable
 
class  IGTSchema
 
class  IGTTable
 
class  IIOVSchema
 
class  IIOVTable
 
class  IOVCache
 
struct  IOVComp
 
class  IOVEditor
 
class  IOVEditorData
 
class  IOVProxy
 
class  IOVProxyData
 
class  IOVSchema
 
class  IPayloadTable
 
class  ITagMigrationTable
 
class  ITagTable
 
class  ITransaction
 
class  KeyList
 
class  OraGTMapTable
 
class  OraGTSchema
 
class  OraGTTable
 
class  OraIOVSchema
 
class  OraIOVTable
 
class  OraPayloadTable
 
class  OraTagTable
 
class  OraTransaction
 
class  PayloadProxy
 
class  PayloadProxy< cond::persistency::KeyList >
 
class  Query
 
class  QueryIterator
 
class  RowBuffer
 
class  Session
 
class  SessionImpl
 
class  TableDescription
 
class  Transaction
 
class  TransactionScope
 
class  UpdateBuffer
 

Enumerations

enum  DbAuthenticationSystem { UndefinedAuthentication =0, CondDbKey, CoralXMLFile }
 
enum  UpdatePolicy { NEW =0, UPDATE, REPLACE }
 

Functions

BackendType checkBackendType (boost::shared_ptr< coral::ISessionProxy > &coralSession, const std::string &connectionString)
 
bool compareTags (const std::string &firstTag, Session &firstSession, const std::string &firstFileName, const std::string &secondTag, Session &secondSession, const std::string &secondFileName)
 
std::string convertoToOracleConnection (const std::string &input)
 
bool copyIov (Session &session, const std::string &sourceTag, const std::string &destTag, cond::Time_t souceSince, cond::Time_t destSince, bool log)
 
size_t copyTag (const std::string &sourceTag, Session &sourceSession, const std::string &destTag, Session &destSession, UpdatePolicy policy, bool log, bool forValidation)
 
unsigned int countslash (const std::string &input)
 
size_t exportTagToFile (const std::string &tag, const std::string &destTag, Session &session, const std::string fileName)
 
template<typename T >
void f_add_column_description (coral::TableDescription &table, const std::string &columnName, size_t size=0, bool notNull=true)
 
std::pair< std::string,
boost::shared_ptr< void > > 
fetch (const cond::Hash &payloadId, Session &session)
 
std::pair< std::string,
boost::shared_ptr< void > > 
fetchOne (const std::string &payloadTypeName, const cond::Binary &data, const cond::Binary &streamerInfo, boost::shared_ptr< void > payloadPtr, bool is Ora)
 
std::pair< std::string,
boost::shared_ptr< void > > 
fetchOne (const std::string &payloadTypeName, const cond::Binary &data, const cond::Binary &streamerInfo, boost::shared_ptr< void > payloadPtr, bool isOra)
 
std::pair< std::string,
std::string > 
getConnectionParams (const std::string &connectionString, const std::string &transactionId)
 
std::string getConnectionProtocol (const std::string &connectionString)
 
cond::Hash import (const std::string &inputTypeName, const void *inputPtr, Session &destination)
 
size_t importIovs (const std::string &sourceTag, Session &sourceSession, const std::string &destTag, Session &destSession, cond::Time_t begin, cond::Time_t end, bool log)
 
template<typename T , typename Arg1 >
bool is_same_any ()
 
template<typename T , typename Arg1 , typename Arg2 , typename... Args>
bool is_same_any ()
 
cond::Hash makeHash (const std::string &objectType, const cond::Binary &data)
 
static const std::string ORA_IOV_TABLE_1 ("ORA_C_COND_IOVSEQUENCE")
 
static const std::string ORA_IOV_TABLE_2 ("ORA_C_COND_IOVSEQU_A0")
 
static const std::string ORA_IOV_TABLE_3 ("ORA_C_COND_IOVSEQU_A1")
 
std::tuple< std::string,
std::string, std::string > 
parseConnectionString (const std::string &connectionString)
 
std::pair< std::string,
std::string > 
parseTag (const std::string &tag)
 
static const std::string POOL_IOV_TABLE_DATA ("IOV_DATA")
 
template<typename T >
std::vector< T >::const_iterator search (const cond::Time_t &val, const std::vector< T > &container)
 
template<typename T , typename P >
void static_assert_is_same_decayed ()
 
void throwException (const std::string &message, const std::string &methodName)
 
bool validateTag (const std::string &refTag, Session &refSession, const std::string &candTag, Session &candSession)
 

Enumeration Type Documentation

Enumerator
UndefinedAuthentication 
CondDbKey 
CoralXMLFile 

Definition at line 27 of file ConnectionPool.h.

Enumerator
NEW 
UPDATE 
REPLACE 

Definition at line 14 of file CondDBTools.h.

#define NEW
Definition: KFUpdator.cc:24
#define UPDATE(type)

Function Documentation

BackendType cond::persistency::checkBackendType ( boost::shared_ptr< coral::ISessionProxy > &  coralSession,
const std::string &  connectionString 
)

Definition at line 60 of file SessionImpl.cc.

References cond::DbTransaction::commit(), cond::COND_DB, cond::DbSession::open(), cond::ORA_DB, run_regression::ret, cond::DbTransaction::start(), cond::DbSession::transaction(), and cond::UNKNOWN_DB.

Referenced by cond::persistency::ConnectionPool::createSession().

61  {
63  cond::DbSession oraSession;
64  oraSession.open( coralSession, connectionString );
65  oraSession.transaction().start( true );
66  std::unique_ptr<IIOVSchema> iovSchemaHandle( new OraIOVSchema( oraSession ) );
67  std::unique_ptr<IGTSchema> gtSchemaHandle( new OraGTSchema( oraSession ) );
68  if( !iovSchemaHandle->exists() && !gtSchemaHandle->exists() ){
69  iovSchemaHandle.reset( new IOVSchema( coralSession->nominalSchema() ) );
70  if( iovSchemaHandle->exists() ){
71  ret = COND_DB;
72  }
73  } else {
74  ret = ORA_DB;
75  }
76  oraSession.transaction().commit();
77  return ret;
78  }
DbTransaction & transaction()
Definition: DbSession.cc:208
void open(const std::string &connectionString, bool readOnly=false)
Definition: DbSession.cc:159
int commit()
commit transaction.
int start(bool readOnly=false)
start transaction
BackendType
Definition: Types.h:23
bool cond::persistency::compareTags ( const std::string &  firstTag,
Session firstSession,
const std::string &  firstFileName,
const std::string &  secondTag,
Session secondSession,
const std::string &  secondFileName 
)

Definition at line 202 of file CondDBTools.cc.

References cond::persistency::Session::connectionString(), gather_cfg::cout, exportTagToFile(), timingPdfMaker::file1, N, NULL, cmsHarvester::path, diffTwoXMLs::r1, diffTwoXMLs::r2, python.multivaluedict::remove(), and throwException().

Referenced by validateTag().

207  {
208  size_t n1 = exportTagToFile( firstTag, firstTag, firstSession, firstFileName );
209  if( ! n1 ){
210  std::cout <<"Can't compare empty tag "<<firstTag<<std::endl;
211  return false;
212  }
213  size_t n2 = exportTagToFile( secondTag, firstTag, secondSession, secondFileName );
214  if( ! n2 ){
215  std::cout <<"Can't compare empty tag "<<secondTag<<std::endl;
216  return false;
217  }
218  if( n1 != n2 ) {
219  std::cout <<" Tag size is different. "<<firstSession.connectionString()<<":"<<firstTag<<": "<<n1<<" "<<
220  secondSession.connectionString()<<":"<<secondTag<<": "<<n2<<std::endl;
221  }
222 
223  FILE* file1 = fopen( firstFileName.c_str(), "r" );
224  if( file1 == NULL ){
225  throwException("Can't open file "+firstFileName, "compareTags" );
226  }
227  FILE* file2 = fopen( secondFileName.c_str(), "r" );
228  if( file2 == NULL ){
229  throwException("Can't open file "+secondFileName, "compareTags" );
230  }
231  int N = 10000;
232  char buf1[N];
233  char buf2[N];
234 
235  bool cmpOk = true;
236  size_t totSize = 0;
237  do {
238  size_t r1 = fread( buf1, 1, N, file1 );
239  size_t r2 = fread( buf2, 1, N, file2 );
240 
241  if( r1 != r2 || memcmp( buf1, buf2, r1)) {
242  cmpOk = false;
243  break;
244  }
245  totSize += r1;
246  } while(!feof(file2) || !feof(file2));
247 
248  std::cout <<" "<<totSize<<" bytes compared."<<std::endl;
249  fclose( file1 );
250  fclose( file2 );
251 
252  if( cmpOk ){
253  boost::filesystem::path fp1( firstFileName );
255  boost::filesystem::path fp2( secondFileName );
257  }
258 
259  return cmpOk;
260  }
#define NULL
Definition: scimark2.h:8
tuple path
else: Piece not in the list, fine.
size_t exportTagToFile(const std::string &tag, const std::string &destTag, Session &session, const std::string fileName)
Definition: CondDBTools.cc:195
#define N
Definition: blowfish.cc:9
tuple cout
Definition: gather_cfg.py:121
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
std::string cond::persistency::convertoToOracleConnection ( const std::string &  input)
inline

Definition at line 66 of file Utils.h.

References dbtoconf::account, match(), fff_monitoring::service, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

66  {
67 
68  //static const boost::regex trivial("oracle://(cms_orcon_adg|cms_orcoff_prep)/([_[:alnum:]]+?)");
69  static const boost::regex short_frontier("frontier://([[:alnum:]]+?)/([_[:alnum:]]+?)");
70  static const boost::regex long_frontier("frontier://((\\([-[:alnum:]]+?=[^\\)]+?\\))+)/([_[:alnum:]]+?)");
71  static const boost::regex long_frontier_serverurl("\\(serverurl=[^\\)]+?/([[:alnum:]]+?)\\)");
72 
73  static const std::map<std::string, std::string> frontierMap = {
74  {"PromptProd", "cms_orcon_adg"},
75  {"FrontierProd", "cms_orcon_adg"},
76  {"FrontierArc", "cms_orcon_adg"},
77  {"FrontierOnProd", "cms_orcon_adg"},
78  {"FrontierPrep", "cms_orcoff_prep"},
79  };
80 
81  boost::smatch matches;
82 
83  static const std::string technology("oracle://");
84  std::string service("");
85  std::string account("");
86 
87  bool match = false;
88  if (boost::regex_match(input, matches, short_frontier)){
89  service = matches[1];
90  account = matches[2];
91  match = true;
92  }
93 
94  if (boost::regex_match(input, matches, long_frontier)) {
95  std::string frontier_config(matches[1]);
96  boost::smatch matches2;
97  if (not boost::regex_search(frontier_config, matches2, long_frontier_serverurl))
98  throwException("No serverurl in matched long frontier","convertoToOracleConnection");
99  service = matches2[1];
100  account = matches[3];
101  match = true;
102  }
103 
104  if( !match ) throwException("Connection string can't be converted.","convertoToOracleConnection");
105 
106  if( service == "FrontierArc" ){
107  size_t len = account.size()-5;
108  account = account.substr(0,len);
109  }
110 
111  auto it = frontierMap.find( service );
112  if( it == frontierMap.end() ) throwException("Connection string can't be converted.","convertoToOracleConnection");
113  service = it->second;
114 
115  return technology+service+"/"+account;
116  }
list account
Definition: dbtoconf.py:80
static std::string const input
Definition: EdmProvDump.cc:44
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
bool cond::persistency::copyIov ( Session session,
const std::string &  sourceTag,
const std::string &  destTag,
cond::Time_t  souceSince,
cond::Time_t  destSince,
bool  log 
)

Definition at line 152 of file CondDBTools.cc.

References cond::persistency::Session::connectionString(), gather_cfg::cout, cond::persistency::Session::createIov(), cond::persistency::Session::editIov(), idDealer::editor, cond::persistency::IOVProxy::end(), cond::persistency::Session::existsIov(), cond::persistency::IOVProxy::find(), cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), cond::persistency::IOVProxy::loadedSize(), AlCaHLTBitMon_ParallelJobs::p, cond::persistency::IOVProxy::payloadObjectType(), cond::persistency::IOVEditor::payloadType(), cond::persistency::Session::readIov(), cond::persistency::IOVEditor::setDescription(), cond::persistency::TransactionScope::start(), cond::persistency::IOVProxy::synchronizationType(), throwException(), cond::persistency::IOVEditor::timeType(), cond::persistency::IOVProxy::timeType(), and cond::persistency::Session::transaction().

157  {
158  persistency::TransactionScope ssc( session.transaction() );
159  ssc.start( false );
160  if( log ) std::cout <<" Loading source iov..."<<std::endl;
161  persistency::IOVProxy p = session.readIov( sourceTag, true );
162  if( p.loadedSize()==0 ) {
163  if( log ) std::cout <<" Tag contains 0 iovs."<<std::endl;
164  return false;
165  } else {
166  if( log ) std::cout <<" Iov size:"<<p.loadedSize()<<" timeType:"<<p.timeType()<<" payloadObjectType=\""<<p.payloadObjectType()<<"\""<<std::endl;
167  }
168 
169  auto iiov = p.find( sourceSince );
170  if( iiov == p.end() ){
171  if( log ) std::cout <<"ERROR: No Iov valid found for target time "<<sourceSince<<std::endl;
172  return false;
173  }
174 
175  persistency::IOVEditor editor;
176  if( session.existsIov( destTag ) ){
177  editor = session.editIov( destTag );
178  if( editor.timeType() != p.timeType() )
179  throwException( "TimeType of the destination tag does not match with the source tag timeType.", "importIovs");
180  if( editor.payloadType() != p.payloadObjectType() )
181  throwException( "PayloadType of the destination tag does not match with the source tag payloadType.", "importIovs");
182  } else {
183  editor = session.createIov( p.payloadObjectType(), destTag, p.timeType(), p.synchronizationType() );
184  editor.setDescription( "Copied tag "+sourceTag+" from "+session.connectionString() );
185  }
186 
187  editor.insert( destSince, (*iiov).payloadId );
188 
189  if( log ) std::cout <<" Flushing changes..."<<std::endl;
190  editor.flush();
191  ssc.commit();
192  return true;
193  }
static std::vector< std::string > checklist log
tuple editor
Definition: idDealer.py:73
tuple cout
Definition: gather_cfg.py:121
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
size_t cond::persistency::copyTag ( const std::string &  sourceTag,
Session sourceSession,
const std::string &  destTag,
Session destSession,
UpdatePolicy  policy,
bool  log,
bool  forValidation 
)

Definition at line 11 of file CondDBTools.cc.

References cond::persistency::Session::clearIov(), cond::persistency::Session::connectionString(), gather_cfg::cout, cond::persistency::Session::createDatabase(), cond::persistency::Session::createIov(), cond::persistency::Session::editIov(), idDealer::editor, cond::persistency::Session::existsDatabase(), cond::persistency::Session::existsIov(), fetch(), cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), o2o::iov, cond::persistency::IOVProxy::loadedSize(), NEW, AlCaHLTBitMon_ParallelJobs::p, cond::persistency::IOVProxy::payloadObjectType(), cond::persistency::Session::readIov(), REPLACE, cond::persistency::Transaction::rollback(), cond::persistency::IOVEditor::setDescription(), cond::persistency::IOVEditor::setValidationMode(), EcalCondDB::sinces, cond::persistency::TransactionScope::start(), cond::persistency::IOVProxy::synchronizationType(), throwException(), cond::persistency::IOVProxy::timeType(), and cond::persistency::Session::transaction().

Referenced by exportTagToFile().

17  {
18  persistency::TransactionScope ssc( sourceSession.transaction() );
19  ssc.start();
20  if( log && !forValidation ) std::cout <<" Loading source iov..."<<std::endl;
21  persistency::IOVProxy p = sourceSession.readIov( sourceTag, true );
22  if( p.loadedSize()==0 ) {
23  if( log ) std::cout <<" Tag contains 0 iovs."<<std::endl;
24  return 0;
25  }
26  if( log && !forValidation ) std::cout <<" Copying tag. Iov size:"<<p.loadedSize()<<" timeType:"<<p.timeType()<<" payloadObjectType=\""<<p.payloadObjectType()<<"\""<<std::endl;
27 
28  persistency::IOVEditor editor;
29  persistency::TransactionScope dsc( destSession.transaction() );
30  dsc.start( false );
31  bool exists = false;
32  if( !destSession.existsDatabase() ) {
33  destSession.createDatabase();
34  } else {
35  exists = destSession.existsIov( destTag );
36  }
37  if( exists ){
38  if( policy == REPLACE ){
39  destSession.clearIov( destTag );
40  } else if( policy == NEW ){
41  destSession.transaction().rollback();
42  throwException(" Tag \""+destTag+"\" already exists.","copyTag");
43  }
44  editor = destSession.editIov( destTag );
45  } else {
46  editor = destSession.createIov( p.payloadObjectType(), destTag, p.timeType(), p.synchronizationType() );
47  }
48  if( forValidation ) {
49  editor.setValidationMode();
50  editor.setDescription("Validation");
51  } else {
52  editor.setDescription("Tag "+sourceTag+" migrated from "+sourceSession.connectionString());
53  }
54  size_t niovs = 0;
55  std::set<cond::Hash> pids;
56  std::set<cond::Time_t> sinces;
57  for( auto iov : p ){
58  // skip duplicated sinces
59  if( sinces.find( iov.since ) != sinces.end() ){
60  if( log && !forValidation ) std::cout <<" WARNING. Skipping duplicated since="<<iov.since<<std::endl;
61  continue;
62  }
63  sinces.insert( iov.since );
64  // make sure that we import the payload _IN_USE_
65  auto usedIov = p.getInterval( iov.since );
66  std::pair<std::string,boost::shared_ptr<void> > readBackPayload = fetch( usedIov.payloadId, sourceSession );
67  cond::Hash ph = import( readBackPayload.first, readBackPayload.second.get(), destSession );
68  editor.insert( iov.since, ph );
69  pids.insert( ph );
70  niovs++;
71  if( log && !forValidation && niovs && (niovs%1000==0) ) std::cout <<" Total of iov inserted: "<<niovs<<" payloads: "<<pids.size()<<std::endl;
72  }
73  if( log && !forValidation) std::cout <<" Total of iov inserted: "<<niovs<<" payloads: "<<pids.size()<<std::endl;
74  if( log && !forValidation) std::cout <<" Flushing changes..."<<std::endl;
75  editor.flush();
76  dsc.commit();
77  ssc.commit();
78  return niovs;
79  }
static std::vector< std::string > checklist log
list sinces
Definition: EcalCondDB.py:80
tuple iov
Definition: o2o.py:307
#define NEW
Definition: KFUpdator.cc:24
std::string Hash
Definition: Types.h:43
std::pair< std::string, boost::shared_ptr< void > > fetch(const cond::Hash &payloadId, Session &session)
tuple editor
Definition: idDealer.py:73
tuple cout
Definition: gather_cfg.py:121
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
unsigned int cond::persistency::countslash ( const std::string &  input)

Definition at line 15 of file DbConnectionString.cc.

References prof2calltree::count.

Referenced by getConnectionParams().

15  {
16  unsigned int count=0;
17  std::string::size_type slashpos( 0 );
18  while( slashpos!=std::string::npos){
19  slashpos = input.find('/', slashpos );
20  if ( slashpos != std::string::npos ){
21  ++count;
22  // start next search after this word
23  slashpos += 1;
24  }
25  }
26  return count;
27  }
uint16_t size_type
static std::string const input
Definition: EdmProvDump.cc:44
size_t cond::persistency::exportTagToFile ( const std::string &  tag,
const std::string &  destTag,
Session session,
const std::string  fileName 
)

Definition at line 195 of file CondDBTools.cc.

References copyTag(), cond::persistency::ConnectionPool::createSession(), NEW, and run_regression::ret.

Referenced by compareTags().

195  {
196  ConnectionPool localPool;
197  Session writeSession = localPool.createSession( "sqlite:"+fileName, true );
198  size_t ret = copyTag( tag, session, destTag, writeSession, NEW, false,true );
199  return ret;
200  }
size_t copyTag(const std::string &sourceTag, Session &sourceSession, const std::string &destTag, Session &destSession, UpdatePolicy policy, bool log, bool forValidation)
Definition: CondDBTools.cc:11
#define NEW
Definition: KFUpdator.cc:24
template<typename T >
void cond::persistency::f_add_column_description ( coral::TableDescription &  table,
const std::string &  columnName,
size_t  size = 0,
bool  notNull = true 
)

Definition at line 205 of file DbCore.h.

References findQualityFiles::size.

205  {
206  table.insertColumn( columnName, AttributeTypeName<T>()(), size );
207  if( notNull ) table.setNotNullConstraint( columnName );
208  }
#define table(NAME)
Definition: DbCore.h:49
tuple size
Write out results.
std::pair< std::string, boost::shared_ptr< void > > cond::persistency::fetch ( const cond::Hash payloadId,
Session session 
)

Definition at line 315 of file CondDBImport.cc.

References data, fetchOne(), cond::persistency::Session::fetchPayloadData(), newFWLiteAna::found, cond::persistency::Session::isOraSession(), AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by copyTag(), LMFDat::fetch(), and importIovs().

315  {
316  boost::shared_ptr<void> payloadPtr;
318  cond::Binary streamerInfo;
319  std::string payloadTypeName;
320  bool found = session.fetchPayloadData( payloadId, payloadTypeName, data, streamerInfo );
321  if( !found ) throwException( "Payload with id "+boost::lexical_cast<std::string>(payloadId)+" has not been found in the database.","fetchAndCompare" );
322  //std::cout <<"--> payload type "<<payloadTypeName<<" has blob size "<<data.size()<<std::endl;
323  bool isOra = session.isOraSession();
324  return fetchOne(payloadTypeName, data, streamerInfo, payloadPtr, isOra);
325  }
std::pair< std::string, boost::shared_ptr< void > > fetchOne(const std::string &payloadTypeName, const cond::Binary &data, const cond::Binary &streamerInfo, boost::shared_ptr< void > payloadPtr, bool is Ora)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
std::pair<std::string, boost::shared_ptr<void> > cond::persistency::fetchOne ( const std::string &  payloadTypeName,
const cond::Binary data,
const cond::Binary streamerInfo,
boost::shared_ptr< void >  payloadPtr,
bool is  Ora 
)

Referenced by fetch().

std::pair<std::string, boost::shared_ptr<void> > cond::persistency::fetchOne ( const std::string &  payloadTypeName,
const cond::Binary data,
const cond::Binary streamerInfo,
boost::shared_ptr< void >  payloadPtr,
bool  isOra 
)

Definition at line 326 of file CondDBImport.cc.

References data, FETCH_PAYLOAD_CASE, match(), AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

326  {
327 
328  bool match = false;
330  FETCH_PAYLOAD_CASE( std::vector<unsigned long long> )
491  FETCH_PAYLOAD_CASE( lumi::LumiSectionData )
494  FETCH_PAYLOAD_CASE( PhysicsTools::Calibration::MVAComputerContainer )
498  //FETCH_PAYLOAD_CASE( PerformancePayload )
541  FETCH_PAYLOAD_CASE( cond::BaseKeyed )
550 
551  //
552  if( payloadTypeName == "PhysicsTools::Calibration::Histogram3D<double,double,double,double>" ){
553  auto payload = deserialize<PhysicsTools::Calibration::Histogram3D<double,double,double,double> >(payloadTypeName, data, streamerInfo, isOra );
554  payloadPtr = payload;
555  match = true;
556  }
557  if( payloadTypeName == "PhysicsTools::Calibration::Histogram2D<double,double,double>" ){
558  auto payload = deserialize<PhysicsTools::Calibration::Histogram2D<double,double,double> >(payloadTypeName, data, streamerInfo, isOra );
559  payloadPtr = payload;
560  match = true;
561  }
562  if( payloadTypeName == "std::vector<unsignedlonglong,std::allocator<unsignedlonglong>>" ){
563  auto payload = deserialize<std::vector<unsigned long long> >( payloadTypeName, data, streamerInfo, isOra );
564  payloadPtr = payload;
565  match = true;
566  }
567 
568  if( ! match ) throwException( "Payload type \""+payloadTypeName+"\" is unknown.","fetch" );
569  return std::make_pair( payloadTypeName, payloadPtr );
570  }
Definition: ESGain.h:7
tuple lumi
Definition: fjr2json.py:35
#define FETCH_PAYLOAD_CASE(TYPENAME)
Definition: CondDBImport.cc:19
Definition: DTT0.h:53
Histogram3D< double > HistogramD3D
Definition: Histogram3D.h:187
QGLikelihoodObject containing valid range and entries with category, histogram and mean...
Category structure: ranges associated with QGLikelihood histograms.
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
QGLikelihoodSystematicsObject containing the parameters for the systematic smearing.
if(conf.exists("allCellsPositionCalc"))
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
std::pair< std::string, std::string > cond::persistency::getConnectionParams ( const std::string &  connectionString,
const std::string &  transactionId 
)

Definition at line 29 of file DbConnectionString.cc.

References countslash(), getConnectionProtocol(), cond::FipProtocolParser::getRealConnect(), edm::Service< T >::isAvailable(), prof2calltree::l, edm::SiteLocalConfig::lookupCalibConnect(), geometryXMLtoCSV::parser, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by cond::persistency::ConnectionPool::createSession().

30  {
31  if( connectionString.empty() ) throwException( "The connection string is empty.","getConnectionParams");
32  std::string protocol = getConnectionProtocol( connectionString );
33  std::string finalConn = connectionString;
34  std::string refreshConn("");
35  if( protocol == "frontier" ){
36  std::string protocol("frontier://");
37  std::string::size_type fpos=connectionString.find(protocol);
38  unsigned int nslash=countslash(connectionString.substr(protocol.size(),connectionString.size()-fpos));
39  if(nslash==1){
40  edm::Service<edm::SiteLocalConfig> localconfservice;
41  if( !localconfservice.isAvailable() ){
42  throwException("edm::SiteLocalConfigService is not available","getConnectionParams");
43  }
44  finalConn=localconfservice->lookupCalibConnect(connectionString);
45  }
46  if (!transactionId.empty()) {
47  size_t l = finalConn.rfind('/');
48  finalConn.insert(l,"(freshkey="+transactionId+')');
49  }
50 
51  std::string::size_type startRefresh = finalConn.find("://");
52  if (startRefresh != std::string::npos){
53  startRefresh += 3;
54  }
55  std::string::size_type endRefresh=finalConn.rfind("/", std::string::npos);
56  if (endRefresh == std::string::npos){
57  refreshConn = finalConn;
58  } else{
59  refreshConn = finalConn.substr(startRefresh, endRefresh-startRefresh);
60  if(refreshConn.substr(0,1) != "("){
61  //if the connect string is not a complicated parenthesized string,
62  // an http:// needs to be at the beginning of it
63  refreshConn.insert(0, "http://");
64  }
65  }
66  } else if ( protocol == "sqlite_fip" ){
68  finalConn = parser.getRealConnect( connectionString );
69  }
70  return std::make_pair( finalConn, refreshConn );
71  }
std::string getConnectionProtocol(const std::string &connectionString)
Definition: Utils.h:35
std::string getRealConnect(const std::string &fipConnect) const
virtual std::string const lookupCalibConnect(std::string const &input) const =0
uint16_t size_type
bool isAvailable() const
Definition: Service.h:46
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
unsigned int countslash(const std::string &input)
std::string cond::persistency::getConnectionProtocol ( const std::string &  connectionString)
inline

Definition at line 35 of file Utils.h.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by getConnectionParams(), and parseConnectionString().

35  {
36  size_t techEnd = connectionString.find( ':' );
37  if( techEnd == std::string::npos ) throwException( "Could not resolve the connection protocol on "+connectionString+".",
38  "getConnectionProtocol" );
39  std::string technology = connectionString.substr(0,techEnd);
40  return technology;
41  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
cond::Hash cond::persistency::import ( const std::string &  inputTypeName,
const void *  inputPtr,
Session destination 
)

if( inputTypeName == "PhysicsTools::Calibration::MVAComputerContainer" ){ \ std::cout <<"@@@@@ MVAComputer!"<<std::endl;\ match = true;\ const PhysicsTools::Calibration::MVAComputerContainer& obj = static_cast<const PhysicsTools::Calibration::MVAComputerContainer>( inputPtr ); \ PhysicsTools::Calibration::MVAComputerContainer tmp; \ for( auto entry : obj.entries ) { \ std::cout <<"#Adding new entry label="<<entry.first<<std::endl; \ PhysicsTools::Calibration::MVAComputer& c = tmp.add( entry.first ); \ c.inputSet = entry.second.inputSet; \ c.output = entry.second.output; \ auto ps = entry.second.getProcessors(); \ for( size_t i=0;i<ps.size();i++ ){ \ std::cout <<"PRocess type="<<demangledName( typeid(*ps[i] ) )<<std::endl; \ c.addProcessor( ps[i] ); \ } \ } \ std::pair<std::string,bool> st = destination.storePayload( tmp, boost::posix_time::microsec_clock::universal_time() ); \ payloadId = st.first; \ newInsert = st.second; \ }

if( inputTypeName == "PhysicsTools::Calibration::MVAComputerContainer" ){ \ std::cout <<"@@@@@ MVAComputer!"<<std::endl;\ match = true;\ const PhysicsTools::Calibration::MVAComputerContainer& obj = static_cast<const PhysicsTools::Calibration::MVAComputerContainer>( inputPtr ); \ PhysicsTools::Calibration::MVAComputerContainer tmp; \ for( auto entry : obj.entries ) { \ std::cout <<"#Adding new entry label="<<entry.first<<std::endl; \ PhysicsTools::Calibration::MVAComputer& c = tmp.add( entry.first ); \ c.inputSet = entry.second.inputSet; \ c.output = entry.second.output; \ auto ps = entry.second.getProcessors(); \ for( size_t i=0;i<ps.size();i++ ){ \ std::cout <<"PRocess type="<<demangledName( typeid(*ps[i] ) )<<std::endl; \ c.addProcessor( ps[i] ); \ } \ } \ std::pair<std::string,bool> st = destination.storePayload( tmp, boost::posix_time::microsec_clock::universal_time() ); \ payloadId = st.first; \ newInsert = st.second; \ }

Definition at line 45 of file CondDBImport.cc.

References roll_playback::destination, IMPORT_PAYLOAD_CASE, match(), getGTfromDQMFile::obj, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

45  {
46  cond::Hash payloadId("");
47  bool newInsert = false;
48  bool match = false;
49  if( inputPtr ){
51  IMPORT_PAYLOAD_CASE( std::vector<unsigned long long> )
212  IMPORT_PAYLOAD_CASE( lumi::LumiSectionData )
238  IMPORT_PAYLOAD_CASE( PhysicsTools::Calibration::MVAComputerContainer )
242  //IMPORT_PAYLOAD_CASE( PerformancePayload )
285  IMPORT_PAYLOAD_CASE( cond::BaseKeyed )
294  if( inputTypeName == "PhysicsTools::Calibration::Histogram3D<double,double,double,double>" ){
295  match = true;
297  payloadId = destination.storePayload( obj, boost::posix_time::microsec_clock::universal_time() );
298  }
299  if( inputTypeName == "PhysicsTools::Calibration::Histogram2D<double,double,double>" ){
300  match = true;
302  payloadId = destination.storePayload( obj, boost::posix_time::microsec_clock::universal_time() );
303  }
304  if( inputTypeName == "std::vector<unsignedlonglong,std::allocator<unsignedlonglong>>" ){
305  match = true;
306  const std::vector<unsigned long long>& obj = *static_cast<const std::vector<unsigned long long>*>( inputPtr );
307  payloadId = destination.storePayload( obj, boost::posix_time::microsec_clock::universal_time() );
308  }
309 
310  if( ! match ) throwException( "Payload type \""+inputTypeName+"\" is unknown.","import" );
311  }
312  return payloadId;
313  }
Definition: ESGain.h:7
tuple lumi
Definition: fjr2json.py:35
Definition: DTT0.h:53
Histogram3D< double > HistogramD3D
Definition: Histogram3D.h:187
QGLikelihoodObject containing valid range and entries with category, histogram and mean...
#define IMPORT_PAYLOAD_CASE(TYPENAME)
Definition: CondDBImport.cc:4
std::string Hash
Definition: Types.h:43
Category structure: ranges associated with QGLikelihood histograms.
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
QGLikelihoodSystematicsObject containing the parameters for the systematic smearing.
if(conf.exists("allCellsPositionCalc"))
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
size_t cond::persistency::importIovs ( const std::string &  sourceTag,
Session sourceSession,
const std::string &  destTag,
Session destSession,
cond::Time_t  begin,
cond::Time_t  end,
bool  log 
)

Definition at line 81 of file CondDBTools.cc.

References begin, cond::persistency::Session::connectionString(), gather_cfg::cout, cond::persistency::Session::createDatabase(), cond::persistency::Session::createIov(), cond::persistency::Session::editIov(), idDealer::editor, end, cond::persistency::IOVProxy::end(), cond::persistency::Session::existsDatabase(), cond::persistency::Session::existsIov(), fetch(), cond::persistency::IOVProxy::find(), cond::persistency::IOVEditor::flush(), cond::persistency::IOVProxy::getInterval(), cond::persistency::IOVEditor::insert(), cond::persistency::IOVProxy::loadedSize(), AlCaHLTBitMon_ParallelJobs::p, cond::persistency::IOVProxy::payloadObjectType(), cond::persistency::IOVEditor::payloadType(), cond::persistency::Session::readIov(), cond::persistency::IOVEditor::setDescription(), EcalCondDB::sinces, cond::persistency::TransactionScope::start(), cond::persistency::IOVProxy::synchronizationType(), throwException(), cond::persistency::IOVEditor::timeType(), cond::persistency::IOVProxy::timeType(), and cond::persistency::Session::transaction().

87  {
88  persistency::TransactionScope ssc( sourceSession.transaction() );
89  ssc.start();
90  if( log ) std::cout <<" Loading source iov..."<<std::endl;
91  persistency::IOVProxy p = sourceSession.readIov( sourceTag, true );
92  if( p.loadedSize()==0 ) {
93  if( log ) std::cout <<" Tag contains 0 iovs."<<std::endl;
94  return 0;
95  } else {
96  if( log ) std::cout <<" Iov size:"<<p.loadedSize()<<" timeType:"<<p.timeType()<<" payloadObjectType=\""<<p.payloadObjectType()<<"\""<<std::endl;
97  }
98  persistency::IOVEditor editor;
99  persistency::TransactionScope dsc( destSession.transaction() );
100  dsc.start( false );
101  bool exists = false;
102  if( !destSession.existsDatabase() ) {
103  destSession.createDatabase();
104  } else {
105  exists = destSession.existsIov( destTag );
106  }
107  if( exists ){
108  editor = destSession.editIov( destTag );
109  if( editor.timeType() != p.timeType() )
110  throwException( "TimeType of the destination tag does not match with the source tag timeType.", "importIovs");
111  if( editor.payloadType() != p.payloadObjectType() )
112  throwException( "PayloadType of the destination tag does not match with the source tag payloadType.", "importIovs");
113  } else {
114  editor = destSession.createIov( p.payloadObjectType(), destTag, p.timeType(), p.synchronizationType() );
115  editor.setDescription( "Copied tag "+sourceTag+" from "+sourceSession.connectionString() );
116  }
117  size_t niovs = 0;
118  std::set<cond::Hash> pids;
119  std::set<cond::Time_t> sinces;
120  auto iiov = p.find( begin );
121  cond::Time_t newSince = begin;
122  while( iiov != p.end() ){
123  // skip duplicated sinces
124  if( sinces.find( newSince ) != sinces.end() ){
125  if( log ) std::cout <<" WARNING. Skipping duplicated since="<<newSince<<std::endl;
126  continue;
127  }
128  sinces.insert( newSince );
129  // make sure that we import the payload _IN_USE_
130  auto usedIov = p.getInterval( newSince );
131  std::pair<std::string,boost::shared_ptr<void> > readBackPayload = fetch( usedIov.payloadId, sourceSession );
132  cond::Hash ph = import( readBackPayload.first, readBackPayload.second.get(), destSession );
133  editor.insert( newSince, ph );
134  pids.insert( ph );
135  niovs++;
136  if( log && niovs && (niovs%1000==0) ) std::cout <<" Total of iov inserted: "<<niovs<<" payloads: "<<pids.size()<<std::endl;
137  iiov++;
138  if( iiov == p.end() || (*iiov).since > end ){
139  break;
140  } else {
141  newSince = (*iiov).since;
142  }
143  }
144  if( log ) std::cout <<" Total of iov inserted: "<<niovs<<" payloads: "<<pids.size()<<std::endl;
145  if( log ) std::cout <<" Flushing changes..."<<std::endl;
146  editor.flush();
147  dsc.commit();
148  ssc.commit();
149  return niovs;
150  }
static std::vector< std::string > checklist log
list sinces
Definition: EcalCondDB.py:80
unsigned long long Time_t
Definition: Time.h:16
std::string Hash
Definition: Types.h:43
#define end
Definition: vmac.h:37
std::pair< std::string, boost::shared_ptr< void > > fetch(const cond::Hash &payloadId, Session &session)
tuple editor
Definition: idDealer.py:73
#define begin
Definition: vmac.h:30
tuple cout
Definition: gather_cfg.py:121
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
template<typename T , typename Arg1 >
bool cond::persistency::is_same_any ( )

Definition at line 210 of file DbCore.h.

References relativeConstraints::value.

210  {
212  };
template<typename T , typename Arg1 , typename Arg2 , typename... Args>
bool cond::persistency::is_same_any ( )

Definition at line 214 of file DbCore.h.

214  {
215  return is_same_any<T, Arg1>() || is_same_any<T, Arg2, Args...>();
216  };
cond::Hash cond::persistency::makeHash ( const std::string &  objectType,
const cond::Binary data 
)

Definition at line 10 of file IOVSchema.cc.

References cond::Binary::data(), cond::hash, i, cond::Binary::size(), throwException(), and tmp.

Referenced by cond::persistency::PAYLOAD::Table::insertIfNew().

10  {
11  SHA_CTX ctx;
12  if( !SHA1_Init( &ctx ) ){
13  throwException( "SHA1 initialization error.","IOVSchema::makeHash");
14  }
15  if( !SHA1_Update( &ctx, objectType.c_str(), objectType.size() ) ){
16  throwException( "SHA1 processing error (1).","IOVSchema::makeHash");
17  }
18  if( !SHA1_Update( &ctx, data.data(), data.size() ) ){
19  throwException( "SHA1 processing error (2).","IOVSchema::makeHash");
20  }
21  unsigned char hash[SHA_DIGEST_LENGTH];
22  if( !SHA1_Final(hash, &ctx) ){
23  throwException( "SHA1 finalization error.","IOVSchema::makeHash");
24  }
25 
26  char tmp[SHA_DIGEST_LENGTH*2+1];
27  // re-write bytes in hex
28  for (unsigned int i = 0; i < 20; i++) {
29  ::sprintf(&tmp[i * 2], "%02x", hash[i]);
30  }
31  tmp[20*2] = 0;
32  return tmp;
33  }
int i
Definition: DBlmapReader.cc:9
size_t size() const
Definition: Binary.cc:57
const void * data() const
Definition: Binary.cc:48
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
static const std::string cond::persistency::ORA_IOV_TABLE_1 ( "ORA_C_COND_IOVSEQUENCE"  )
static
static const std::string cond::persistency::ORA_IOV_TABLE_2 ( "ORA_C_COND_IOVSEQU_A0"  )
static
static const std::string cond::persistency::ORA_IOV_TABLE_3 ( "ORA_C_COND_IOVSEQU_A1"  )
static
std::tuple<std::string,std::string,std::string> cond::persistency::parseConnectionString ( const std::string &  connectionString)
inline

Definition at line 43 of file Utils.h.

References getConnectionProtocol(), serviceName, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by validateTag().

43  {
44  std::string protocol = getConnectionProtocol( connectionString );
46  std::string databaseName("");
47  if( protocol == "sqlite" || protocol == "sqlite_file" || protocol == "sqlite_fip" ){
48  databaseName = connectionString.substr( protocol.size()+1 );
49  } else if ( protocol == "oracle" || protocol == "frontier" ){
50  size_t ptr = protocol.size()+1;
51  if( connectionString.substr( ptr,2 )!="//" ) throwException( "Connection string "+connectionString+
52  " is invalid format for technology \""+
53  protocol+"\".","parseConnectionString" );
54  ptr += 2;
55  size_t serviceEnd = connectionString.find( '/', ptr );
56  if( serviceEnd == std::string::npos ) throwException( "Connection string "+connectionString+" is invalid.",
57  "parseConnectionString" );
58  serviceName = connectionString.substr( ptr, serviceEnd-ptr );
59  ptr = serviceEnd+1;
60  databaseName = connectionString.substr( ptr );
61  } else throwException( "Technology "+protocol+" is not known.","parseConnectionString" );
62 
63  return std::make_tuple( protocol, serviceName, databaseName );
64  }
std::string getConnectionProtocol(const std::string &connectionString)
Definition: Utils.h:35
static const std::string serviceName
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
std::pair< std::string, std::string > cond::persistency::parseTag ( const std::string &  tag)

Definition at line 8 of file GTProxy.cc.

References dbtoconf::pfn, AlCaHLTBitMon_QueryRunRegistry::string, and edmStreamStallGrapher::t.

Referenced by CondDBESSource::CondDBESSource(), and CondDBESSource::setIntervalFor().

8  {
9  std::string pfn("");
10  std::string t(tag);
11  size_t pos = tag.rfind('@');
12  if( pos != std::string::npos && tag.size() >= pos+3 ){
13  if( tag[pos+1]=='[' && tag[tag.size()-1]==']' ) {
14  pfn = tag.substr( pos+2,tag.size()-pos-3 );
15  t = tag.substr( 0, pos );
16  }
17  }
18  return std::make_pair( t, pfn );
19  }
list pfn
Definition: dbtoconf.py:76
static const std::string cond::persistency::POOL_IOV_TABLE_DATA ( "IOV_DATA"  )
static
template<typename T >
std::vector<T>::const_iterator cond::persistency::search ( const cond::Time_t val,
const std::vector< T > &  container 
)

Definition at line 229 of file IOVProxy.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by dqm_interfaces.DirID::__eq__(), ValidationMatrix::add_to_blacklist(), ValidationMatrix::do_comparisons_threaded(), AlignmentMonitorTemplate::event(), cond::persistency::IOVProxy::find(), FileNamesHelper::getJobID_fromFileName(), ValidationMatrix::guess_blacklists(), ValidationMatrix::guess_params(), and duplicateReflexLibrarySearch::searchClassDefXml().

229  {
230  if( !container.size() ) return container.end();
231  auto p = std::upper_bound( container.begin(), container.end(), val, IOVComp() );
232  return (p!= container.begin()) ? p-1 : container.end();
233  }
template<typename T , typename P >
void cond::persistency::static_assert_is_same_decayed ( )
inline

Definition at line 82 of file DbCore.h.

References relativeConstraints::value.

82  {
83  static_assert( std::is_same<typename std::decay<T>::type, typename std::decay<P>::type>::value, "Parameter types don't match with the RowBuffer types" );
84  };
type
Definition: HCALResponse.h:21
void cond::persistency::throwException ( const std::string &  message,
const std::string &  methodName 
)

Definition at line 11 of file Exception.cc.

References edm::hlt::Exception.

Referenced by L1CondDBIOVWriter::analyze(), L1CondDBPayloadWriter::analyze(), cond::persistency::GTEditor::checkTransaction(), cond::persistency::IOVEditor::checkTransaction(), cond::persistency::GTProxy::checkTransaction(), cond::persistency::IOVProxy::checkTransaction(), compareTags(), convertoToOracleConnection(), copyIov(), copyTag(), cond::persistency::Session::coralSession(), cond::persistency::TAG::Table::create(), cond::persistency::PAYLOAD::Table::create(), cond::persistency::IOV::Table::create(), cond::persistency::TAG_MIGRATION::Table::create(), cond::persistency::Session::createGlobalTag(), cond::persistency::Session::createIov(), cond::persistency::Session::createIovForPayload(), cond::persistency::Query< Types...>::currentRow(), cond::persistency::OraIOVTable::erase(), fetch(), fetchOne(), cond::persistency::Session::fetchPayload(), cond::persistency::GTEditor::flush(), cond::persistency::IOVEditor::flush(), cond::persistency::KeyList::get(), getConnectionParams(), getConnectionProtocol(), cond::persistency::IOVProxy::getInterval(), import(), importIovs(), cond::persistency::OraIOVTable::insertMany(), cond::persistency::OraIOVTable::insertOne(), cond::persistency::SessionImpl::isOra(), cond::persistency::GTEditor::load(), cond::persistency::IOVProxy::load(), cond::persistency::GTProxy::load(), cond::persistency::PayloadProxy< std::vector< cond::Time_t > >::loadPayload(), makeHash(), cond::persistency::Query< Types...>::next(), cond::persistency::SessionImpl::openGTDb(), cond::persistency::SessionImpl::openIovDb(), cond::persistency::PayloadProxy< std::vector< cond::Time_t > >::operator()(), cond::persistency::GetFromRow< std::array< char, n > >::operator()(), parseConnectionString(), cond::CredentialStore::startSession(), cond::persistency::SessionImpl::startTransaction(), cond::persistency::OraIOVSchema::tagMigrationTable(), cond::persistency::OraTagTable::update(), cond::CredentialStore::updateConnection(), and cond::persistency::Session::updateMigrationLog().

12  {
13  throw Exception( message, methodName );
14  }
bool cond::persistency::validateTag ( const std::string &  refTag,
Session refSession,
const std::string &  candTag,
Session candSession 
)

Definition at line 262 of file CondDBTools.cc.

References compareTags(), cond::persistency::Session::connectionString(), gather_cfg::cout, dtTTrigAnalyzer_cfg::dbLabel, parseConnectionString(), cmsHarvester::path, python.multivaluedict::remove(), run_regression::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

265  {
266  std::cout <<" Validating..."<<std::endl;
267  std::tuple<std::string,std::string,std::string> connPars = persistency::parseConnectionString( refSession.connectionString() );
268  std::string dbLabel = std::get<2>( connPars );
269  std::string tagLabel = dbLabel+"_"+refTag;
270  std::string refFile = tagLabel+"_ref.db";
271  std::string candFile = tagLabel+"_cand.db";
272  bool ret = compareTags( refTag, refSession, refFile, candTag, candSession, candFile );
273  if( ret ) {
274  boost::filesystem::path refF( refFile );
275  if( boost::filesystem::exists(refF) ) boost::filesystem::remove( refF );
276  boost::filesystem::path candF( candFile );
277  if( boost::filesystem::exists(candF) ) boost::filesystem::remove( candF );
278  }
279  return ret;
280  }
std::tuple< std::string, std::string, std::string > parseConnectionString(const std::string &connectionString)
Definition: Utils.h:43
tuple path
else: Piece not in the list, fine.
tuple cout
Definition: gather_cfg.py:121
bool compareTags(const std::string &firstTag, Session &firstSession, const std::string &firstFileName, const std::string &secondTag, Session &secondSession, const std::string &secondFileName)
Definition: CondDBTools.cc:202