CMS 3D CMS Logo

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

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  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 }
 

Functions

BackendType checkBackendType (boost::shared_ptr< coral::ISessionProxy > &coralSession, const std::string &connectionString)
 
unsigned int countslash (const std::string &input)
 
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,
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)
 
template<typename T , typename Arg1 >
constexpr bool is_same_any ()
 
template<typename T , typename Arg1 , typename Arg2 , typename... Args>
constexpr 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 ()
 
 table (TAG)
 
 table (GLOBAL_TAG)
 
 table (GLOBAL_TAG_MAP)
 
 table (PAYLOAD)
 
 table (IOV)
 
 table (TAG_MIGRATION)
 
void throwException (const std::string &message, const std::string &methodName)
 

Enumeration Type Documentation

Enumerator
UndefinedAuthentication 
CondDbKey 
CoralXMLFile 

Definition at line 27 of file ConnectionPool.h.

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
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
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 298 of file CondDBImport.cc.

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

Referenced by LMFDat::fetch().

298  {
299  boost::shared_ptr<void> payloadPtr;
301  std::string payloadTypeName;
302  bool found = session.fetchPayloadData( payloadId, payloadTypeName, data );
303  if( !found ) throwException( "Payload with id "+boost::lexical_cast<std::string>(payloadId)+" has not been found in the database.","fetchAndCompare" );
304  //std::cout <<"--> payload type "<<payloadTypeName<<" has blob size "<<data.size()<<std::endl;
305  bool match = false;
307  FETCH_PAYLOAD_CASE( std::vector<unsigned long long> )
466  FETCH_PAYLOAD_CASE( lumi::LumiSectionData )
469  FETCH_PAYLOAD_CASE( PhysicsTools::Calibration::MVAComputerContainer )
473  //FETCH_PAYLOAD_CASE( PerformancePayload )
513  FETCH_PAYLOAD_CASE( cond::BaseKeyed )
522 
523  //
524  if( payloadTypeName == "PhysicsTools::Calibration::Histogram3D<double,double,double,double>" ){
525  auto payload = deserialize<PhysicsTools::Calibration::Histogram3D<double,double,double,double> >(payloadTypeName, data );
526  payloadPtr = payload;
527  match = true;
528  }
529  if( payloadTypeName == "PhysicsTools::Calibration::Histogram2D<double,double,double>" ){
530  auto payload = deserialize<PhysicsTools::Calibration::Histogram2D<double,double,double> >(payloadTypeName, data );
531  payloadPtr = payload;
532  match = true;
533  }
534 
535 
536  if( ! match ) throwException( "Payload type \""+payloadTypeName+"\" is unknown.","fetch" );
537  return std::make_pair( payloadTypeName, payloadPtr );
538  }
Definition: ESGain.h:5
tuple lumi
Definition: fjr2json.py:35
#define FETCH_PAYLOAD_CASE(TYPENAME)
Definition: CondDBImport.cc:19
Definition: DTT0.h:52
Histogram3D< double > HistogramD3D
Definition: Histogram3D.h:182
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
if(dp >Float(M_PI)) dp-
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
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(), ConfigFiles::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:33
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 33 of file Utils.h.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by getConnectionParams(), and parseConnectionString().

33  {
34  size_t techEnd = connectionString.find( ':' );
35  if( techEnd == std::string::npos ) throwException( "Could not resolve the connection protocol on "+connectionString+".",
36  "getConnectionProtocol" );
37  std::string technology = connectionString.substr(0,techEnd);
38  return technology;
39  }
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 37 of file CondDBImport.cc.

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

37  {
38  cond::Hash payloadId("");
39  bool newInsert = false;
40  bool match = false;
41  if( inputPtr ){
43  IMPORT_PAYLOAD_CASE( std::vector<unsigned long long> )
202  IMPORT_PAYLOAD_CASE( lumi::LumiSectionData )
228  IMPORT_PAYLOAD_CASE( PhysicsTools::Calibration::MVAComputerContainer )
232  //IMPORT_PAYLOAD_CASE( PerformancePayload )
272  IMPORT_PAYLOAD_CASE( cond::BaseKeyed )
281  if( inputTypeName == "PhysicsTools::Calibration::Histogram3D<double,double,double,double>" ){
282  match = true;
284  payloadId = destination.storePayload( obj, boost::posix_time::microsec_clock::universal_time() );
285  }
286  if( inputTypeName == "PhysicsTools::Calibration::Histogram2D<double,double,double>" ){
287  match = true;
289  payloadId = destination.storePayload( obj, boost::posix_time::microsec_clock::universal_time() );
290  }
291 
292 
293  if( ! match ) throwException( "Payload type \""+inputTypeName+"\" is unknown.","import" );
294  }
295  return payloadId;
296  }
Definition: ESGain.h:5
tuple lumi
Definition: fjr2json.py:35
Definition: DTT0.h:52
Histogram3D< double > HistogramD3D
Definition: Histogram3D.h:182
#define IMPORT_PAYLOAD_CASE(TYPENAME)
Definition: CondDBImport.cc:4
std::string Hash
Definition: Types.h:38
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
if(dp >Float(M_PI)) dp-
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
template<typename T , typename Arg1 >
constexpr 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>
constexpr 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.

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 41 of file Utils.h.

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

41  {
42  std::string protocol = getConnectionProtocol( connectionString );
44  std::string databaseName("");
45  if( protocol == "sqlite" || protocol == "sqlite_file" || protocol == "sqlite_fip" ){
46  databaseName = connectionString.substr( protocol.size()+1 );
47  } else if ( protocol == "oracle" || protocol == "frontier" ){
48  size_t ptr = protocol.size()+1;
49  if( connectionString.substr( ptr,2 )!="//" ) throwException( "Connection string "+connectionString+
50  " is invalid format for technology \""+
51  protocol+"\".","parseConnectionString" );
52  ptr += 2;
53  size_t serviceEnd = connectionString.find( '/', ptr );
54  if( serviceEnd == std::string::npos ) throwException( "Connection string "+connectionString+" is invalid.",
55  "parseConnectionString" );
56  serviceName = connectionString.substr( ptr, serviceEnd-ptr );
57  ptr = serviceEnd+1;
58  databaseName = connectionString.substr( ptr );
59  } else throwException( "Technology "+protocol+" is not known.","parseConnectionString" );
60 
61  return std::make_tuple( protocol, serviceName, databaseName );
62  }
std::string getConnectionProtocol(const std::string &connectionString)
Definition: Utils.h:33
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 lumiQTWidget::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 224 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().

224  {
225  if( !container.size() ) return container.end();
226  auto p = std::upper_bound( container.begin(), container.end(), val, IOVComp() );
227  return (p!= container.begin()) ? p-1 : container.end();
228  }
template<typename T , typename P >
void cond::persistency::static_assert_is_same_decayed ( )

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
cond::persistency::table ( TAG  )

Definition at line 13 of file IOVSchema.h.

References column, SurfaceDeformationFactory::create(), idDealer::description, edm::eventsetup::heterocontainer::insert(), mergeVDriftHistosByStation::name, python.IdGenerator::schema, benchmark_cfg::select, AlCaHLTBitMon_QueryRunRegistry::string, and update.

13  {
14 
15  column( NAME, std::string );
16  column( TIME_TYPE, cond::TimeType );
17  column( OBJECT_TYPE, std::string );
18  column( SYNCHRONIZATION, cond::SynchronizationType );
19  column( END_OF_VALIDITY, cond::Time_t );
20  column( DESCRIPTION, std::string );
21  column( LAST_VALIDATED_TIME, cond::Time_t );
22  column( INSERTION_TIME, boost::posix_time::ptime );
23  column( MODIFICATION_TIME, boost::posix_time::ptime );
24 
25  class Table : public ITagTable {
26  public:
27  explicit Table( coral::ISchema& schema );
28  virtual ~Table(){}
29  bool exists();
30  void create();
31  bool select( const std::string& name );
32  bool select( const std::string& name, cond::TimeType& timeType, std::string& objectType,
33  cond::Time_t& endOfValidity, std::string& description, cond::Time_t& lastValidatedTime );
34  bool getMetadata( const std::string& name, std::string& description,
35  boost::posix_time::ptime& insertionTime, boost::posix_time::ptime& modificationTime );
36  void insert( const std::string& name, cond::TimeType timeType, const std::string& objectType,
37  cond::SynchronizationType synchronizationType, cond::Time_t endOfValidity, const std::string& description,
38  cond::Time_t lastValidatedTime, const boost::posix_time::ptime& insertionTime );
39  void update( const std::string& name, cond::Time_t& endOfValidity, const std::string& description,
40  cond::Time_t lastValidatedTime, const boost::posix_time::ptime& updateTime );
41  void updateValidity( const std::string& name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime& updateTime );
42  private:
43  coral::ISchema& m_schema;
44  };
45  }
TimeType
Definition: Time.h:21
unsigned long long Time_t
Definition: Time.h:16
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
tuple description
Definition: idDealer.py:66
#define column(...)
Definition: DbCore.h:74
#define update(a, b)
SynchronizationType
Definition: Types.h:26
SurfaceDeformation * create(int type, const std::vector< double > &params)
cond::persistency::table ( GLOBAL_TAG  )

Definition at line 13 of file GTSchema.h.

References column, idDealer::description, edm::eventsetup::heterocontainer::insert(), mergeVDriftHistosByStation::name, fetchall_from_DQM_v2::release, run_regression::RELEASE, python.IdGenerator::schema, benchmark_cfg::select, AlCaHLTBitMon_QueryRunRegistry::string, and update.

13  {
14 
15  column( NAME, std::string );
16  column( VALIDITY, cond::Time_t );
17  column( DESCRIPTION, std::string );
19  column( SNAPSHOT_TIME, boost::posix_time::ptime );
20  column( INSERTION_TIME, boost::posix_time::ptime );
21 
22  class Table : public IGTTable {
23  public:
24  explicit Table( coral::ISchema& schema );
25  virtual ~Table(){}
26  bool exists();
27  bool select( const std::string& name);
28  bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime );
29  bool select( const std::string& name, cond::Time_t& validity, std::string& description,
30  std::string& release, boost::posix_time::ptime& snapshotTime );
31  void insert( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
32  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime );
33  void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
34  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime );
35  private:
36  coral::ISchema& m_schema;
37  };
38  }
unsigned long long Time_t
Definition: Time.h:16
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
tuple description
Definition: idDealer.py:66
#define column(...)
Definition: DbCore.h:74
#define update(a, b)
cond::persistency::table ( GLOBAL_TAG_MAP  )

Definition at line 40 of file GTSchema.h.

References column, constexpr, edm::eventsetup::heterocontainer::insert(), run_regression::LABEL, python.IdGenerator::schema, benchmark_cfg::select, AlCaHLTBitMon_QueryRunRegistry::string, and o2o::tags.

40  {
41 
42  static constexpr unsigned int PAYLOAD_HASH_SIZE = 40;
43 
44  column( GLOBAL_TAG_NAME, std::string );
45  // to be changed to RECORD_NAME!
46  column( RECORD, std::string );
47  // to be changed to RECORD_LABEL!
49  column( TAG_NAME, std::string );
50 
51  class Table : public IGTMapTable {
52  public:
53  explicit Table( coral::ISchema& schema );
54  virtual ~Table(){}
55  bool exists();
56  bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags );
57  bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
58  std::vector<std::tuple<std::string,std::string,std::string> >& tags );
59  void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags );
60  private:
61  coral::ISchema& m_schema;
62  };
63  }
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
tuple tags
Definition: o2o.py:248
#define column(...)
Definition: DbCore.h:74
#define constexpr
cond::persistency::table ( PAYLOAD  )

Definition at line 47 of file IOVSchema.h.

References column, constexpr, SurfaceDeformationFactory::create(), cscdqm::DATA, cond::time::HASH, edm::eventsetup::heterocontainer::insert(), python.IdGenerator::schema, benchmark_cfg::select, AlCaHLTBitMon_QueryRunRegistry::string, and VERSION.

47  {
48 
49  static constexpr unsigned int PAYLOAD_HASH_SIZE = 40;
50 
51  column( HASH, std::string, PAYLOAD_HASH_SIZE );
52  column( OBJECT_TYPE, std::string );
54  //column( STREAMER, std::string );
55  column( STREAMER_INFO, cond::Binary );
57  column( INSERTION_TIME, boost::posix_time::ptime );
58 
59  class Table : public IPayloadTable {
60  public:
61  explicit Table( coral::ISchema& schema );
62  virtual ~Table(){}
63  bool exists();
64  void create();
65  bool select( const cond::Hash& payloadHash);
66  bool select( const cond::Hash& payloadHash, std::string& objectType, cond::Binary& payloadData);
67  bool getType( const cond::Hash& payloadHash, std::string& objectType );
68  bool insert( const cond::Hash& payloadHash, const std::string& objectType,
69  const cond::Binary& payloadData, const boost::posix_time::ptime& insertionTime);
70  cond::Hash insertIfNew( const std::string& objectType, const cond::Binary& payloadData,
71  const boost::posix_time::ptime& insertionTime );
72  private:
73  coral::ISchema& m_schema;
74  };
75  }
std::string Hash
Definition: Types.h:38
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
#define column(...)
Definition: DbCore.h:74
#define VERSION
Definition: scimark2.h:5
SurfaceDeformation * create(int type, const std::vector< double > &params)
#define constexpr
cond::persistency::table ( IOV  )

Definition at line 77 of file IOVSchema.h.

References column, constexpr, SurfaceDeformationFactory::create(), cond::hash, python.IdGenerator::schema, cond::time::SINCE_GROUP_SIZE, findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.

77  {
78 
79  column( TAG_NAME, std::string );
80  column( SINCE, cond::Time_t );
81  column( PAYLOAD_HASH, std::string, PAYLOAD::PAYLOAD_HASH_SIZE );
82  column( INSERTION_TIME, boost::posix_time::ptime );
83 
84  struct MAX_SINCE {
85  typedef cond::Time_t type;
86  static constexpr size_t size = 0;
87  static std::string tableName(){ return SINCE::tableName(); }
88  static std::string fullyQualifiedName(){
89  return std::string("MAX(")+SINCE::fullyQualifiedName()+")";
90  }
91  };
92  struct SINCE_GROUP {
93  typedef cond::Time_t type;
94  static constexpr size_t size = 0;
95  static std::string tableName(){ return SINCE::tableName(); }
96  static std::string fullyQualifiedName(){
97  std::string sgroupSize = boost::lexical_cast<std::string>(cond::time::SINCE_GROUP_SIZE);
98  return "("+SINCE::fullyQualifiedName()+"/"+sgroupSize+")*"+sgroupSize;
99  }
100  };
101 
102  struct SEQUENCE_SIZE {
103  typedef unsigned int type;
104  static constexpr size_t size = 0;
105  static std::string tableName(){ return SINCE::tableName(); }
106  static std::string fullyQualifiedName(){
107  return "COUNT(*)";
108  }
109  };
110 
111  class Table : public IIOVTable {
112  public:
113  explicit Table( coral::ISchema& schema );
114  virtual ~Table(){}
115  bool exists();
116  void create();
117  size_t selectGroups( const std::string& tag, std::vector<cond::Time_t>& groups );
118  size_t selectSnapshotGroups( const std::string& tag, const boost::posix_time::ptime& snapshotTime,
119  std::vector<cond::Time_t>& groups );
120  size_t selectLatestByGroup( const std::string& tag, cond::Time_t lowerGroup, cond::Time_t upperGroup,
121  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
122  size_t selectSnapshotByGroup( const std::string& tag, cond::Time_t lowerGroup, cond::Time_t upperGroup,
123  const boost::posix_time::ptime& snapshotTime,
124  std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
125  size_t selectLatest( const std::string& tag, std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs);
126  bool getLastIov( const std::string& tag, cond::Time_t& since, cond::Hash& hash );
127  bool getSize( const std::string& tag, size_t& size );
128  bool getSnapshotSize( const std::string& tag, const boost::posix_time::ptime& snapshotTime, size_t& size );
129  void insertOne( const std::string& tag, cond::Time_t since, cond::Hash payloadHash, const boost::posix_time::ptime& insertTime);
130  void insertMany( const std::string& tag, const std::vector<std::tuple<cond::Time_t,cond::Hash,boost::posix_time::ptime> >& iovs );
131  private:
132  coral::ISchema& m_schema;
133  };
134  }
type
Definition: HCALResponse.h:21
static constexpr unsigned int SINCE_GROUP_SIZE
Definition: Time.h:35
unsigned long long Time_t
Definition: Time.h:16
std::string Hash
Definition: Types.h:38
#define column(...)
Definition: DbCore.h:74
SurfaceDeformation * create(int type, const std::vector< double > &params)
tuple size
Write out results.
#define constexpr
cond::persistency::table ( TAG_MIGRATION  )

Definition at line 137 of file IOVSchema.h.

References column, SurfaceDeformationFactory::create(), edm::eventsetup::heterocontainer::insert(), python.IdGenerator::schema, benchmark_cfg::select, and AlCaHLTBitMon_QueryRunRegistry::string.

137  {
138 
139  column( SOURCE_ACCOUNT, std::string );
140  column( SOURCE_TAG, std::string );
141  column( TAG_NAME, std::string );
142  column( INSERTION_TIME, boost::posix_time::ptime );
143 
144  class Table : public ITagMigrationTable {
145  public:
146  explicit Table( coral::ISchema& schema );
147  virtual ~Table(){}
148  bool exists();
149  void create();
150  bool select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName);
151  void insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
152  const boost::posix_time::ptime& insertionTime);
153  private:
154  coral::ISchema& m_schema;
155  };
156  }
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
#define column(...)
Definition: DbCore.h:74
SurfaceDeformation * create(int type, const std::vector< double > &params)
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(), cond::persistency::Session::coralSession(), cond::persistency::Session::createGlobalTag(), cond::persistency::Session::createIov(), cond::persistency::Session::createIovForPayload(), cond::persistency::Query< Types...>::currentRow(), fetch(), cond::persistency::Session::fetchPayload(), cond::persistency::GTEditor::flush(), cond::persistency::IOVEditor::flush(), cond::persistency::KeyList::get(), getConnectionParams(), getConnectionProtocol(), cond::persistency::IOVProxy::getInterval(), import(), 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::persistency::OraTagTable::select(), cond::CredentialStore::startSession(), cond::persistency::SessionImpl::startTransaction(), cond::persistency::OraIOVSchema::tagMigrationTable(), cond::persistency::OraTagTable::update(), and cond::CredentialStore::updateConnection().

12  {
13  throw Exception( message, methodName );
14  }