Analysis Software
Documentation for sPHENIX simulation software
|
PgPostBankBackupManager. More...
#include <coresoftware/blob/master/offline/database/pdbcal/pg/PgPostBankBackupManager.h>
Public Types | |
typedef std::vector< int > | rid_list_t |
list of int | |
Public Member Functions | |
PgPostBankBackupManager (const std::string &Tag="") | |
virtual | ~PgPostBankBackupManager () |
bool | isRIdExist (const std::string &bankName, int rid) |
check whether an record with certain rid already there | |
int | getTotalRowCount (const std::string &bankName) |
total row counts | |
rid_list_t | getListOfRId (const std::string &bankName, const std::string &condition="") |
list rid in a bank | |
PgPostBankBackupStorage * | fetchBank (const std::string &bankName, int rid) |
bool | commit (PgPostBankBackupStorage *bs) |
int | commitAllBankfromTFile (const std::string &in_file) |
TFile -> Database for official operation use. | |
int | fetchBank2TFile (const std::string &bankName, const rid_list_t &rid_list, const std::string &out_file) |
Database -> TFile for official operation use. | |
int | fetchAllBank2TFile (const std::string &bankName, const std::string &record_selection, const std::string &out_file_base, int splitting_limit=100000) |
Database -> TFile for all all records satisifying record_selection. | |
void | dumpTable (const std::string &bankName, std::ostream &out) |
dump databse to text | |
int | CleanTable (const std::string &bankName, const PHTimeStamp &min_preserve_time=PHTimeStamp::PHFarFuture, const bool do_delete=false, const std::string &log_file_name="") |
virtual void | Verbosity (const int ival) |
Sets the verbosity of this module (0 by default=quiet). | |
virtual int | Verbosity () const |
Gets the verbosity of this module. | |
Static Public Member Functions | |
static std::string | getBankBaseName (const std::string &bank_classname) |
static void | deleteSQLStatement (TSQLStatement *stmt) |
clear list of TSQLStatement | |
static void | deleteODBCPreparedStatement (TSQLPreparedStatement *stmt) |
clear list of TSQLStatement | |
static ULong_t | HashPdbCalChan (const PdbCalChan &c) |
Hash the object. | |
Protected Member Functions | |
PgPostBankBackupStorage * | SQLResultSet2BackupStorage (TSQLResultSet *rs, const std::string &table_name) |
Protected Attributes | |
int | verbosity |
The verbosity level. 0 means not verbose at all. | |
std::string | tag |
Definition at line 31 of file PgPostBankBackupManager.h.
View newest version in sPHENIX GitHub at line 31 of file PgPostBankBackupManager.h
typedef std::vector<int> PgPostBankBackupManager::rid_list_t |
list of int
Definition at line 38 of file PgPostBankBackupManager.h.
View newest version in sPHENIX GitHub at line 38 of file PgPostBankBackupManager.h
PgPostBankBackupManager::PgPostBankBackupManager | ( | const std::string & | Tag = "" | ) |
Definition at line 55 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 55 of file PgPostBankBackupManager.cc
References tag.
|
virtual |
Definition at line 69 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 69 of file PgPostBankBackupManager.cc
int PgPostBankBackupManager::CleanTable | ( | const std::string & | bankName, |
const PHTimeStamp & | min_preserve_time = PHTimeStamp::PHFarFuture , |
||
const bool | do_delete = false , |
||
const std::string & | log_file_name = "" |
||
) |
remove records which is NOT used for reconstruction. Records with insert timeafter min_save_time will be preserved
Definition at line 1282 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 1282 of file PgPostBankBackupManager.cc
References assert, TSQLConnection::Commit(), con, TSQLConnection::CreateStatement(), Acts::UnitConstants::e, TSQLStatement::ExecuteQuery(), TSQLStatement::ExecuteUpdate(), PHTimeServer::timer::get(), PHTimeServer::get(), PgPostApplication::getConnection(), TSQLResultSet::GetInt(), TSQLException::GetMessage(), PHTimeStamp::getTics(), PgPostBankBackupLog::Init(), PgPostApplication::instance(), it, PgPostBankBackupLog::kOptDelete, PgPostBankBackupLog::Log(), TSQLResultSet::Next(), out, TSQLConnection::PrepareStatement(), PHTimer::print_stat(), PHTimer::restart(), TSQLPreparedStatement::SetInt(), PHTimer::stop(), tag, and verbosity.
bool PgPostBankBackupManager::commit | ( | PgPostBankBackupStorage * | bs | ) |
Use PgPostBankBackupStorage to restore the original entry in database
[in] | bs | PgPostBankBackupStorage object. This function will not own this object |
Definition at line 417 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 417 of file PgPostBankBackupManager.cc
References assert, TSQLConnection::Commit(), con, PgPostBankBackupStorage::createBank(), deleteODBCPreparedStatement(), Acts::UnitConstants::e, TSQLStatement::ExecuteUpdate(), PgPostBankBackupStorage::get_database_header(), PgPostBankBackupStorage::BankHeader::getBankID(), PgPostApplication::getConnection(), PgPostBankBackupStorage::BankHeader::getDescription(), PgPostBankBackupStorage::BankHeader::getEndValTime(), PgPostBankBackupStorage::BankHeader::getInsertTime(), TSQLException::GetMessage(), PgPostBankBackupStorage::BankHeader::getRId(), PgPostBankBackupStorage::BankHeader::getStartValTime(), PgPostBankBackupStorage::BankHeader::getTableName(), PgPostBankBackupStorage::BankHeader::getUserName(), PgPostApplication::instance(), isRIdExist(), PgPostBankBackupStorage::isValid(), TSQLConnection::PrepareStatement(), TSQLPreparedStatement::SetInt(), TSQLPreparedStatement::SetLong(), TSQLPreparedStatement::SetObject(), TSQLPreparedStatement::SetString(), Verbosity(), and verbosity.
int PgPostBankBackupManager::commitAllBankfromTFile | ( | const std::string & | in_file | ) |
TFile -> Database for official operation use.
Definition at line 527 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 527 of file PgPostBankBackupManager.cc
References assert, TSQLConnection::Commit(), con, PgPostBankBackupStorage::createBank(), Acts::UnitConstants::e, TSQLStatement::ExecuteUpdate(), f, PHTimeServer::timer::get(), PHTimeServer::get(), PgPostBankBackupStorage::get_database_header(), PgPostBankBackupStorage::BankHeader::getBankID(), PgPostApplication::getConnection(), PgPostBankBackupStorage::BankHeader::getDescription(), PgPostBankBackupStorage::BankHeader::getEndValTime(), PgPostBankBackupStorage::BankHeader::getInsertTime(), getListOfRId(), TSQLException::GetMessage(), PgPostBankBackupStorage::BankHeader::getRId(), PgPostBankBackupStorage::BankHeader::getStartValTime(), PgPostBankBackupStorage::BankHeader::getTableName(), PgPostBankBackupStorage::BankHeader::getUserName(), PgPostApplication::instance(), PgPostBankBackupLog::kOptFailed, PgPostBankBackupLog::kOptFile2Db, PgPostBankBackupLog::kOptFile2Db_Skip, next, TSQLConnection::PrepareStatement(), PHTimer::print_stat(), PHTimer::restart(), TSQLPreparedStatement::SetInt(), TSQLPreparedStatement::SetLong(), TSQLPreparedStatement::SetObject(), TSQLPreparedStatement::SetString(), PHTimer::stop(), tag, Verbosity(), and verbosity.
|
static |
clear list of TSQLStatement
Definition at line 113 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 113 of file PgPostBankBackupManager.cc
References assert, con, PgPostApplication::getConnection(), TSQLConnection::GetListOfStatements(), and PgPostApplication::instance().
Referenced by commit().
|
static |
clear list of TSQLStatement
Definition at line 73 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 73 of file PgPostBankBackupManager.cc
References con, PgPostApplication::getConnection(), TSQLConnection::GetListOfStatements(), and PgPostApplication::instance().
Referenced by fetchBank().
void PgPostBankBackupManager::dumpTable | ( | const std::string & | bankName, |
std::ostream & | out | ||
) |
dump databse to text
Definition at line 1166 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 1166 of file PgPostBankBackupManager.cc
References assert, Acts::PhysicalConstants::c, con, TSQLConnection::CreateStatement(), TSQLStatement::ExecuteQuery(), PgPostApplication::getConnection(), PgPostCalBank::getEntry(), TSQLResultSet::GetInt(), PgPostCalBank::getLength(), TSQLResultSet::GetLong(), TSQLResultSet::GetObject(), TSQLResultSet::GetString(), HashPdbCalChan(), i, PgPostBankBackupLog::Init(), PgPostApplication::instance(), PgPostBankBackupLog::kOptDump, PgPostBankBackupLog::Log(), TSQLResultSet::Next(), PdbCalChan::print(), tag, and verbosity.
int PgPostBankBackupManager::fetchAllBank2TFile | ( | const std::string & | bankName, |
const std::string & | record_selection, | ||
const std::string & | out_file_base, | ||
int | splitting_limit = 100000 |
||
) |
Database -> TFile for all all records satisifying record_selection.
Definition at line 854 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 854 of file PgPostBankBackupManager.cc
References assert, con, TSQLConnection::CreateStatement(), TSQLStatement::ExecuteQuery(), f, PHTimeServer::timer::get(), PHTimeServer::get(), PgPostApplication::getConnection(), TSQLResultSet::GetInt(), TSQLResultSet::GetRow(), getTotalRowCount(), PgPostBankBackupLog::Init(), PgPostApplication::instance(), PgPostBankBackupLog::kOptBackup2File, PgPostBankBackupLog::kOptFailed, PgPostBankBackupLog::kOptSuccess, PgPostBankBackupLog::Log(), TSQLResultSet::Next(), PHTimer::print_stat(), PHTimer::restart(), TSQLStatement::SetMaxRows(), SQLResultSet2BackupStorage(), PHTimer::stop(), tag, and verbosity.
PgPostBankBackupStorage * PgPostBankBackupManager::fetchBank | ( | const std::string & | bankName, |
int | rid | ||
) |
Build PgPostBankBackupStorage from one database entry using code should delete the returned object
[in] | bankName | can be bank name (e.g. calib.fvtx.alignment) or pSQL table name (e.g. calibfvtxalignment) |
Build PgPostBankBackupStorage from one database entry using code should delete the returned object
Definition at line 327 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 327 of file PgPostBankBackupManager.cc
References con, TSQLConnection::CreateStatement(), deleteSQLStatement(), TSQLStatement::ExecuteQuery(), PgPostApplication::getConnection(), PgPostApplication::instance(), TSQLResultSet::Next(), SQLResultSet2BackupStorage(), Verbosity(), and verbosity.
Referenced by fetchBank2TFile().
int PgPostBankBackupManager::fetchBank2TFile | ( | const std::string & | bankName, |
const rid_list_t & | rid_list, | ||
const std::string & | out_file | ||
) |
Database -> TFile for official operation use.
Database -> TFile.
Definition at line 799 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 799 of file PgPostBankBackupManager.cc
References f, fetchBank(), PgPostBankBackupStorage::isValid(), it, PgPostBankBackupStorage::Print(), and Verbosity().
|
static |
Definition at line 1039 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 1039 of file PgPostBankBackupManager.cc
References prefix.
Referenced by SQLResultSet2BackupStorage().
PgPostBankBackupManager::rid_list_t PgPostBankBackupManager::getListOfRId | ( | const std::string & | bankName, |
const std::string & | condition = "" |
||
) |
list rid in a bank
Definition at line 1128 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 1128 of file PgPostBankBackupManager.cc
References assert, con, TSQLConnection::CreateStatement(), TSQLStatement::ExecuteQuery(), PgPostApplication::getConnection(), TSQLResultSet::GetInt(), PgPostApplication::instance(), TSQLResultSet::Next(), and verbosity.
Referenced by commitAllBankfromTFile().
int PgPostBankBackupManager::getTotalRowCount | ( | const std::string & | bankName | ) |
total row counts
Definition at line 1099 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 1099 of file PgPostBankBackupManager.cc
References assert, con, TSQLConnection::CreateStatement(), TSQLStatement::ExecuteQuery(), PgPostApplication::getConnection(), TSQLResultSet::GetInt(), PgPostApplication::instance(), TSQLResultSet::Next(), and verbosity.
Referenced by fetchAllBank2TFile().
|
static |
Hash the object.
Definition at line 1262 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 1262 of file PgPostBankBackupManager.cc
References assert, KFPMath::b, and Acts::PhysicalConstants::c.
Referenced by dumpTable().
bool PgPostBankBackupManager::isRIdExist | ( | const std::string & | bankName, |
int | rid | ||
) |
check whether an record with certain rid already there
Definition at line 1070 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 1070 of file PgPostBankBackupManager.cc
References assert, con, TSQLConnection::CreateStatement(), TSQLStatement::ExecuteQuery(), PgPostApplication::getConnection(), PgPostApplication::instance(), TSQLResultSet::Next(), and verbosity.
Referenced by commit().
|
protected |
Definition at line 162 of file PgPostBankBackupManager.cc.
View newest version in sPHENIX GitHub at line 162 of file PgPostBankBackupManager.cc
References assert, PHObject::Clone(), PdbClassMap< T >::end(), PdbClassMap< T >::find(), PgPostBankBackupStorage::format_name_title(), PgPostBankBackupStorage::get_database_header(), PgPostBankBackupStorage::get_obj_header(), getBankBaseName(), TSQLResultSet::GetInt(), PdbCalBank::getLength(), TSQLResultSet::GetLong(), TSQLResultSet::GetObject(), TSQLResultSet::GetRow(), TSQLResultSet::GetString(), PdbClassMap< T >::instance(), G4PLUGDOOR::length, PgPostBankBackupStorage::BankHeader::Print(), PgPostBankBackupStorage::set_obj_info(), PgPostBankBackupStorage::BankHeader::setBankID(), PgPostBankBackupStorage::BankHeader::setDescription(), PgPostBankBackupStorage::BankHeader::setEndValTime(), PgPostBankBackupStorage::BankHeader::setInsertTime(), PgPostBankBackupStorage::BankHeader::setRId(), PgPostBankBackupStorage::BankHeader::setStartValTime(), PgPostBankBackupStorage::BankHeader::setTableName(), PgPostBankBackupStorage::BankHeader::setUserName(), and verbosity.
Referenced by fetchAllBank2TFile(), and fetchBank().
|
inlinevirtual |
Sets the verbosity of this module (0 by default=quiet).
Definition at line 89 of file PgPostBankBackupManager.h.
View newest version in sPHENIX GitHub at line 89 of file PgPostBankBackupManager.h
References verbosity.
|
inlinevirtual |
Gets the verbosity of this module.
Definition at line 96 of file PgPostBankBackupManager.h.
View newest version in sPHENIX GitHub at line 96 of file PgPostBankBackupManager.h
References verbosity.
Referenced by commit(), commitAllBankfromTFile(), fetchBank(), and fetchBank2TFile().
|
protected |
Definition at line 123 of file PgPostBankBackupManager.h.
View newest version in sPHENIX GitHub at line 123 of file PgPostBankBackupManager.h
Referenced by CleanTable(), commitAllBankfromTFile(), dumpTable(), fetchAllBank2TFile(), and PgPostBankBackupManager().
|
protected |
The verbosity level. 0 means not verbose at all.
Definition at line 121 of file PgPostBankBackupManager.h.
View newest version in sPHENIX GitHub at line 121 of file PgPostBankBackupManager.h
Referenced by CleanTable(), commit(), commitAllBankfromTFile(), dumpTable(), fetchAllBank2TFile(), fetchBank(), getListOfRId(), getTotalRowCount(), isRIdExist(), SQLResultSet2BackupStorage(), and Verbosity().