|
ATLAS Offline Software
|
#include <IOVDbFolder.h>
|
| IOVDbFolder (IOVDbConn *conn, const IOVDbParser &folderprop, MsgStream &msg, IClassIDSvc *clidsvc, IIOVDbMetaDataTool *metadatatool, const bool checklock, const bool outputToFile=false, const std::string &source="COOL_DATABASE", const bool crestToFile=false, const std::string &crestServer="", const std::string &crestTag="", const bool crestCoolToFile=false) |
|
| ~IOVDbFolder () |
|
const std::string & | folderName () const |
|
const std::string & | key () const |
|
IOVDbConn * | conn () |
|
bool | multiVersion () const |
|
bool | timeStamp () const |
|
bool | tagOverride () const |
|
bool | retrieved () const |
|
bool | noOverride () const |
|
IOVDbNamespace::FolderType | folderType () const |
|
bool | readMeta () const |
|
bool | writeMeta () const |
|
bool | fromMetaDataOnly () const |
|
bool | extensible () const |
|
bool | dropped () const |
|
bool | iovOverridden () const |
|
const std::string & | joTag () const |
|
const std::string & | resolvedTag () const |
|
const std::string & | eventStore () const |
|
CLID | clid () const |
|
unsigned long long | bytesRead () const |
|
float | readTime () const |
|
const IOVRange & | currentRange () const |
|
void | useFileMetaData () |
|
void | setFolderDescription (const std::string &description) |
|
void | setTagOverride (const std::string &tag, const bool setFlag) |
|
void | setWriteMeta () |
|
void | setIOVOverride (const unsigned int run, const unsigned int lumiblock, const unsigned int time) |
|
void | setDropped (const bool dropped) |
|
cool::ValidityKey | iovTime (const IOVTime &reftime) const |
|
bool | cacheValid (const cool::ValidityKey reftime) const |
|
bool | loadCache (const cool::ValidityKey vkey, const unsigned int cacheDiv, const std::string &globalTag, const bool ignoreMissChan) |
|
void | resetCache () |
|
bool | getAddress (const cool::ValidityKey reftime, IAddressCreator *persSvc, const unsigned int poolSvcContext, std::unique_ptr< IOpaqueAddress > &address, IOVRange &range, bool &poolPayloadRequested) |
|
void | summary () |
|
std::unique_ptr< SG::TransientAddress > | preLoadFolder (ITagInfoMgr *tagInfoMgr, const unsigned int cacheRun, const unsigned int cacheTime) |
|
void | printCache () |
|
bool | loadCacheIfDbChanged (const cool::ValidityKey vkey, const std::string &globalTag, const cool::IDatabasePtr &dbPtr, const ServiceHandle< IIOVSvc > &iovSvc) |
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
void | clearCache () |
|
bool | resolveTag (const cool::IFolderPtr &fptr, const std::string &globalTag) |
|
bool | magicTag (std::string &tag) |
|
bool | addMetaAttrList (const coral::AttributeList &atrlist, const IOVRange &range) |
|
bool | addMetaAttrListColl (const CondAttrListCollection *coll) |
|
void | setSharedSpec (const coral::AttributeList &atrlist) |
|
void | addIOVtoCache (cool::ValidityKey since, cool::ValidityKey until) |
|
bool | overrideOptionsFromParsedDescription (const IOVDbParser &parsedDescription) |
|
std::unique_ptr< SG::TransientAddress > | createTransientAddress (const std::vector< std::string > &symlinks) |
|
void | setCacheLength (const bool timeIs_nsOfEpoch, const unsigned int cacheRun, const unsigned int cacheTime) |
|
template<class T > |
unsigned int | cacheUpdateImplementation (T &obj, const ServiceHandle< IIOVSvc > &iovSvc) |
|
bool | objectIteratorIsValid (cool::IObjectIteratorPtr &objItr) |
|
bool | objectIteratorIsValid (CoraCoolObjectIterPtr &objItr) |
|
void | specialCacheUpdate (CoraCoolObject &obj, const ServiceHandle< IIOVSvc > &iovSvc) |
|
void | specialCacheUpdate (const cool::IObject &obj, const ServiceHandle< IIOVSvc > &iovSvc) |
|
std::vector< IOVHash > | fetchCrestIOVs (cool::ValidityKey since, cool::ValidityKey until) |
|
std::vector< IOVDbNamespace::BasicFolder > | fetchCrestObjects (cool::ValidityKey since, cool::ValidityKey until, bool vectorPayloadFlag, cool::ValidityKey vkey, const std::string &nodeDesc) |
|
void | dumpFile (const std::string &dumpName, const cool::ValidityKey &vkey, IOVDbNamespace::Cool2Json *json, bool skipCoolIoV, IOVDbNamespace::BasicFolder *basicFolder, const std::string &crestNodeDescr, const std::string &specString) const |
|
void | initMessaging () const |
| Initialize our message level and MessageSvc. More...
|
|
Definition at line 52 of file IOVDbFolder.h.
◆ ChanRange
◆ IOV2Index
◆ IOVHash
◆ IOVDbFolder()
IOVDbFolder::IOVDbFolder |
( |
IOVDbConn * |
conn, |
|
|
const IOVDbParser & |
folderprop, |
|
|
MsgStream & |
msg, |
|
|
IClassIDSvc * |
clidsvc, |
|
|
IIOVDbMetaDataTool * |
metadatatool, |
|
|
const bool |
checklock, |
|
|
const bool |
outputToFile = false , |
|
|
const std::string & |
source = "COOL_DATABASE" , |
|
|
const bool |
crestToFile = false , |
|
|
const std::string & |
crestServer = "" , |
|
|
const std::string & |
crestTag = "" , |
|
|
const bool |
crestCoolToFile = false |
|
) |
| |
Definition at line 71 of file IOVDbFolder.cxx.
117 std::string chanspec;
118 if (folderprop.
getKey(
"channelSelection",
"",chanspec) && !chanspec.empty()) {
119 m_chanrange=IOVDbNamespace::parseChannelSpec<cool::ChannelId>(chanspec);
127 m_chansel = cool::ChannelSelection(
i.first,
i.second);
132 }
catch (cool::Exception&
e) {
133 ATH_MSG_ERROR(
"defining channel range (must be given in ascending order)");
◆ ~IOVDbFolder()
IOVDbFolder::~IOVDbFolder |
( |
| ) |
|
◆ addIOVtoCache()
void IOVDbFolder::addIOVtoCache |
( |
cool::ValidityKey |
since, |
|
|
cool::ValidityKey |
until |
|
) |
| |
|
private |
◆ addMetaAttrList()
bool IOVDbFolder::addMetaAttrList |
( |
const coral::AttributeList & |
atrlist, |
|
|
const IOVRange & |
range |
|
) |
| |
|
private |
◆ addMetaAttrListColl()
◆ bytesRead()
unsigned long long IOVDbFolder::bytesRead |
( |
| ) |
const |
|
inline |
◆ cacheUpdateImplementation()
Definition at line 177 of file IOVDbFolder.h.
178 const auto & objSince =
obj.since();
179 const auto & objUntil =
obj.until();
180 const auto & objChannel =
obj.channelId();
181 ATH_MSG_DEBUG(
"from DB \t chID: "<<objChannel<<
"\tobjstart:\t"<<objSince<<
"\t objstop: \t"
195 if ((
iov.first < objSince) and (objSince <
iov.second)){
199 ATH_MSG_DEBUG(
"special reload needed on THIS ONE !!!!!!!!!!!");
206 if ( (objSince>=
iov.first and objSince<
iov.second) or (objUntil>
iov.first and objUntil<=
iov.second) ) covered=
true;
◆ cacheValid()
bool IOVDbFolder::cacheValid |
( |
const cool::ValidityKey |
reftime | ) |
const |
|
inline |
Definition at line 387 of file IOVDbFolder.h.
390 return ((reftime>cacheStart) and (reftime<cacheStop));
◆ clearCache()
void IOVDbFolder::clearCache |
( |
| ) |
|
|
private |
◆ clid()
CLID IOVDbFolder::clid |
( |
| ) |
const |
|
inline |
◆ conn()
◆ createTransientAddress()
Definition at line 872 of file IOVDbFolder.cxx.
873 auto tad = std::make_unique<SG::TransientAddress>(
m_clid,
m_key);
875 for (
const auto & linkname:symlinks){
876 if (not linkname.empty()) {
878 if (StatusCode::SUCCESS==
p_clidSvc->getIDOfTypeName(linkname,sclid)) {
879 tad->setTransientID(sclid);
882 ATH_MSG_ERROR(
"Could not get clid for symlink: "<< linkname );
◆ currentRange()
◆ dropped()
bool IOVDbFolder::dropped |
( |
| ) |
const |
|
inline |
◆ dumpFile()
Definition at line 1207 of file IOVDbFolder.cxx.
1216 std::string fMain(dumpName);
1219 std::filesystem::create_directory(fMain);
1221 if (not
myFile.is_open()) {
1222 std::string errorMessage{
"File creation for "+fabricatedName+
" failed."};
1224 throw std::runtime_error(errorMessage);
1233 myFile<<
json->description()<<s_delimiterJson<<std::endl;
1234 myFile<<
json->payloadSpec()<<s_delimiterJson<<std::endl;
1236 myFile<<
json->iov()<<s_delimiterJson<<std::endl;
1242 std::string newNodeDescription = std::regex_replace(crestNodeDescr,
std::regex(
"\""),
"\\\"");
1243 std::string newSpecString = std::regex_replace(specString,
std::regex(
":"),
": ");
1244 newSpecString = std::regex_replace(newSpecString,
std::regex(
","), s_delimiterJson);
1245 myFile<<
"\"node_description\" : \""<<newNodeDescription<<
'\"'<<s_delimiterJson<<std::endl;
1246 myFile<<
"\"folder_payloadspec\": \""<<newSpecString<<
'\"'<<s_delimiterJson<<std::endl;
◆ eventStore()
const std::string & IOVDbFolder::eventStore |
( |
| ) |
const |
|
inline |
◆ extensible()
bool IOVDbFolder::extensible |
( |
| ) |
const |
|
inline |
◆ fetchCrestIOVs()
std::vector< IOVDbFolder::IOVHash > IOVDbFolder::fetchCrestIOVs |
( |
cool::ValidityKey |
since, |
|
|
cool::ValidityKey |
until |
|
) |
| |
|
private |
Definition at line 1172 of file IOVDbFolder.cxx.
1174 std::vector<IOVHash>
result;
1178 if(crestIOVs.empty()){
1182 std::vector<IOV2Index> iov2IndexVect;
1183 iov2IndexVect.reserve(crestIOVs.size());
1185 for(
const auto& crestIOV : crestIOVs) {
1186 iov2IndexVect.emplace_back(std::stoull(crestIOV.first),hashInd++);
1189 size_t nIOVs = iov2IndexVect.size();
1200 , cool::ValidityKeyMax)
◆ fetchCrestObjects()
std::vector< BasicFolder > IOVDbFolder::fetchCrestObjects |
( |
cool::ValidityKey |
since, |
|
|
cool::ValidityKey |
until, |
|
|
bool |
vectorPayloadFlag, |
|
|
cool::ValidityKey |
vkey, |
|
|
const std::string & |
nodeDesc |
|
) |
| |
|
private |
Definition at line 1252 of file IOVDbFolder.cxx.
1259 std::string crestPayloadType=
"crest-json-single-iov";
1261 if(tagProperties!=
nullptr
1262 && tagProperties.contains(
"payloadSpec")) {
1263 crestPayloadType=tagProperties[
"payloadSpec"].get<std::string>();
1266 if(crestPayloadType.compare(
"crest-json-multi-iov")==0) {
1352 std::string errorMessage =
m_foldername +
": has multi-iov payload. Folders with multi-iov payloads currently not supported!";
1354 throw std::runtime_error{errorMessage};
1357 if (specString.empty()) {
1358 std::string errorMessage =
"Reading payload spec from " +
m_foldername +
" failed.";
1360 throw std::runtime_error{errorMessage};
1363 std::vector<BasicFolder> retVector;
1368 if(iovHashVect.empty() ||
until<=iovHashVect[0].first.first) {
1369 if(iovHashVect.empty()) {
1377 retVector.push_back(basicFolder);
1381 unsigned indIOVStart = 0;
1382 for(
const auto& iovhash : iovHashVect) {
1383 if(
since < iovhash.first.first)
break;
1384 if(
since < iovhash.first.second
1385 &&
since >= iovhash.first.first) {
1390 unsigned indIOVEnd = indIOVStart;
1391 while(indIOVEnd < iovHashVect.size()) {
1392 if(iovHashVect[indIOVEnd].
first.first <
until
1393 && iovHashVect[indIOVEnd].first.second >=
until) {
1399 for(
unsigned ind = indIOVStart;
ind <= indIOVEnd; ++
ind) {
1403 unsigned long long sinceT = iovHashVect[
ind].first.first;
1405 std::string crest_work_dir=std::filesystem::current_path();
1406 crest_work_dir +=
"/crest_data";
1407 bool crest_rewrite =
true;
1412 {
"description",
"none"},
1413 {
"endOfValidity", 0},
1414 {
"lastValidatedTime", 0},
1416 {
"payloadSpec",
"none"},
1417 {
"synchronization",
"none"},
1418 {
"timeType",
"time"}};
1438 {
"streamerInfo",
"none"}
1442 jResources.push_back(elem);
1447 {
"datatype",
"data"},
1448 {
"format",
"StoreSetDto"},
1449 {
"resources", jResources}
1467 std::istringstream
ss(reply);
1469 if (basicFolder.
empty()){
1470 std::string errorMessage =
"Reading channel data from "+
m_foldername+
" failed.";
1472 throw std::runtime_error{errorMessage};
1476 dumpFile(
"crest_dump",vkey,
nullptr,
false,&basicFolder,nodeDesc,specString);
1479 retVector.push_back(basicFolder);
◆ folderName()
const std::string & IOVDbFolder::folderName |
( |
| ) |
const |
|
inline |
◆ folderType()
◆ fromMetaDataOnly()
bool IOVDbFolder::fromMetaDataOnly |
( |
| ) |
const |
|
inline |
◆ getAddress()
bool IOVDbFolder::getAddress |
( |
const cool::ValidityKey |
reftime, |
|
|
IAddressCreator * |
persSvc, |
|
|
const unsigned int |
poolSvcContext, |
|
|
std::unique_ptr< IOpaqueAddress > & |
address, |
|
|
IOVRange & |
range, |
|
|
bool & |
poolPayloadRequested |
|
) |
| |
Definition at line 632 of file IOVDbFolder.cxx.
640 std::string strAddress;
644 cool::ValidityKey naystart=0;
645 cool::ValidityKey naystop=cool::ValidityKeyMax;
649 if (not readFromMetaData.isValid()){
655 m_nobjread+=readFromMetaData.numberOfObjects();
656 poolPayloadReq=readFromMetaData.poolPayloadRequested();
657 strAddress = readFromMetaData.stringAddress();
658 range = readFromMetaData.range();
659 attrList = readFromMetaData.attributeList();
660 attrListColl = readFromMetaData.attrListCollection();
679 if (thisIov.first<=reftime && reftime<thisIov.second) {
685 strAddress=
"POOLContainer_AthenaAttributeList][CLID=x";
703 ATH_MSG_ERROR(
"Writing of CoraCool folders to file metadata not implemented");
710 }
else if (thisIov.second<=reftime && thisIov.second>naystart) {
711 naystart=thisIov.second;
712 }
else if (thisIov.first>reftime && thisIov.first<naystop) {
713 naystop=thisIov.first;
720 std::vector<std::string>::const_iterator nitr=
m_channames.begin();
721 for (std::vector<cool::ChannelId>::const_iterator chitr=
m_channums.begin();
723 attrListColl->
add(*chitr,*nitr);
728 strAddress=
"POOLContainer_CondAttrListCollection][CLID=x";
731 strAddress=
"POOLContainer_CondAttrListVec][CLID=x";
735 ATH_MSG_ERROR(
"COOL object not found in single-channel retrieve, folder "
740 " valid objects found for single-channel retrieve, folder " <<
746 <<
" at IOV " << reftime <<
" channels " << nobj <<
" has range "
751 IOVTime rstart=
range.start();
752 IOVTime rstop=
range.stop();
753 if (tnaystart > rstart || rstop > tnaystop) {
755 <<
" from [" << rstart <<
":" << rstop <<
"] to ["
756 << tnaystart <<
":" << tnaystop <<
"]" );
757 if (tnaystart > rstart) rstart=tnaystart;
758 if (tnaystop < rstop) rstop=tnaystop;
759 range=IOVRange(rstart,rstop);
777 IOpaqueAddress* addrp =
nullptr;
778 if (StatusCode::SUCCESS!=persSvc->createAddress(0,0,strAddress,addrp)) {
779 ATH_MSG_ERROR(
"Could not get IOpaqueAddress from string address "<< strAddress );
782 address = std::unique_ptr<IOpaqueAddress>(addrp);
783 GenericAddress* gAddr=
dynamic_cast<GenericAddress*
>(
address.get());
785 ATH_MSG_ERROR(
"Could not cast IOpaqueAddress to GenericAddress");
790 auto addr = std::make_unique<CondAttrListCollAddress>(*gAddr);
791 addr->setAttrListColl(attrListColl);
794 auto addr = std::make_unique<CondAttrListCollAddress>(gAddr->svcType(),
795 gAddr->clID(),gAddr->par()[0],gAddr->par()[1],
796 poolSvcContext,gAddr->ipar()[1]);
798 addr->setAttrListColl(attrListColl);
803 auto addr = std::make_unique<AthenaAttrListAddress>(*gAddr);
804 addr->setAttrList(attrList);
807 auto addr = std::make_unique<CondAttrListVecAddress>(*gAddr);
808 addr->setAttrListVec(attrListVec);
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ iovOverridden()
bool IOVDbFolder::iovOverridden |
( |
| ) |
const |
|
inline |
◆ iovTime()
cool::ValidityKey IOVDbFolder::iovTime |
( |
const IOVTime & |
reftime | ) |
const |
◆ joTag()
const std::string & IOVDbFolder::joTag |
( |
| ) |
const |
|
inline |
◆ key()
const std::string & IOVDbFolder::key |
( |
| ) |
const |
|
inline |
◆ loadCache()
bool IOVDbFolder::loadCache |
( |
const cool::ValidityKey |
vkey, |
|
|
const unsigned int |
cacheDiv, |
|
|
const std::string & |
globalTag, |
|
|
const bool |
ignoreMissChan |
|
) |
| |
Definition at line 224 of file IOVDbFolder.cxx.
234 TStopwatch cachetimer;
237 bool vectorPayload{};
238 std::string strCrestNodeDesc;
247 vectorPayload = (strCrestNodeDesc.find(
"CondAttrListVec") != std::string::npos);
266 if (cacheq>0) changedCacheLo=vkey - vkey % cacheq;
272 changedCacheLo=vkey & (0x7FFFFFFFLL << 32);
278 if (changedCacheHi>cool::ValidityKeyMax) changedCacheHi=cool::ValidityKeyMax;
309 bool retrievedone=
false;
318 unsigned int attempts=0;
320 ATH_MSG_DEBUG(
"loadCache: Expecting to see " << nChannelsExpected <<
" channels" );
322 while (attempts<2 && !retrievedone) {
329 if (not
m_conn->
valid())
throw std::runtime_error(
"COOL database pointer invalidated");
345 while (itr->hasNext()) {
375 while (itr->goToNext()) {
376 const cool::IObject&
ref=itr->currentRef();
384 cool::IRecordIterator& pitr=
ref.payloadIterator();
385 const cool::IRecordVectorPtr&
pvec=pitr.fetchAllAsVector();
386 for (cool::IRecordVector::const_iterator vitr=
pvec->begin();vitr!=
pvec->end();++vitr) {
418 ATH_MSG_WARNING(
"COOL retrieve attempt " << attempts <<
" failed: " <<
e.what() );
427 std::vector<BasicFolder> crestObjs;
435 unsigned int iadd = 0;
438 ATH_MSG_DEBUG(
"loadCache: Expecting to see " << nChannelsExpected <<
" channels" );
441 const auto & channelNumbers=basicFolder.channelIds();
442 ATH_MSG_DEBUG(
"ChannelIds is " << channelNumbers.size() <<
" long" );
443 for (
const auto &
chan: channelNumbers){
444 addIOVtoCache(basicFolder.iov().first, basicFolder.iov().second);
446 if (basicFolder.isVectorPayload()) {
447 const auto & vPayload = basicFolder.getVectorPayload(
chan);
449 for (
const auto & attList:vPayload){
459 auto const & attList = basicFolder.getPayload(
chan);
478 "," <<
until <<
"]" );
484 const auto missing=std::pair<unsigned int, unsigned int>(nChannelsExpected-nChannelsLo, nChannelsExpected-nChannelsHi);
485 ATH_MSG_DEBUG(
"Cache retrieve missing " << missing.first <<
" lower and " << missing.second <<
" upper channels" );
491 ATH_MSG_DEBUG(
"Lower cache limit extended from " << cacheStart <<
" to " <<
span.first );
495 ATH_MSG_DEBUG(
"Upper cache limit extended from " << cacheStop <<
" tp " <<
span.second );
499 const float timeinc=cachetimer.RealTime();
502 m_iovs.
size() <<
" objects stored in" << std::fixed <<
503 std::setw(8) << std::setprecision(2) << timeinc <<
" s" );
◆ loadCacheIfDbChanged()
Definition at line 507 of file IOVDbFolder.cxx.
518 unsigned int attempts = 0;
519 bool retrievedone =
false;
522 ATH_MSG_DEBUG(
"loadCacheIfDbChanged: Expecting to see " << nChannelsExpected <<
" channels" );
524 while (attempts<2 && !retrievedone) {
553 const cool::IObject&
ref=itr->currentRef();
563 ATH_MSG_WARNING(
"COOL retrieve attempt " << attempts <<
" failed: " <<
e.what() );
◆ magicTag()
bool IOVDbFolder::magicTag |
( |
std::string & |
tag | ) |
|
|
private |
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ multiVersion()
bool IOVDbFolder::multiVersion |
( |
| ) |
const |
|
inline |
◆ noOverride()
bool IOVDbFolder::noOverride |
( |
| ) |
const |
|
inline |
◆ objectIteratorIsValid() [1/2]
bool IOVDbFolder::objectIteratorIsValid |
( |
cool::IObjectIteratorPtr & |
objItr | ) |
|
|
inlineprivate |
◆ objectIteratorIsValid() [2/2]
◆ overrideOptionsFromParsedDescription()
bool IOVDbFolder::overrideOptionsFromParsedDescription |
( |
const IOVDbParser & |
parsedDescription | ) |
|
|
private |
Definition at line 830 of file IOVDbFolder.cxx.
835 if (
auto newkey=parsedDescription.
key(); not newkey.empty() and not
m_jokey) {
846 if (
auto newAddrHeader = parsedDescription.
addressHeader();not newAddrHeader.empty()){
◆ preLoadFolder()
Definition at line 891 of file IOVDbFolder.cxx.
937 for (
int i = 0;
i < n_size;
i++) {
942 chan_list.push_back(elem);
946 int colsize =
std::count(payloadSpec.begin(), payloadSpec.end(),
ch);
950 tag_meta[
"description"] =
"";
951 tag_meta[
"chansize"] = n_size;
952 tag_meta[
"colsize"] = colsize;
955 tagInfo[
"channel_list"] = chan_list;
957 tagInfo[
"payload_spec"] = payloadSpec;
959 tag_meta[
"tagInfo"] = tagInfo.dump();
961 std::string crest_work_dir=std::filesystem::current_path();
962 crest_work_dir +=
"/crest_data";
963 bool crest_rewrite =
true;
997 const auto & linknameVector = folderpar.symLinks();
◆ printCache()
void IOVDbFolder::printCache |
( |
| ) |
|
◆ readMeta()
bool IOVDbFolder::readMeta |
( |
| ) |
const |
|
inline |
◆ readTime()
float IOVDbFolder::readTime |
( |
| ) |
const |
|
inline |
◆ resetCache()
void IOVDbFolder::resetCache |
( |
| ) |
|
◆ resolvedTag()
const std::string & IOVDbFolder::resolvedTag |
( |
| ) |
const |
|
inline |
◆ resolveTag()
bool IOVDbFolder::resolveTag |
( |
const cool::IFolderPtr & |
fptr, |
|
|
const std::string & |
globalTag |
|
) |
| |
|
private |
Definition at line 1046 of file IOVDbFolder.cxx.
1052 if (
tag==
"HEAD")
return true;
1055 ATH_MSG_ERROR(
"No IOVDbSvc.GlobalTag specified on job options or input file" );
1068 const std::vector<std::string>&
taglist=
fptr->listTags();
1075 std::string restag=
fptr->resolveTag(
tag);
1080 }
catch (cool::Exception&
e) {
1089 if (not tagLock.has_value()){
1093 if (not tagLock.value()){
1094 ATH_MSG_ERROR(
"Tag " <<
tag <<
" is not locked and IOVDbSvc.CheckLock is set" );
◆ retrieved()
bool IOVDbFolder::retrieved |
( |
| ) |
const |
|
inline |
◆ setCacheLength()
void IOVDbFolder::setCacheLength |
( |
const bool |
timeIs_nsOfEpoch, |
|
|
const unsigned int |
cacheRun, |
|
|
const unsigned int |
cacheTime |
|
) |
| |
|
private |
Definition at line 1008 of file IOVDbFolder.cxx.
1009 if (timeIs_nsOfEpoch){
1010 long long int clen=600;
1019 ATH_MSG_DEBUG(
"Cache length set to " << clen <<
" seconds" );
◆ setDropped()
void IOVDbFolder::setDropped |
( |
const bool |
dropped | ) |
|
|
inline |
◆ setFolderDescription()
void IOVDbFolder::setFolderDescription |
( |
const std::string & |
description | ) |
|
|
inline |
◆ setIOVOverride()
void IOVDbFolder::setIOVOverride |
( |
const unsigned int |
run, |
|
|
const unsigned int |
lumiblock, |
|
|
const unsigned int |
time |
|
) |
| |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ setSharedSpec()
void IOVDbFolder::setSharedSpec |
( |
const coral::AttributeList & |
atrlist | ) |
|
|
private |
Definition at line 1137 of file IOVDbFolder.cxx.
1138 m_cachespec=
new coral::AttributeListSpecification;
1139 for (
const auto & attribute:atrlist){
1140 const coral::AttributeSpecification& aspec=attribute.specification();
1144 " in folder " <<
m_foldername <<
" will not be counted for bytes-read statistics" );
◆ setTagOverride()
void IOVDbFolder::setTagOverride |
( |
const std::string & |
tag, |
|
|
const bool |
setFlag |
|
) |
| |
◆ setWriteMeta()
void IOVDbFolder::setWriteMeta |
( |
| ) |
|
◆ specialCacheUpdate() [1/2]
◆ specialCacheUpdate() [2/2]
◆ summary()
void IOVDbFolder::summary |
( |
| ) |
|
◆ tagOverride()
bool IOVDbFolder::tagOverride |
( |
| ) |
const |
|
inline |
◆ timeStamp()
bool IOVDbFolder::timeStamp |
( |
| ) |
const |
|
inline |
◆ useFileMetaData()
void IOVDbFolder::useFileMetaData |
( |
| ) |
|
◆ writeMeta()
bool IOVDbFolder::writeMeta |
( |
| ) |
const |
|
inline |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_addrheader
std::string IOVDbFolder::m_addrheader |
|
private |
◆ m_autocache
bool IOVDbFolder::m_autocache {true} |
|
private |
◆ m_cacheattr
std::vector<coral::AttributeList> IOVDbFolder::m_cacheattr |
|
private |
◆ m_cacheccend
std::vector<unsigned int> IOVDbFolder::m_cacheccend |
|
private |
◆ m_cacheccstart
std::vector<unsigned int> IOVDbFolder::m_cacheccstart |
|
private |
◆ m_cachechan
std::vector<cool::ChannelId> IOVDbFolder::m_cachechan |
|
private |
◆ m_cachehint
int IOVDbFolder::m_cachehint {0} |
|
private |
◆ m_cacheinc
int IOVDbFolder::m_cacheinc {0} |
|
private |
◆ m_cachelength
cool::ValidityKey IOVDbFolder::m_cachelength {0} |
|
private |
◆ m_cachepar
std::string IOVDbFolder::m_cachepar |
|
private |
◆ m_cachespec
coral::AttributeListSpecification* IOVDbFolder::m_cachespec {nullptr} |
|
private |
◆ m_cfunctions
◆ m_channames
std::vector<std::string> IOVDbFolder::m_channames |
|
private |
◆ m_channums
std::vector<cool::ChannelId> IOVDbFolder::m_channums |
|
private |
◆ m_chanrange
std::vector<ChanRange> IOVDbFolder::m_chanrange |
|
private |
◆ m_chansel
cool::ChannelSelection IOVDbFolder::m_chansel |
|
private |
◆ m_checklock
bool IOVDbFolder::m_checklock {true} |
|
private |
◆ m_clid
CLID IOVDbFolder::m_clid {0} |
|
private |
◆ m_conn
◆ m_crest_tag
std::string IOVDbFolder::m_crest_tag = "" |
|
private |
◆ m_crestCoolToFile
const bool IOVDbFolder::m_crestCoolToFile {false} |
|
private |
◆ m_crestServer
const std::string IOVDbFolder::m_crestServer |
|
private |
◆ m_crestTag
const std::string IOVDbFolder::m_crestTag |
|
private |
◆ m_crestToFile
const bool IOVDbFolder::m_crestToFile {false} |
|
private |
◆ m_currange
◆ m_dropped
bool IOVDbFolder::m_dropped {false} |
|
private |
◆ m_eventstore
std::string IOVDbFolder::m_eventstore |
|
private |
◆ m_extensible
bool IOVDbFolder::m_extensible {false} |
|
private |
◆ m_folderDescription
std::string IOVDbFolder::m_folderDescription |
|
private |
◆ m_foldername
std::string IOVDbFolder::m_foldername |
|
private |
◆ m_foldertype
◆ m_fromMetaDataOnly
bool IOVDbFolder::m_fromMetaDataOnly {false} |
|
private |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_iovoverridden
bool IOVDbFolder::m_iovoverridden {false} |
|
private |
◆ m_iovoverride
cool::ValidityKey IOVDbFolder::m_iovoverride {0} |
|
private |
◆ m_iovs
◆ m_jokey
bool IOVDbFolder::m_jokey {false} |
|
private |
◆ m_jotag
std::string IOVDbFolder::m_jotag |
|
private |
◆ m_key
std::string IOVDbFolder::m_key |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_multiversion
bool IOVDbFolder::m_multiversion {false} |
|
private |
◆ m_named
bool IOVDbFolder::m_named {false} |
|
private |
◆ m_nbytesread
unsigned long long IOVDbFolder::m_nbytesread {0} |
|
private |
◆ m_ncacheread
unsigned int IOVDbFolder::m_ncacheread {0} |
|
private |
◆ m_nchan
unsigned int IOVDbFolder::m_nchan {0} |
|
private |
◆ m_ndbread
unsigned int IOVDbFolder::m_ndbread {0} |
|
private |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_nobjread
unsigned int IOVDbFolder::m_nobjread {0} |
|
private |
◆ m_notagoverride
bool IOVDbFolder::m_notagoverride {false} |
|
private |
◆ m_outputToFile
const bool IOVDbFolder::m_outputToFile {false} |
|
private |
◆ m_readtime
float IOVDbFolder::m_readtime {0} |
|
private |
◆ m_retrieved
bool IOVDbFolder::m_retrieved {false} |
|
private |
◆ m_source
const std::string IOVDbFolder::m_source |
|
private |
◆ m_tag
std::string IOVDbFolder::m_tag |
|
private |
◆ m_tag_info
◆ m_tagoverride
bool IOVDbFolder::m_tagoverride {false} |
|
private |
◆ m_timestamp
bool IOVDbFolder::m_timestamp {false} |
|
private |
◆ m_typename
std::string IOVDbFolder::m_typename |
|
private |
◆ m_useFileMetaData
bool IOVDbFolder::m_useFileMetaData {false} |
|
private |
◆ m_writemeta
bool IOVDbFolder::m_writemeta {false} |
|
private |
◆ p_clidSvc
IClassIDSvc* IOVDbFolder::p_clidSvc {nullptr} |
|
private |
◆ p_metaDataTool
◆ p_tagInfoMgr
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
const IOVRange & minRange() const
Current minimal IOVRange.
void extendIov(const unsigned int idx, const cool::ValidityKey &newUntilTime)
Extend a specific iov at the index to a new 'until' time.
std::atomic< MSG::Level > m_lvl
Current logging level.
bool noTagOverride() const
std::string spaceStrip(const std::string &input)
Trim leading and trailing spaces,return a new trimmed string.
const bool m_outputToFile
span(T *ptr, std::size_t sz) -> span< T >
A couple needed deduction guides.
std::vector< unsigned int > m_cacheccend
const bool m_crestCoolToFile
bool magicTag(std::string &tag)
IIOVDbMetaDataTool * p_metaDataTool
void createTagMeta(TagMetaDto &tag) override
This method creates a tag meta info on the file storage.
std::string find(const std::string &s)
return a remapped string
unsigned int m_ncacheread
std::vector< IOVDbNamespace::BasicFolder > fetchCrestObjects(cool::ValidityKey since, cool::ValidityKey until, bool vectorPayloadFlag, cool::ValidityKey vkey, const std::string &nodeDesc)
std::vector< Iov_t > & vectorStore()
Return the internal vector store.
std::optional< IOVDbNamespace::CrestFunctions > m_cfunctions
Iov_t getMinimumStraddlingSpan() const
Get the minimum straddling span (max 'since' to min 'until')
void addNewStop(const IOVTime &stop)
Add new stop time to minRange - make sure that stop is <= to new stop
const std::string m_crestTag
const std::string m_crestServer
constexpr unsigned long long ALL_LUMI_BLOCKS
All the lumi blocks in one run.
std::pair< unsigned int, unsigned int > numberOfIovsOnBoundaries() const
Return the current count of added Iovs which straddled cache boundaries.
const std::string & name() const
void clear()
clear the store
std::unique_ptr< SG::TransientAddress > createTransientAddress(const std::vector< std::string > &symlinks)
unsigned int size() const
length of store
void specialCacheUpdate(CoraCoolObject &obj, const ServiceHandle< IIOVSvc > &iovSvc)
bool onlyReadMetadata() const
int run(int argc, char *argv[])
nlohmann::json m_tag_info
cool::ValidityKey m_cachelength
void addNewStart(const IOVTime &start)
Add new start time to minRange - make sure that start is >= to new start.
unsigned long long iovTimeFromSeconds(const unsigned long long seconds)
Create a long long time in ns from s.
const std::string & eventStore() const
cool::ChannelSelection m_chansel
std::vector< IOVHash > fetchCrestIOVs(cool::ValidityKey since, cool::ValidityKey until)
bool overridesIov(MsgStream &msg) const
return true if this description overrides the timestamp or runlumi
static TagDto from_json(const json &j)
ITagInfoMgr * p_tagInfoMgr
IOVTime makeEpochOrRunLumi(const cool::ValidityKey key, const bool timeIsEpoch)
Create an IOVTime in ns of epoch or run-lumi (determined by the bool) from a ValidityKey.
This class is a collection of AttributeLists where each one is associated with a channel number....
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::pair< cool::ValidityKey, cool::ValidityKey > Iov_t
void setSharedSpec(const coral::AttributeList &atrlist)
IMessageSvc * getMessageSvc(bool quiet=false)
void createTag(TagDto &tag) override
This method creates a tag on the file storage.
bool replaceServiceType71(std::string &addrHeader)
const std::string & folderName() const
T getFolderPtr(const std::string &folderName)
IOVDbNamespace::FolderType m_foldertype
Produces cool objects from their JSON representation, storing them in a 'BasicFolder'.
void setLevel(MSG::Level lvl)
Change the current logging level.
AthMessaging()
Default constructor:
AttrListVec::const_iterator const_iterator
cool::ValidityKey m_iovoverride
bool addMetaAttrListColl(const CondAttrListCollection *coll)
def iadd(self, tool)
associator for public tools -------------------------------------------—
std::optional< bool > checkTagLock(const cool::IFolderPtr &fptr, const std::string &tag)
Check whether a tag is locked on a folder, if possible.
The TagDto class It contains all fields of the TagDto class from the CREST API.
std::vector< std::string > m_channames
std::string cache() const
IOVDbNamespace::IovStore m_iovs
Iov_t getCacheBounds() const
Report the current cache bounds.
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
std::pair< std::vector< cool::ChannelId >, std::vector< std::string > > channelList(IOVDbConn *pConnection, const std::string &folderName, const bool named)
Retrieve channel information.
void setCacheBounds(const Iov_t &cacheBounds)
Set the cache bound variables.
std::vector< TFile * > fptr
void setFlag(TrigPassFlags *flags, const T *obj, const CONTAINER *container, const std::vector< bool > &flag)
Set the flag at index position.
std::string m_folderDescription
unsigned long long iovOverrideValue(MsgStream &msg) const
const std::string m_source
static StoreSetDto from_json(const json &j)
uint32_t CLID
The Class ID type.
MsgStream & msg() const
The standard message stream.
boost::shared_ptr< CoraCoolFolder > CoraCoolFolderPtr
bool addMetaAttrList(const coral::AttributeList &atrlist, const IOVRange &range)
void addIOVtoCache(cool::ValidityKey since, cool::ValidityKey until)
void dumpFile(const std::string &dumpName, const cool::ValidityKey &vkey, IOVDbNamespace::Cool2Json *json, bool skipCoolIoV, IOVDbNamespace::BasicFolder *basicFolder, const std::string &crestNodeDescr, const std::string &specString) const
boost::shared_ptr< CoraCoolDatabase > CoraCoolDatabasePtr
IOVRange makeRange(const cool::ValidityKey since, const cool::ValidityKey until, const bool timeIsEpoch)
Make an IOVRange from two validity keys.
void addIov(const Iov_t &iov)
Add an iov to the store and update the span variables.
bool getKey(const std::string &key, const std::string &devvalue, std::string &value) const
original 'getKey' method, now implemented using 'at'
std::string to_string(const DetectorType &type)
std::string sanitiseFilename(const std::string &fname)
Replace the '/' of a file path with '^'.
std::vector< ChanRange > m_chanrange
std::vector< cool::ChannelId > m_channums
const std::string & key() const
bool typeSizeIsKnown(const coral::Attribute &attribute)
Return a bool indicating whether the size of a given Attribute can be determined.
bool timebaseIs_nsOfEpoch() const
unsigned int cacheUpdateImplementation(T &obj, const ServiceHandle< IIOVSvc > &iovSvc)
std::string resolveUsingTagInfo(const std::string &tag, const ITagInfoMgr *tagInfoMgr)
coral::AttributeListSpecification * m_cachespec
std::pair< unsigned long long, unsigned long long > runLumiFromIovTime(const unsigned long long iovTime)
Return a [run,lumi] pair from an IOV time.
std::string folderName() const
give the folder name contained in the parsed description
boost::shared_ptr< CoraCoolObjectIter > CoraCoolObjectIterPtr
unsigned int attributeListSize(const coral::AttributeList &atrlist)
return the size (in bytes) of an AttributeList
bool resolveTag(const cool::IFolderPtr &fptr, const std::string &globalTag)
def time(flags, cells_name, *args, **kw)
std::pair< bool, std::string > folderMetadata(IOVDbConn *pConnection, const std::string &folderName)
Retrieve (bool) multiversion flag and folder description
void setCacheLength(const bool timeIs_nsOfEpoch, const unsigned int cacheRun, const unsigned int cacheTime)
#define ATH_MSG_WARNING(x)
const boost::regex ref(r_ef)
bool extendCacheHi()
Extend upper cache bound to the minimum 'until' time; return whether this changes its value.
std::string m_nm
Message source name.
boost::shared_ptr< CoraCoolObject > CoraCoolObjectPtr
bool overrideOptionsFromParsedDescription(const IOVDbParser &parsedDescription)
std::vector< cool::ChannelId > m_cachechan
Iov_t at(const unsigned int idx) const
'at' to read iov at specific index
std::string folderTypeName(const FolderType f)
Give a string name for the folder type.
void setVectorPayloadFlag(const bool flag)
CLID classId(MsgStream &msg) const
unsigned long long iovTimeFromRunLumi(const unsigned long long run, const unsigned long long lumi)
Create a long long representing the IOV from run, lumi.
FolderType determineFolderType(const std::string &folderDescription, const std::string &spec, const std::vector< cool::ChannelId > &chans)
Determine folder type with optional check using clid service to check clid matches typename.
bool extendCacheLo()
Extend lower cache bound to the maximum 'since' time; return whether this changes its value.
unsigned long long m_nbytesread
int countSelectedChannels(const std::vector< cool::ChannelId > &channels, const cool::ChannelSelection &selected)
Count the number of selected channels in a vector of channels according to cool::Channel selection.
void initMessaging() const
Initialize our message level and MessageSvc.
bool looksLikeMagicTag(const std::string &candidateTag)
Looks like it should be magic.
void addSlice(const IOVRange &range, const unsigned int chan, const std::vector< coral::AttributeList > &data, const unsigned int datastart, const unsigned int dataend)
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
std::vector< unsigned int > m_cacheccstart
void storeData(const std::string &tag, const StoreSetDto &storeSetJson, const std::string &payloadFormat="JSON", const std::string &objectType="none", const std::string &compressionType="none", const std::string &version="1.0", uint64_t endTime=-1) override
This method stores several payloads in batch mode on the file storage.
std::string jsonPayload(const std::string &folderDescription, const std::string &spec)
std::string addressHeader() const
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
bool empty() const
is the store empty?
void setIovSpan(const Iov_t &span)
Set span.
std::string eventStoreName() const
CoraCoolDatabasePtr getCoraCoolDb()
bool objectIteratorIsValid(cool::IObjectIteratorPtr &objItr)
const IOVRange & minRange() const
std::vector< coral::AttributeList > m_cacheattr
void addShared(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs with shared data.
std::string description
glabal timer - how long have I taken so far?