#include <IOManagerDB.h>
Inheritance diagram for SctArchiving::IOManagerDB:
Public Member Functions | |
virtual shared_ptr< Sct::Serializable > | read (const string &name, const Sct::IOParams *params=0) const |
read using appropriate streamers | |
virtual | ~IOManagerDB () |
virtual std::string | status () const |
get some status information | |
virtual void | addRun (unsigned long runNumber, bool trash) const |
Add a run - gets data set identifier from getDataSetID. | |
virtual void | addTest (const TestData &testdata, bool alsoAddScans) const |
Add a test. | |
virtual void | addScan (const TestData &testdata, unsigned scanNumber) const |
Add a scan. | |
virtual void | addModule (const std::string &layerName, const std::string &LMTnr, const std::string &poistionNumber, const std::string &moduleNumber) const |
Add a module. | |
virtual void | addRawDataRecord (const std::string &moduleId, const std::string &scanId) const |
Add module-scan combination raw data table. | |
virtual void | addRawDataBlob (const std::string &moduleId, const std::string &scanId, const char *chBuf, const long bufSize) const |
Add binary data to raw data table. | |
virtual std::string | getRawDataBlob (const std::string &moduleId, const std::string &scanId) const |
Get binary data from raw data table. | |
virtual std::string | getDataSetName () const |
get string identifying data set e.g. | |
virtual void | setDataSetName (const std::string &dataSetName) |
set the string identifying data set e.g. | |
IOManager stuff | |
write using default streamers | |
virtual void | write (const Sct::Serializable &ob, const Sct::IOParams *params=0) const |
Write an object. | |
methods for getting table row identifiers | |
Use strings for now, since we are always communicating with sql Return empty string if not found!
Uses the current DataSetName | |
std::string | getDataSetID () const |
std::string | getTestTypeID (const std::string &testName) const |
std::string | getRunID (const unsigned runNumber) const |
std::string | getTestID (const std::string &runId, const unsigned startScanNumber) const |
std::string | getScanID (const std::string &testId, const unsigned scanNumber) const |
std::string | getLayerID (const std::string &layerName) const |
std::string | getRowID (const std::string &layerId, const std::string &LMTnr) const |
std::string | getPositionID (const std::string &rowId, const std::string &positionNumber) const |
std::string | getModuleID (const std::string &moduleNumber) const |
Static Public Member Functions | |
static IOManagerDB & | instance () |
retrieve access to singleton | |
static std::string | convertToMysqlDateTimeFormat (const std::string &isotime) |
conversion just removes 'T' from isotime | |
Private Member Functions | |
void | checkForMySqlErrors (const string &msg, const string &file, int line) const |
throw MysqlException if there is an error in the mysql object | |
void | checkForMySqlErrors (const string &msg, const string &query, const string &file, int line) const |
throw MysqlException if there is an error in the mysql object - listing query | |
IOManagerDB () | |
constructor. | |
boost::shared_ptr< MYSQL_RES > | getResult () const |
gets result, using msql_free_result in deleter | |
std::string | executeQueryReturnID (std::string query) const |
utility method for getting single id Or more precise, this method returns the result of a query deisgned to return one record (row) and one field (column). | |
void | executeQuery (std::string query) const |
Static Private Member Functions | |
static const SctData::ResultHeader & | getHeader (const Sct::Serializable &ob) |
get the header from a TestResult or ScanResult | |
static std::string | getTable (const Sct::Serializable &ob) |
find the name of the table which the ob should to into. | |
Private Attributes | |
boost::shared_ptr< ZlibStringCompressor > | m_compressor |
keep a string compressor handy to zip and unzip BLOB data. | |
MYSQL * | m_mysql |
the main MYSQL object | |
std::string | m_dataSetName |
name of data set - e.g. | |
boost::recursive_mutex | timingAccess |
mutex for timing information | |
unsigned | m_nRead |
total number got out of database | |
unsigned | m_nWrite |
total number put into database | |
unsigned | m_nCompress |
# of strings compressed | |
unsigned | m_nDecompress |
# of strings decompressed | |
unsigned | m_nBlobAdd |
# of raw objects added to database | |
unsigned | m_nQueries |
# of raw objects added to database | |
boost::posix_time::time_duration | read_time |
time spent reading from database | |
boost::posix_time::time_duration | write_time |
time spent writing to database | |
boost::posix_time::time_duration | compress_time |
time spent compressing data | |
boost::posix_time::time_duration | decompress_time |
time spent decompressing data | |
boost::posix_time::time_duration | blob_add_time |
time spent adding raw data blobs to db | |
boost::posix_time::time_duration | query_time |
time spent adding raw data blobs to db | |
boost::posix_time::time_duration | ostream_time |
time spent adding raw data blobs to db | |
boost::posix_time::time_duration | istream_time |
time spent adding raw data blobs to db | |
Static Private Attributes | |
static IOManagerDB * | s_man |
pointer to singleton | |
Data Structures | |
class | MySqlFreeResultDeleter |
It is expected to be used in archival, and so also makes use of streamer versioning by inheriting from IOManagerStreamerVersioned. Uses a mysql back-end.
Definition at line 36 of file IOManagerDB.h.
|
constructor.
Definition at line 66 of file IOManagerDB.cpp. References checkForMySqlErrors(), m_compressor, and m_mysql. Referenced by instance(). Here is the call graph for this function: ![]() |
|
Add a module.
Definition at line 678 of file IOManagerDB.cpp. References executeQuery(), getLayerID(), getPositionID(), getRowID(), and m_mysql. Referenced by write(). Here is the call graph for this function: ![]() |
|
Add binary data to raw data table.
Definition at line 715 of file IOManagerDB.cpp. References checkForMySqlErrors(), and m_mysql. Here is the call graph for this function: ![]() |
|
Add module-scan combination raw data table.
Definition at line 699 of file IOManagerDB.cpp. References checkForMySqlErrors(), and m_mysql. Here is the call graph for this function: ![]() |
|
Add a run - gets data set identifier from getDataSetID.
Definition at line 623 of file IOManagerDB.cpp. References executeQuery(), getDataSetID(), and m_mysql. Referenced by write(). Here is the call graph for this function: ![]() |
|
Add a scan. Identifies correct Test from the run# and the 1st scan number. Definition at line 662 of file IOManagerDB.cpp. References executeQuery(), getRunID(), getTestID(), m_mysql, TestData::runNumber, and TestData::startScanNumber. Referenced by addTest(). Here is the call graph for this function: ![]() |
|
Add a test.
Definition at line 637 of file IOManagerDB.cpp. References addScan(), convertToMysqlDateTimeFormat(), TestData::endTime, executeQuery(), getRunID(), getTestTypeID(), m_mysql, TestData::nScans, TestData::runNumber, TestData::startScanNumber, TestData::startTime, and TestData::testName. Referenced by write(). Here is the call graph for this function: ![]() |
|
throw MysqlException if there is an error in the mysql object - listing query
Definition at line 49 of file IOManagerDB.cpp. References m_mysql. |
|
throw MysqlException if there is an error in the mysql object
Definition at line 39 of file IOManagerDB.cpp. References m_mysql. Referenced by addRawDataBlob(), addRawDataRecord(), executeQuery(), executeQueryReturnID(), getRawDataBlob(), getResult(), and IOManagerDB(). |
|
conversion just removes 'T' from isotime
Definition at line 521 of file IOManagerDB.cpp. Referenced by addTest(). |
|
utility method for getting single id Or more precise, this method returns the result of a query deisgned to return one record (row) and one field (column). An exeption is raised if the query returns 0 or more than 1 records. Otherwise the method returns the contents of the first field, other fields are ignored. Definition at line 854 of file IOManagerDB.cpp. References checkForMySqlErrors(), executeQuery(), and getResult(). Referenced by getDataSetID(), getLayerID(), getModuleID(), getPositionID(), getRowID(), getRunID(), getScanID(), getTestID(), getTestTypeID(), and read(). Here is the call graph for this function: ![]() |
|
get string identifying data set e.g. Barrel3_Cold_Oxford Definition at line 543 of file IOManagerDB.cpp. References m_dataSetName. Referenced by getDataSetID(), read(), and write(). |
|
get the header from a TestResult or ScanResult
Definition at line 154 of file IOManagerDB.cpp. References Sct::Streamable::getClassName(). Here is the call graph for this function: ![]() |
|
Get binary data from raw data table.
Definition at line 757 of file IOManagerDB.cpp. References checkForMySqlErrors(), and m_mysql. Referenced by read(). Here is the call graph for this function: ![]() |
|
gets result, using msql_free_result in deleter
Definition at line 868 of file IOManagerDB.cpp. References checkForMySqlErrors(), and m_mysql. Referenced by executeQueryReturnID(). Here is the call graph for this function: ![]() |
|
find the name of the table which the ob should to into.
Definition at line 174 of file IOManagerDB.cpp. |
|
retrieve access to singleton
Definition at line 108 of file IOManagerDB.cpp. References IOManagerDB(), and s_man. Here is the call graph for this function: ![]() |
|
read using appropriate streamers
Implements Sct::IOManager. Definition at line 351 of file IOManagerDB.cpp. References decompress_time, executeQueryReturnID(), Sct::IOName::getClassName(), getDataSetName(), getModuleID(), Sct::Archive::IOManagerStreamerVersioned::getMutex(), getRawDataBlob(), Sct::Archive::IOManagerStreamerVersioned::getReadVersionMap(), getRunID(), getScanID(), getTestID(), Sct::IOName::getUniqueID(), istream_time, m_compressor, m_nDecompress, m_nRead, read_time, Sct::Archive::IOManagerStreamerVersioned::readImpl(), Sct::Archive::IOManagerStreamerVersioned::setReadMode(), and timingAccess. Here is the call graph for this function: ![]() |
|
set the string identifying data set e.g. Barrel3_Cold_Oxford Definition at line 539 of file IOManagerDB.cpp. References m_dataSetName. |
|
get some status information
Implements Sct::Archive::IOManagerArchive. Definition at line 116 of file IOManagerDB.cpp. References m_compressor. |
|
Write an object.
Implements Sct::IOManager. Definition at line 180 of file IOManagerDB.cpp. References addModule(), addRun(), addTest(), Sct::Streamable::getClassName(), getDataSetName(), getModuleID(), Sct::Archive::IOManagerStreamerVersioned::getMutex(), getRunID(), getTestID(), Sct::Serializable::getUniqueID(), ostream_time, Sct::Archive::IOManagerStreamerVersioned::setReadMode(), timingAccess, and Sct::Archive::IOManagerStreamerVersioned::writeImpl(). Here is the call graph for this function: ![]() |
|
time spent adding raw data blobs to db
Definition at line 194 of file IOManagerDB.h. |
|
time spent compressing data
Definition at line 192 of file IOManagerDB.h. |
|
time spent decompressing data
Definition at line 193 of file IOManagerDB.h. Referenced by read(). |
|
time spent adding raw data blobs to db
Definition at line 197 of file IOManagerDB.h. Referenced by read(). |
|
keep a string compressor handy to zip and unzip BLOB data.
Definition at line 147 of file IOManagerDB.h. Referenced by IOManagerDB(), read(), and status(). |
|
name of data set - e.g. barrel3ColdAtOxford Definition at line 172 of file IOManagerDB.h. Referenced by getDataSetName(), and setDataSetName(). |
|
the main MYSQL object
Definition at line 150 of file IOManagerDB.h. Referenced by addModule(), addRawDataBlob(), addRawDataRecord(), addRun(), addScan(), addTest(), checkForMySqlErrors(), executeQuery(), getRawDataBlob(), getResult(), IOManagerDB(), and ~IOManagerDB(). |
|
# of raw objects added to database
Definition at line 187 of file IOManagerDB.h. |
|
# of strings compressed
Definition at line 185 of file IOManagerDB.h. |
|
# of strings decompressed
Definition at line 186 of file IOManagerDB.h. Referenced by read(). |
|
# of raw objects added to database
Definition at line 188 of file IOManagerDB.h. Referenced by executeQuery(). |
|
total number got out of database
Definition at line 183 of file IOManagerDB.h. Referenced by read(). |
|
total number put into database
Definition at line 184 of file IOManagerDB.h. |
|
time spent adding raw data blobs to db
Definition at line 196 of file IOManagerDB.h. Referenced by write(). |
|
time spent adding raw data blobs to db
Definition at line 195 of file IOManagerDB.h. Referenced by executeQuery(). |
|
time spent reading from database
Definition at line 190 of file IOManagerDB.h. Referenced by read(). |
|
pointer to singleton
Definition at line 143 of file IOManagerDB.h. Referenced by instance(). |
|
mutex for timing information
Definition at line 181 of file IOManagerDB.h. Referenced by executeQuery(), read(), and write(). |
|
time spent writing to database
Definition at line 191 of file IOManagerDB.h. |