ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
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
|
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 G4InuclParticleNames::ap, e, g4zmq::exit(), flog(), PHTimeServer::timer::get(), PHTimeServer::get(), PgPostApplication::getConnection(), PHTimeStamp::getTics(), PgPostBankBackupLog::Init(), PgPostApplication::instance(), it, PgPostBankBackupLog::kOptDelete, PgPostBankBackupLog::Log(), PHTimer::print_stat(), PHTimer::restart(), PHTimer::stop(), 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 G4InuclParticleNames::ap, PgPostBankBackupStorage::createBank(), deleteODBCPreparedStatement(), e, g4zmq::exit(), PgPostBankBackupStorage::get_database_header(), PgPostBankBackupStorage::BankHeader::getBankID(), PgPostApplication::getConnection(), PgPostBankBackupStorage::BankHeader::getDescription(), PgPostBankBackupStorage::BankHeader::getEndValTime(), PgPostBankBackupStorage::BankHeader::getInsertTime(), PgPostBankBackupStorage::BankHeader::getRId(), PgPostBankBackupStorage::BankHeader::getStartValTime(), PgPostBankBackupStorage::BankHeader::getTableName(), PgPostBankBackupStorage::BankHeader::getUserName(), PgPostApplication::instance(), isRIdExist(), PgPostBankBackupStorage::isValid(), 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 G4InuclParticleNames::ap, PgPostBankBackupStorage::createBank(), e, g4zmq::exit(), 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(), PgPostBankBackupStorage::BankHeader::getRId(), PgPostBankBackupStorage::BankHeader::getStartValTime(), PgPostBankBackupStorage::BankHeader::getTableName(), PgPostBankBackupStorage::BankHeader::getUserName(), PgPostApplication::instance(), PgPostBankBackupLog::kOptFailed, PgPostBankBackupLog::kOptFile2Db, PgPostBankBackupLog::kOptFile2Db_Skip, PHTimer::print_stat(), PHTimer::restart(), 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 G4InuclParticleNames::ap, g4zmq::exit(), PgPostApplication::getConnection(), 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 G4InuclParticleNames::ap, g4zmq::exit(), PgPostApplication::getConnection(), 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 G4InuclParticleNames::ap, c, g4zmq::exit(), PgPostApplication::getConnection(), PgPostCalBank::getEntry(), PgPostCalBank::getLength(), HashPdbCalChan(), PgPostBankBackupLog::Init(), PgPostApplication::instance(), PgPostBankBackupLog::kOptDump, PgPostBankBackupLog::Log(), PdbCalChan::print(), 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 G4InuclParticleNames::ap, g4zmq::exit(), f, PHTimeServer::timer::get(), PHTimeServer::get(), PgPostApplication::getConnection(), getTotalRowCount(), PgPostBankBackupLog::Init(), PgPostApplication::instance(), PgPostBankBackupLog::kOptBackup2File, PgPostBankBackupLog::kOptFailed, PgPostBankBackupLog::kOptSuccess, PgPostBankBackupLog::Log(), PHTimer::print_stat(), PHTimer::restart(), SQLResultSet2BackupStorage(), PHTimer::stop(), 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 G4InuclParticleNames::ap, deleteSQLStatement(), g4zmq::exit(), PgPostApplication::getConnection(), PgPostApplication::instance(), 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
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 G4InuclParticleNames::ap, PgPostApplication::getConnection(), PgPostApplication::instance(), 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 G4InuclParticleNames::ap, PgPostApplication::getConnection(), PgPostApplication::instance(), 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
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 G4InuclParticleNames::ap, PgPostApplication::getConnection(), PgPostApplication::instance(), 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 PHObject::Clone(), PdbClassMap< T >::end(), g4zmq::exit(), PdbClassMap< T >::find(), PgPostBankBackupStorage::format_name_title(), PgPostBankBackupStorage::get_database_header(), PgPostBankBackupStorage::get_obj_header(), getBankBaseName(), PdbCalBank::getLength(), PdbClassMap< T >::instance(), BTOF::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().
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 commitAllBankfromTFile().
|
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().