![]() |
Project
|
#include <BasicCCDBManager.h>
Inherited by o2::ccdb::BasicCCDBManager.
Public Types | |
using | MD = std::map< std::string, std::string > |
Public Member Functions | |
CCDBManagerInstance (std::string const &path) | |
void | setURL (const std::string &url) |
set a URL to query from | |
void | setTimestamp (long t) |
set timestamp cache for all queries | |
std::string const & | getURL () const |
query current URL | |
long | getTimestamp () const |
query timestamp | |
template<typename T > | |
T * | getForTimeStamp (std::string const &path, long timestamp) |
retrieve an object of type T from CCDB as stored under path and timestamp | |
template<typename T > | |
T * | getForRun (std::string const &path, int runNumber, bool setRunMetadata=false) |
retrieve an object of type T from CCDB as stored under path and using the timestamp in the middle of the run | |
template<typename T > | |
T * | getSpecific (std::string const &path, long timestamp=-1, MD metaData=MD()) |
retrieve an object of type T from CCDB as stored under path, timestamp and metaData | |
template<typename T > | |
T * | getSpecificForRun (std::string const &path, int runNumber, MD metaData=MD()) |
retrieve an object of type T from CCDB as stored under path and using the timestamp in the middle of the run + metadata. The run number is provided separately to conform to typical analysis use (in which case metadata does not include runNumber) | |
bool | isOnline () const |
detect online processing modes (i.e. CCDB objects may be updated in the lifetime of the manager) | |
template<typename T > | |
T * | get (std::string const &path) |
retrieve an object of type T from CCDB as stored under path; will use the timestamp member | |
bool | isHostReachable () const |
void | clearCache () |
clear all entries in the cache | |
void | clearCache (std::string const &path) |
clear particular entry in the cache | |
bool | isCachingEnabled () const |
check if caching is enabled | |
void | setCaching (bool v) |
disable or enable caching | |
bool | isCachedObjectValid (std::string const &path, long timestamp) |
Check if an object in cache is valid. | |
bool | isLocalObjectValidityCheckingEnabled () const |
check if checks of object validity before CCDB query is enabled | |
void | setLocalObjectValidityChecking (bool v=true) |
set the flag to check object validity before CCDB query | |
void | setCreatedNotAfter (long v) |
set the object upper validity limit | |
long | getCreatedNotAfter () const |
get the object upper validity limit | |
void | resetCreatedNotAfter () |
reset the object upper validity limit | |
void | setCreatedNotBefore (long v) |
set the object upper validity limit | |
long | getCreatedNotBefore () const |
get the object upper validity limit | |
void | resetCreatedNotBefore () |
reset the object upper validity limit | |
bool | getFatalWhenNull () const |
get the fatalWhenNull state | |
void | setFatalWhenNull (bool b) |
set the fatal property (when false; nullptr object responses will not abort) | |
std::pair< int64_t, int64_t > | getRunDuration (int runnumber, bool fatal=true) |
std::string | getSummaryString () const |
size_t | getFetchedSize () const |
void | report (bool longrep=false) |
void | endOfStream () |
Static Public Member Functions | |
static std::pair< int64_t, int64_t > | getRunDuration (o2::ccdb::CcdbApi const &api, int runnumber, bool fatal=true) |
static std::pair< int64_t, int64_t > | getRunDuration (const MD &headers) |
A simple class offering simplified access to CCDB (mainly for MC simulation) The class encapsulates timestamp and URL and is easily usable from detector code.
The CDBManager allowing caching of retrieved objects is by definition not thread safe, therefore, to provide a possibility of multithread processing, one should foresee possibility of multiple instances of the manager. CCDBManagerInstance serves to this purpose
In cases where caching is not needed or just 1 instance of the manager is enough, one case use a singleton version BasicCCDBManager
Definition at line 45 of file BasicCCDBManager.h.
using o2::ccdb::CCDBManagerInstance::MD = std::map<std::string, std::string> |
Definition at line 77 of file BasicCCDBManager.h.
|
inline |
Definition at line 79 of file BasicCCDBManager.h.
|
inline |
clear all entries in the cache
Definition at line 135 of file BasicCCDBManager.h.
|
inline |
clear particular entry in the cache
Definition at line 138 of file BasicCCDBManager.h.
void o2::ccdb::CCDBManagerInstance::endOfStream | ( | ) |
Definition at line 131 of file BasicCCDBManager.cxx.
|
inline |
retrieve an object of type T from CCDB as stored under path; will use the timestamp member
Definition at line 127 of file BasicCCDBManager.h.
|
inline |
get the object upper validity limit
Definition at line 171 of file BasicCCDBManager.h.
|
inline |
get the object upper validity limit
Definition at line 180 of file BasicCCDBManager.h.
|
inline |
get the fatalWhenNull state
Definition at line 186 of file BasicCCDBManager.h.
|
inline |
Definition at line 200 of file BasicCCDBManager.h.
T * o2::ccdb::CCDBManagerInstance::getForRun | ( | std::string const & | path, |
int | runNumber, | ||
bool | setRunMetadata = false |
||
) |
retrieve an object of type T from CCDB as stored under path and using the timestamp in the middle of the run
Definition at line 323 of file BasicCCDBManager.h.
T * o2::ccdb::CCDBManagerInstance::getForTimeStamp | ( | std::string const & | path, |
long | timestamp | ||
) |
retrieve an object of type T from CCDB as stored under path and timestamp
Definition at line 231 of file BasicCCDBManager.h.
|
static |
std::pair< int64_t, int64_t > o2::ccdb::CCDBManagerInstance::getRunDuration | ( | int | runnumber, |
bool | fatal = true |
||
) |
A convenience function for MC to fetch valid start and end timestamps for recorded TF data given an ALICE run number. In absence of STF/ETF fields in the RCT with fall back to CTP SOX/EOX then to ECS SOR/EOR. On error it fatals (if fatal == true) or else returns the pair -1, -1.
Definition at line 78 of file BasicCCDBManager.cxx.
|
static |
Definition at line 68 of file BasicCCDBManager.cxx.
|
inline |
retrieve an object of type T from CCDB as stored under path, timestamp and metaData
Definition at line 111 of file BasicCCDBManager.h.
T * o2::ccdb::CCDBManagerInstance::getSpecificForRun | ( | std::string const & | path, |
int | runNumber, | ||
MD | metaData = MD() |
||
) |
retrieve an object of type T from CCDB as stored under path and using the timestamp in the middle of the run + metadata. The run number is provided separately to conform to typical analysis use (in which case metadata does not include runNumber)
Definition at line 331 of file BasicCCDBManager.h.
std::string o2::ccdb::CCDBManagerInstance::getSummaryString | ( | ) | const |
Definition at line 100 of file BasicCCDBManager.cxx.
|
inline |
query timestamp
Definition at line 99 of file BasicCCDBManager.h.
|
inline |
query current URL
Definition at line 96 of file BasicCCDBManager.h.
|
inline |
Check if an object in cache is valid.
Definition at line 153 of file BasicCCDBManager.h.
|
inline |
check if caching is enabled
Definition at line 141 of file BasicCCDBManager.h.
|
inline |
Definition at line 132 of file BasicCCDBManager.h.
|
inline |
check if checks of object validity before CCDB query is enabled
Definition at line 162 of file BasicCCDBManager.h.
|
inline |
detect online processing modes (i.e. CCDB objects may be updated in the lifetime of the manager)
Definition at line 123 of file BasicCCDBManager.h.
void o2::ccdb::CCDBManagerInstance::report | ( | bool | longrep = false | ) |
Definition at line 120 of file BasicCCDBManager.cxx.
|
inline |
reset the object upper validity limit
Definition at line 174 of file BasicCCDBManager.h.
|
inline |
reset the object upper validity limit
Definition at line 183 of file BasicCCDBManager.h.
|
inline |
disable or enable caching
Definition at line 144 of file BasicCCDBManager.h.
set the object upper validity limit
Definition at line 168 of file BasicCCDBManager.h.
set the object upper validity limit
Definition at line 177 of file BasicCCDBManager.h.
|
inline |
set the fatal property (when false; nullptr object responses will not abort)
Definition at line 188 of file BasicCCDBManager.h.
|
inline |
set the flag to check object validity before CCDB query
Definition at line 165 of file BasicCCDBManager.h.
set timestamp cache for all queries
Definition at line 88 of file BasicCCDBManager.h.
void o2::ccdb::CCDBManagerInstance::setURL | ( | const std::string & | url | ) |
set a URL to query from
Definition at line 25 of file BasicCCDBManager.cxx.