CMS 3D CMS Logo

HDF5ProductResolver.h
Go to the documentation of this file.
1 #ifndef CondCore_HDF5ESSource_HDF5ProductResolver_h
2 #define CondCore_HDF5ESSource_HDF5ProductResolver_h
3 // -*- C++ -*-
4 //
5 // Package: CondCore/HDF5ESSource
6 // Class : HDF5ProductResolver
7 //
16 //
17 // Original Author: Christopher Jones
18 // Created: Tue, 20 Jun 2023 13:52:57 GMT
19 //
20 
21 // system include files
22 
23 // user include files
26 #include "Record.h"
27 #include "DataProduct.h"
28 #include "h5_File.h"
29 #include "Compression.h"
30 
31 // forward declarations
32 namespace edm {
33  class SerialTaskQueue;
34 }
35 
37 public:
39  std::unique_ptr<cond::serialization::SerializationHelperBase>,
40  cms::h5::File const* iFile,
41  std::string const& iFileName,
42  cond::hdf5::Compression iCompression,
43  cond::hdf5::Record const* iRecord,
44  cond::hdf5::DataProduct const* iDataProduct);
45  ~HDF5ProductResolver() override;
46 
47  HDF5ProductResolver(const HDF5ProductResolver&) = delete; // stop default
48  const HDF5ProductResolver& operator=(const HDF5ProductResolver&) = delete; // stop default
49 
50 private:
53  edm::eventsetup::DataKey const& iKey,
54  edm::EventSetupImpl const*,
55  edm::ServiceToken const&,
56  edm::ESParentContext const&) final;
57 
58  void invalidateCache() final;
60  void const* getAfterPrefetchImpl() const final;
61 
62  std::ptrdiff_t indexForInterval(edm::ValidityInterval const& iIOV) const;
63 
64  void readFromHDF5api(std::ptrdiff_t iIndex);
65  void threadFriendlyPrefetch(uint64_t iFileOffset,
66  std::size_t iStorageSize,
67  std::size_t iMemSize,
68  const std::string& iType);
69 
70  std::vector<char> decompress_zlib(std::vector<char>, std::size_t iMemSize) const;
71  std::vector<char> decompress_lzma(std::vector<char>, std::size_t iMemSize) const;
72  // ---------- member data --------------------------------
75  std::unique_ptr<cond::serialization::SerializationHelperBase> helper_;
81 
82  //temporaries
85  std::size_t storageSize_;
86  std::size_t memSize_;
87  std::exception_ptr exceptPtr_;
88 };
89 
90 #endif
cond::hdf5::DataProduct const * dataProduct_
std::unique_ptr< cond::serialization::SerializationHelperBase > helper_
std::ptrdiff_t indexForInterval(edm::ValidityInterval const &iIOV) const
const HDF5ProductResolver & operator=(const HDF5ProductResolver &)=delete
HDF5ProductResolver(edm::SerialTaskQueue *iQueue, std::unique_ptr< cond::serialization::SerializationHelperBase >, cms::h5::File const *iFile, std::string const &iFileName, cond::hdf5::Compression iCompression, cond::hdf5::Record const *iRecord, cond::hdf5::DataProduct const *iDataProduct)
void threadFriendlyPrefetch(uint64_t iFileOffset, std::size_t iStorageSize, std::size_t iMemSize, const std::string &iType)
void prefetch(edm::eventsetup::DataKey const &iKey, edm::EventSetupRecordDetails) final
edm::SerialTaskQueue * queue_
cond::serialization::unique_void_ptr data_
void readFromHDF5api(std::ptrdiff_t iIndex)
cond::hdf5::Compression compression_
std::exception_ptr exceptPtr_
unsigned long long uint64_t
Definition: Time.h:13
cond::hdf5::Record const * record_
void const * getAfterPrefetchImpl() const final
HLT enums.
void prefetchAsyncImpl(edm::WaitingTaskHolder iTask, edm::eventsetup::EventSetupRecordImpl const &iES, edm::eventsetup::DataKey const &iKey, edm::EventSetupImpl const *, edm::ServiceToken const &, edm::ESParentContext const &) final
std::vector< char > decompress_lzma(std::vector< char >, std::size_t iMemSize) const
cms::h5::File const * file_
std::vector< char > decompress_zlib(std::vector< char >, std::size_t iMemSize) const