@@ -28,55 +28,22 @@ O2_DECLARE_DYNAMIC_LOG(ccdb);
2828namespace o2 ::framework
2929{
3030
31- struct CCDBFetcherHelper {
32- struct CCDBCacheInfo {
33- std::string etag;
34- size_t cacheValidUntil = 0 ;
35- size_t cachePopulatedAt = 0 ;
36- size_t cacheMiss = 0 ;
37- size_t cacheHit = 0 ;
38- size_t minSize = -1ULL ;
39- size_t maxSize = 0 ;
40- int lastCheckedTF = 0 ;
41- };
42-
43- struct RemapMatcher {
44- std::string path;
45- };
46-
47- struct RemapTarget {
48- std::string url;
49- };
50-
51- std::unordered_map<std::string, CCDBCacheInfo> mapURL2UUID;
52- std::unordered_map<std::string, DataAllocator::CacheId> mapURL2DPLCache;
53- std::string createdNotBefore = " 0" ;
54- std::string createdNotAfter = " 3385078236000" ;
55- std::unordered_map<std::string, o2::ccdb::CcdbApi> apis;
56- std::vector<OutputRoute> routes;
57- std::unordered_map<std::string, std::string> remappings;
58- uint32_t lastCheckedTFCounterOrbReset = 0 ; // last checkecked TFcounter for bulk check
59- int queryPeriodGlo = 1 ;
60- int queryPeriodFactor = 1 ;
61- int64_t timeToleranceMS = 5000 ;
62-
63- o2::ccdb::CcdbApi& getAPI (const std::string& path)
64- {
65- // find the first = sign in the string. If present drop everything after it
66- // and between it and the previous /.
67- auto pos = path.find (' =' );
68- if (pos == std::string::npos) {
69- auto entry = remappings.find (path);
70- return apis[entry == remappings.end () ? " " : entry->second ];
71- }
72- auto pos2 = path.rfind (' /' , pos);
73- if (pos2 == std::string::npos || pos2 == pos - 1 || pos2 == 0 ) {
74- throw runtime_error_f (" Malformed path %s" , path.c_str ());
75- }
76- auto entry = remappings.find (path.substr (0 , pos2));
31+ o2::ccdb::CcdbApi& CCDBFetcherHelper::getAPI (const std::string& path)
32+ {
33+ // find the first = sign in the string. If present drop everything after it
34+ // and between it and the previous /.
35+ auto pos = path.find (' =' );
36+ if (pos == std::string::npos) {
37+ auto entry = remappings.find (path);
7738 return apis[entry == remappings.end () ? " " : entry->second ];
7839 }
79- };
40+ auto pos2 = path.rfind (' /' , pos);
41+ if (pos2 == std::string::npos || pos2 == pos - 1 || pos2 == 0 ) {
42+ throw runtime_error_f (" Malformed path %s" , path.c_str ());
43+ }
44+ auto entry = remappings.find (path.substr (0 , pos2));
45+ return apis[entry == remappings.end () ? " " : entry->second ];
46+ }
8047
8148bool isPrefix (std::string_view prefix, std::string_view full)
8249{
0 commit comments