45 std::unique_ptr<cond::serialization::SerializationHelperBase> iHelper,
57 dataProduct_(iDataProduct),
58 compression_(iCompression) {}
78 [
this, iov = iRecord.
validityInterval(), iParent, &iRecord](
auto& iGroup,
auto iActivity) {
82 reinterpret_cast<std::uintptr_t>(
this),
89 :
record_{iRecord}, context_{iContext} {}
90 ~EndGuard() {
record_.activityRegistry()->postESModuleSignal_.emit(
record_.key(), context_); }
105 []() {
return true; },
131 memSize_ = ds->findAttribute(
"memsize")->readUInt32();
132 type_ = ds->findAttribute(
"type")->readString();
147 if (iMemSize == compressedBuffer.size()) {
154 strm.zalloc = Z_NULL;
156 strm.opaque = Z_NULL;
158 strm.next_in = Z_NULL;
159 auto ret = inflateInit(&strm);
162 strm.avail_in = compressedBuffer.size();
163 strm.next_in =
reinterpret_cast<unsigned char*
>(compressedBuffer.data());
165 buffer = std::vector<char>(iMemSize);
166 strm.avail_out =
buffer.size();
167 strm.next_out =
reinterpret_cast<unsigned char*
>(
buffer.data());
168 ret = inflate(&strm, Z_FINISH);
173 (
void)inflateEnd(&strm);
180 if (iMemSize == compressedBuffer.size()) {
186 lzma_stream
stream = LZMA_STREAM_INIT;
188 auto returnStatus = lzma_stream_decoder(&
stream, UINT64_MAX, 0
U);
189 if (returnStatus != LZMA_OK) {
190 throw cms::Exception(
"H5CondFailedDecompress") <<
"failed to setup lzma";
193 stream.next_in =
reinterpret_cast<uint8_t*
>(compressedBuffer.data());
194 stream.avail_in = compressedBuffer.size();
196 buffer = std::vector<char>(iMemSize);
197 stream.next_out =
reinterpret_cast<uint8_t*
>(
buffer.data());
200 returnStatus = lzma_code(&
stream, LZMA_FINISH);
202 if (returnStatus != LZMA_STREAM_END) {
203 throw cms::Exception(
"H5CondFailedDecompress") <<
"failed to decompress buffer using lzma";
210 std::size_t iStorageSize,
211 std::size_t iMemSize,
216 std::vector<char> compressedBuffer(iStorageSize);
218 file.seekg(iFileOffset);
219 file.read(compressedBuffer.data(), compressedBuffer.size());
230 std::stringbuf sBuffer;
235 <<
"failed to deserialize: buffer size:" <<
buffer.size() <<
" type: '" << iTypeName <<
"'";
240 ESSourceProductResolverBase::invalidateCache();
~HDF5ProductResolver() override
cond::hdf5::DataProduct const * dataProduct_
const IOVSyncValue & first() const
std::unique_ptr< cond::serialization::SerializationHelperBase > helper_
std::ptrdiff_t indexForInterval(edm::ValidityInterval const &iIOV) const
ret
prodAgent to be discontinued
void push(oneapi::tbb::task_group &, const T &iAction)
asynchronously pushes functor iAction into queue
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)
std::vector< IOVSyncValue > iovFirsts_
void threadFriendlyPrefetch(uint64_t iFileOffset, std::size_t iStorageSize, std::size_t iMemSize, const std::string &iType)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
const void * get() const noexcept
TEMPL(T2) struct Divides void
void prefetchAsyncImplTemplate(ASYNC iAsync, GUARD iGuardFactory, edm::WaitingTaskHolder iTask, edm::eventsetup::EventSetupRecordImpl const &iRecord, edm::eventsetup::DataKey const &iKey, edm::ESParentContext const &iContext)
void emit(Args &&... args) const
ValidityInterval validityInterval() const
void prefetch(edm::eventsetup::DataKey const &iKey, edm::EventSetupRecordDetails) final
ComponentDescription const * providerDescription() const
returns the description of the ESProductResolverProvider which owns this Resolver ...
edm::SerialTaskQueue * queue_
std::vector< IOVSyncValue >::const_iterator findMatchingFirst(std::vector< IOVSyncValue > const &iIOVs, IOVSyncValue iMatch)
cond::serialization::unique_void_ptr data_
std::vector< hobj_ref_t > payloadForIOVs_
void readFromHDF5api(std::ptrdiff_t iIndex)
cond::hdf5::Compression compression_
std::exception_ptr exceptPtr_
unsigned long long uint64_t
EventSetupRecordKey const & key() const
cond::hdf5::Record const * record_
PreESModule preESModuleSignal_
void const * getAfterPrefetchImpl() const final
IOVSyncValue convertSyncValue(edm::IOVSyncValue const &iFrom, bool iIsRunLumi)
void invalidateCache() final
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::shared_ptr< DataSet > derefDataSet(hobj_ref_t iRef) const
std::vector< char > decompress_lzma(std::vector< char >, std::size_t iMemSize) const
cms::h5::File const * file_
ActivityRegistry const * activityRegistry() const noexcept
std::vector< char > decompress_zlib(std::vector< char >, std::size_t iMemSize) const