#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 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 |
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 | |
IOManagerDB & | instance () |
retrieve access to singleton | |
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 | |
const SctData::ResultHeader & | getHeader (const Sct::Serializable &ob) |
get the header from a TestResult or ScanResult | |
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 | |
IOManagerDB * | s_man |
pointer to singleton |
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 m_mysql. |
|
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 m_mysql. |
|
Add a scan. Identifies correct Test from the run# and the 1st scan number. Definition at line 662 of file IOManagerDB.cpp. References m_mysql, TestData::runNumber, and TestData::startScanNumber. Referenced by addTest(). |
|
Add a test.
Definition at line 637 of file IOManagerDB.cpp. References addScan(), convertToMysqlDateTimeFormat(), TestData::endTime, m_mysql, TestData::nScans, TestData::runNumber, TestData::startScanNumber, TestData::startTime, and TestData::testName. |
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(), 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(), and getResult(). Referenced by 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 read(). |
|
get the header from a TestResult or ScanResult
Definition at line 154 of file IOManagerDB.cpp. References Sct::Streamable::getClassName(), and Sct::Serializable::getUniqueID(). |
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:
|
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 blob_add_time, compress_time, decompress_time, Sct::Archive::IOManagerStreamerVersioned::getMutex(), istream_time, m_compressor, m_nBlobAdd, m_nCompress, m_nDecompress, m_nRead, m_nWrite, ostream_time, read_time, and write_time. |
Here is the call graph for this function:
|
time spent adding raw data blobs to db
Definition at line 194 of file IOManagerDB.h. Referenced by status(). |
|
time spent compressing data
Definition at line 192 of file IOManagerDB.h. Referenced by status(). |
|
time spent decompressing data
Definition at line 193 of file IOManagerDB.h. |
|
time spent adding raw data blobs to db
Definition at line 197 of file IOManagerDB.h. |
|
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(), getRawDataBlob(), getResult(), and IOManagerDB(). |
|
# of raw objects added to database
Definition at line 187 of file IOManagerDB.h. Referenced by status(). |
|
# of strings compressed
Definition at line 185 of file IOManagerDB.h. Referenced by status(). |
|
# of strings decompressed
Definition at line 186 of file IOManagerDB.h. |
|
# of raw objects added to database
Definition at line 188 of file IOManagerDB.h. |
|
total number got out of database
Definition at line 183 of file IOManagerDB.h. |
|
total number put into database
Definition at line 184 of file IOManagerDB.h. Referenced by status(). |
|
time spent adding raw data blobs to db
Definition at line 196 of file IOManagerDB.h. Referenced by status(). |
|
time spent adding raw data blobs to db
Definition at line 195 of file IOManagerDB.h. |
|
time spent reading from database
Definition at line 190 of file IOManagerDB.h. |
|
pointer to singleton
Definition at line 106 of file IOManagerDB.cpp. Referenced by instance(). |
|
mutex for timing information
Definition at line 181 of file IOManagerDB.h. Referenced by read(). |
|
time spent writing to database
Definition at line 191 of file IOManagerDB.h. Referenced by status(). |