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

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 > 
getRealConnectionString (const std::string &initialConnection)
 
std::pair< std::string,
std::string > 
getRealConnectionString (const std::string &initialConnection, const std::string &transId)
 
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 ()
 
std::pair< std::string,
std::string > 
makeFrontierConnectionString (const std::string &initialConnection, const std::string &transactionId)
 
cond::Hash makeHash (const std::string &objectType, const cond::Binary &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 (GLOBAL_TAG)
 
 table (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

unsigned int cond::persistency::countslash ( const std::string &  input)

Definition at line 13 of file DbConnectionString.cc.

References prof2calltree::count.

Referenced by makeFrontierConnectionString().

13  {
14  unsigned int count=0;
15  std::string::size_type slashpos( 0 );
16  while( slashpos!=std::string::npos){
17  slashpos = input.find('/', slashpos );
18  if ( slashpos != std::string::npos ){
19  ++count;
20  // start next search after this word
21  slashpos += 1;
22  }
23  }
24  return count;
25  }
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::getRealConnectionString ( const std::string &  initialConnection)

Definition at line 64 of file DbConnectionString.cc.

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

64  {
65  return getRealConnectionString( initialConnection, "" );
66  }
std::pair< std::string, std::string > getRealConnectionString(const std::string &initialConnection)
std::pair< std::string, std::string > cond::persistency::getRealConnectionString ( const std::string &  initialConnection,
const std::string &  transId 
)

Definition at line 68 of file DbConnectionString.cc.

References makeFrontierConnectionString().

69  {
70  auto connData = parseConnectionString( initialConnection );
71  if( std::get<0>(connData) == "frontier" ) return makeFrontierConnectionString( initialConnection, transId );
72  return std::make_pair(initialConnection,"");
73  }
std::pair< std::string, std::string > makeFrontierConnectionString(const std::string &initialConnection, const std::string &transactionId)
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:34
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  };
std::pair<std::string,std::string> cond::persistency::makeFrontierConnectionString ( const std::string &  initialConnection,
const std::string &  transactionId 
)

Definition at line 27 of file DbConnectionString.cc.

References countslash(), edm::Service< T >::isAvailable(), ConfigFiles::l, edm::SiteLocalConfig::lookupCalibConnect(), AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by getRealConnectionString().

28  {
29  std::string realConn = initialConnection;
30  std::string proto("frontier://");
31  std::string::size_type fpos=initialConnection.find(proto);
32  unsigned int nslash=countslash(initialConnection.substr(proto.size(),initialConnection.size()-fpos));
33  if(nslash==1){
34  edm::Service<edm::SiteLocalConfig> localconfservice;
35  if( !localconfservice.isAvailable() ){
36  throwException("SiteLocalConfigService is not available","cond::makeRealConnectString");
37  }
38  realConn=localconfservice->lookupCalibConnect(initialConnection);
39  }
40  if (!transactionId.empty()) {
41  size_t l = realConn.rfind('/');
42  realConn.insert(l,"(freshkey="+transactionId+')');
43  }
44 
45  std::string refreshConnect;
46  std::string::size_type startRefresh = realConn.find("://");
47  if (startRefresh != std::string::npos){
48  startRefresh += 3;
49  }
50  std::string::size_type endRefresh=realConn.rfind("/", std::string::npos);
51  if (endRefresh == std::string::npos){
52  refreshConnect = realConn;
53  }else{
54  refreshConnect = realConn.substr(startRefresh, endRefresh-startRefresh);
55  if(refreshConnect.substr(0,1) != "("){
56  //if the connect string is not a complicated parenthesized string,
57  // an http:// needs to be at the beginning of it
58  refreshConnect.insert(0, "http://");
59  }
60  }
61  return std::make_pair(realConn,refreshConnect);
62  }
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)
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:61
const void * data() const
Definition: Binary.cc:52
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
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 ( 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 ( 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:22
SurfaceDeformation * create(int type, const std::vector< double > &params)
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:34
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:34
#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(), cond::persistency::IOVProxy::getInterval(), import(), cond::persistency::OraIOVTable::insertMany(), cond::persistency::OraIOVTable::insertOne(), cond::persistency::SessionImpl::isOra(), cond::persistency::GTEditor::load(), cond::persistency::GTProxy::load(), cond::persistency::IOVProxy::load(), cond::persistency::PayloadProxy< std::vector< cond::Time_t > >::loadPayload(), makeFrontierConnectionString(), 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()(), 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  }