Loader of trigger configurations from Json files.
More...
#include <TrigDBLoader.h>
Loader of trigger configurations from Json files.
Definition at line 33 of file TrigDBLoader.h.
◆ TrigDBLoader()
TrigConf::TrigDBLoader::TrigDBLoader |
( |
const std::string & |
loaderName, |
|
|
const std::string & |
connection |
|
) |
| |
◆ ~TrigDBLoader()
TrigConf::TrigDBLoader::~TrigDBLoader |
( |
| ) |
|
|
overridevirtualdefault |
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
◆ createDBSession()
std::unique_ptr< coral::ISessionProxy > TrigConf::TrigDBLoader::createDBSession |
( |
| ) |
const |
|
protected |
create (if needed) DB session and return the session proxy
Definition at line 94 of file TrigDBLoader.cxx.
96 coral::ConnectionService connSvc;
97 coral::IConnectionServiceConfiguration& csc = connSvc.configuration();
112 auto proxy = std::unique_ptr<coral::ISessionProxy>( connSvc.connect(
m_connection, coral::AccessMode::ReadOnly) );
◆ getQueryDefinition()
return query for given schemaVersion from possible queries
Definition at line 122 of file TrigDBLoader.cxx.
126 size_t maxDefVersion = 0;
127 for(
auto &
entry : queries) {
128 size_t vkey =
entry.first;
130 maxDefVersion = vkey;
134 if( maxDefVersion==0 ) {
138 return queries.at(maxDefVersion);
◆ msg() [1/2]
MsgStreamTC & TrigConf::TrigConfMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 81 of file TrigConfMessaging.h.
◆ msg() [2/2]
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 91 of file TrigConfMessaging.h.
◆ msgLvl()
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 70 of file TrigConfMessaging.h.
◆ outputLevel()
◆ schemaVersion()
size_t TrigConf::TrigDBLoader::schemaVersion |
( |
coral::ISessionProxy * |
session | ) |
const |
access to TriggerDB schema version
- Returns
- version of the DB schema (0 - no version, >0 - schema version)
Definition at line 38 of file TrigDBLoader.cxx.
40 static const std::string versionTagPrefix(
"Trigger-Run3-Schema-v");
43 if(! session->nominalSchema().existsTable(
"TRIGGER_SCHEMA") ) {
44 throw std::runtime_error(
"Trigger schema has no schema version table" );
56 throw std::runtime_error(
"Trigger schema has schema version table but it is empty" );
60 std::string versionTag =
row[
"TS_TAG"].data<std::string>();
61 if( ! startswith(versionTag, versionTagPrefix)) {
62 throw std::runtime_error(
"Tag format error: Trigger schema version tag " + versionTag +
"does not start with " + versionTagPrefix);
65 std::string vstr = versionTag.substr(versionTagPrefix.size());
70 catch (
const std::invalid_argument& ia) {
71 TRG_MSG_ERROR(
"Invalid argument when interpreting the version part " << vstr <<
" of schema tag " << versionTag <<
". " << ia.what());
◆ setLevel()
◆ writeRawFile()
bool TrigConf::TrigDBLoader::writeRawFile |
( |
const coral::Blob & |
data, |
|
|
const std::string & |
outFileName |
|
) |
| const |
write data blob into file This can be used to write the DB content to file without going through a ptree
Definition at line 80 of file TrigDBLoader.cxx.
87 outFile.write(
static_cast<const char*
> (
data.startingAddress()),
data.size() );
◆ m_connection
std::string TrigConf::TrigDBLoader::m_connection {"TRIGGERDB"} |
|
private |
◆ m_connectionTimeout
int TrigConf::TrigDBLoader::m_connectionTimeout {0} |
|
private |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls |
|
mutableprivateinherited |
◆ m_name
std::string TrigConf::TrigConfMessaging::m_name |
|
privateinherited |
◆ m_retrialPeriod
int TrigConf::TrigDBLoader::m_retrialPeriod {0} |
|
private |
◆ m_retrialTimeout
int TrigConf::TrigDBLoader::m_retrialTimeout {0} |
|
private |
The documentation for this class was generated from the following files:
outFile
Comment Out Those You do not wish to run.