![]() |
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, std::map< std::string, std::string > *headers=nullptr) |
| retrieve an object of type T from CCDB as stored under path and timestamp. Optional to get the headers. | |
| 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(), std::map< std::string, std::string > *headers=nullptr) |
| 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 const &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 | |
| CcdbApi & | getCCDBAccessor () |
| 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 48 of file BasicCCDBManager.h.
| using o2::ccdb::CCDBManagerInstance::MD = std::map<std::string, std::string> |
Definition at line 82 of file BasicCCDBManager.h.
|
inline |
Definition at line 84 of file BasicCCDBManager.h.
|
inline |
clear all entries in the cache
Definition at line 144 of file BasicCCDBManager.h.
|
inline |
clear particular entry in the cache
Definition at line 147 of file BasicCCDBManager.h.
| void o2::ccdb::CCDBManagerInstance::endOfStream | ( | ) |
Definition at line 133 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 133 of file BasicCCDBManager.h.
|
inline |
Definition at line 139 of file BasicCCDBManager.h.
|
inline |
get the object upper validity limit
Definition at line 180 of file BasicCCDBManager.h.
|
inline |
get the object upper validity limit
Definition at line 189 of file BasicCCDBManager.h.
|
inline |
get the fatalWhenNull state
Definition at line 195 of file BasicCCDBManager.h.
|
inline |
Definition at line 209 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 356 of file BasicCCDBManager.h.
| T * o2::ccdb::CCDBManagerInstance::getForTimeStamp | ( | std::string const & | path, |
| long | timestamp, | ||
| std::map< std::string, std::string > * | headers = nullptr |
||
| ) |
retrieve an object of type T from CCDB as stored under path and timestamp. Optional to get the headers.
Definition at line 240 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 80 of file BasicCCDBManager.cxx.
|
static |
Definition at line 70 of file BasicCCDBManager.cxx.
|
inline |
retrieve an object of type T from CCDB as stored under path, timestamp and metaData
Definition at line 116 of file BasicCCDBManager.h.
| T * o2::ccdb::CCDBManagerInstance::getSpecificForRun | ( | std::string const & | path, |
| int | runNumber, | ||
| MD const & | 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 364 of file BasicCCDBManager.h.
| std::string o2::ccdb::CCDBManagerInstance::getSummaryString | ( | ) | const |
Definition at line 102 of file BasicCCDBManager.cxx.
|
inline |
query timestamp
Definition at line 104 of file BasicCCDBManager.h.
|
inline |
query current URL
Definition at line 101 of file BasicCCDBManager.h.
|
inline |
Check if an object in cache is valid.
Definition at line 162 of file BasicCCDBManager.h.
|
inline |
check if caching is enabled
Definition at line 150 of file BasicCCDBManager.h.
|
inline |
Definition at line 141 of file BasicCCDBManager.h.
|
inline |
check if checks of object validity before CCDB query is enabled
Definition at line 171 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 129 of file BasicCCDBManager.h.
| void o2::ccdb::CCDBManagerInstance::report | ( | bool | longrep = false | ) |
Definition at line 122 of file BasicCCDBManager.cxx.
|
inline |
reset the object upper validity limit
Definition at line 183 of file BasicCCDBManager.h.
|
inline |
reset the object upper validity limit
Definition at line 192 of file BasicCCDBManager.h.
|
inline |
disable or enable caching
Definition at line 153 of file BasicCCDBManager.h.
set the object upper validity limit
Definition at line 177 of file BasicCCDBManager.h.
set the object upper validity limit
Definition at line 186 of file BasicCCDBManager.h.
|
inline |
set the fatal property (when false; nullptr object responses will not abort)
Definition at line 197 of file BasicCCDBManager.h.
|
inline |
set the flag to check object validity before CCDB query
Definition at line 174 of file BasicCCDBManager.h.
set timestamp cache for all queries
Definition at line 93 of file BasicCCDBManager.h.
| void o2::ccdb::CCDBManagerInstance::setURL | ( | const std::string & | url | ) |
set a URL to query from
Definition at line 27 of file BasicCCDBManager.cxx.