ATLAS Offline Software
Loading...
Searching...
No Matches
CoralCrestManager.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
11
12#ifndef IOVDBSVC_CORALCRESTMANAGER_H
13#define IOVDBSVC_CORALCRESTMANAGER_H
14#include <string>
15#include <iostream>
16#include <map>
17#include <list>
18#include <regex>
19#include <iosfwd>
20#include <cstdint>
21#include "CrestApi/CrestApiBase.h"
22#include "CrestApi/CrestRequest.h"
23#include "FolderTypes.h"
24#include "CoolKernel/ChannelSelection.h"
25#include "CoolKernel/ValidityKey.h"
26#include "CoolKernel/IFolder.h"
27#include <chai/Container.h>
28#include <chai/VectorContainer.h>
29#include <chai/ContainerMap.h>
30
31namespace Crest {
39}
40
42public:
43 static inline const std::string prefix1{"http://"};
44 static inline const std::string prefix2 {"https://"};
45
46 CoralCrestManager(const std::string & crest_path, const std::string & crestTag);
47
48 static std::map<std::string, std::string> getGlobalTagMap(const std::string & crest_path, const std::string& globaltag);
49
50 void loadTagInfo();
51
52 std::string getFolderDescription();
53
54 Crest::TagDto& getTagDto();
55
56 std::string getPayloadSpec();
57
59
60 std::pair<std::vector<cool::ChannelId> , std::vector<std::string>> getChannelList();
61
62 Crest::TagInfoDto getTagInfoDto();
63
64 bool isVectorPayload();
65
66 coral::AttributeListSpecification* getAttributeListSpec();
67 std::vector<std::pair<cool::ValidityKey,std::string>> getIovsForTag(uint64_t since, uint64_t until);
68 std::vector<uint64_t> loadPayloadForHash(uint64_t since,const std::string & hash);
69 std::vector<coral::AttributeList> getVectorPayload(coral::AttributeListSpecification* pSpec,const std::string & chId);
70 std::string dumpPayload(cool::ValidityKey since);
71 coral::AttributeList getPayload(coral::AttributeListSpecification* pSpec,const std::string & chId);
72 void selectIov(cool::ValidityKey since);
73 std::vector<std::string> channelIds(cool::ValidityKey since);
74
75private:
76 std::unique_ptr<Crest::CrestApiBase> m_crestCl;
77 const std::string m_crestTag;
78 std::optional<Crest::TagMetaDto> m_TagMeta;
79 std::optional<Crest::TagDto> m_Tag;
80 std::optional<bool> m_isVectorPayload;
81 std::string parseTypeName(const std::string & description);
82 coral::AttributeList createAttributeList(coral::AttributeListSpecification * pSpec, chai::Values& row);
83 std::pair<uint64_t,uint64_t> getIovInterval(const std::string& tag, const uint64_t since, const uint64_t until);
84 std::pair<uint64_t,uint64_t> getSinceUntilPair(std::vector<uint64_t>& v, const uint64_t since, const uint64_t until);
85 void initChaiContainer();
86 std::optional<std::map<uint64_t,chai::ContainerBasePtr> > m_chai_cont;
87 //std::unique_ptr<chai::ContainerMap> m_chai_cont;
88 cool::ValidityKey m_since;
90};
91#endif
static std::map< std::string, std::string > getGlobalTagMap(const std::string &crest_path, const std::string &globaltag)
std::vector< std::pair< cool::ValidityKey, std::string > > getIovsForTag(uint64_t since, uint64_t until)
std::vector< std::string > channelIds(cool::ValidityKey since)
coral::AttributeList createAttributeList(coral::AttributeListSpecification *pSpec, chai::Values &row)
IOVDbNamespace::FolderType determineFolderType()
std::optional< std::map< uint64_t, chai::ContainerBasePtr > > m_chai_cont
std::vector< uint64_t > loadPayloadForHash(uint64_t since, const std::string &hash)
std::string dumpPayload(cool::ValidityKey since)
Crest::TagDto & getTagDto()
std::vector< coral::AttributeList > getVectorPayload(coral::AttributeListSpecification *pSpec, const std::string &chId)
std::optional< Crest::TagMetaDto > m_TagMeta
std::string getFolderDescription()
cool::ValidityKey m_since
std::optional< bool > m_isVectorPayload
std::optional< Crest::TagDto > m_Tag
std::string parseTypeName(const std::string &description)
CoralCrestManager(const std::string &crest_path, const std::string &crestTag)
static const std::string prefix1
std::pair< uint64_t, uint64_t > getIovInterval(const std::string &tag, const uint64_t since, const uint64_t until)
std::string getPayloadSpec()
std::pair< std::vector< cool::ChannelId >, std::vector< std::string > > getChannelList()
coral::AttributeList getPayload(coral::AttributeListSpecification *pSpec, const std::string &chId)
std::pair< uint64_t, uint64_t > getSinceUntilPair(std::vector< uint64_t > &v, const uint64_t since, const uint64_t until)
std::unique_ptr< Crest::CrestApiBase > m_crestCl
Crest::TagInfoDto getTagInfoDto()
coral::AttributeListSpecification * getAttributeListSpec()
static const std::string prefix2
const std::string m_crestTag
void selectIov(cool::ValidityKey since)
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:93
ModeId
Wire format of the tag's payloads, derived from the CREST tag objectType.