Description: Class to hold configuration identifier for chambers
This class was originally defined in CondCore/DTPlugins/interface/DTConfigPluginHandler.h It was moved, renamed, and modified to not be a singleton for thread safety, but otherwise little was changed.
- Author
- Paolo Ronchese INFN Padova
Definition at line 29 of file DTKeyedConfigCache.h.
Definition at line 42 of file DTKeyedConfigCache.cc.
References brickMap, cachedBrickNumber, cachedByteNumber, cachedStringNumber, DTKeyedConfig::dataBegin(), DTKeyedConfig::dataEnd(), MillePedeFileConverter_cfg::e, mps_splice::entry, cppFunctionSkipper::exception, DTKeyedConfig::getId(), cond::persistency::KeyList::getUsingKey(), maxBrickNumber, maxByteNumber, maxStringNumber, getGTfromDQMFile::obj, and findQualityFiles::size.
Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().
43 bool cacheFound =
false;
44 int cacheAge = 999999999;
45 std::map<int, counted_brick>::iterator cache_iter =
brickMap.begin();
46 std::map<int, counted_brick>::iterator cache_icfg =
brickMap.find(cfgId);
47 std::map<int, counted_brick>::iterator cache_iend =
brickMap.end();
48 if (cache_icfg != cache_iend) {
49 std::pair<const int, counted_brick>&
entry = *cache_icfg;
51 cacheAge = cBrick.first;
56 std::map<int, const DTKeyedConfig*> ageMap;
60 while (cache_iter != cache_iend) {
61 std::pair<const int, counted_brick>&
entry = *cache_iter++;
63 int& brickAge = cBrick.first;
64 if (brickAge < cacheAge)
66 if (
entry.first == cfgId)
71 while (cache_iter != cache_iend) {
72 std::pair<const int, counted_brick>&
entry = *cache_iter++;
74 ageMap.insert(std::pair<int, const DTKeyedConfig*>(++cBrick.first,
entry.second.second));
78 std::shared_ptr<DTKeyedConfig> kBrick;
79 bool brickFound =
false;
83 brickFound = (kBrick->getId() == cfgId);
88 brickMap.insert(std::pair<int, counted_brick>(cfgId, cBrick));
93 while (d_iter != d_iend)
96 std::map<int, const DTKeyedConfig*>::reverse_iterator iter = ageMap.rbegin();
100 int oldestId = oldestBrick->
getId();
105 while (d_iter != d_iend)
std::map< int, counted_brick > brickMap
data_iterator dataBegin() const
std::pair< int, const DTKeyedConfig * > counted_brick
data_iterator dataEnd() const
static const int maxByteNumber
std::vector< std::string >::const_iterator data_iterator
static const int maxBrickNumber
static const int maxStringNumber
std::shared_ptr< T > getUsingKey(unsigned long long key) const