Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RPageStorageDaos.cxx
Go to the documentation of this file.
1/// \file RPageStorageDaos.cxx
2/// \author Javier Lopez-Gomez <j.lopez@cern.ch>
3/// \date 2020-11-03
4/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
5/// is welcome!
6
7/*************************************************************************
8 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
9 * All rights reserved. *
10 * *
11 * For the licensing terms see $ROOTSYS/LICENSE. *
12 * For the list of contributors see $ROOTSYS/README/CREDITS. *
13 *************************************************************************/
14
15#include <ROOT/RCluster.hxx>
16#include <ROOT/RLogger.hxx>
18#include <ROOT/RNTupleModel.hxx>
21#include <ROOT/RNTupleTypes.hxx>
22#include <ROOT/RNTupleUtils.hxx>
23#include <ROOT/RNTupleZip.hxx>
24#include <ROOT/RPage.hxx>
26#include <ROOT/RPagePool.hxx>
27#include <ROOT/RDaos.hxx>
29
30#include <RVersion.h>
31#include <TError.h>
32
33#include <algorithm>
34#include <cstdio>
35#include <cstdlib>
36#include <cstring>
37#include <limits>
38#include <utility>
39#include <regex>
40#include <cassert>
41
42namespace {
51
52struct RDaosKey {
53 daos_obj_id_t fOid;
54 DistributionKey_t fDkey;
55 AttributeKey_t fAkey;
56};
57
58/// \brief Pre-defined keys for object store. `kDistributionKeyDefault` is the distribution key for metadata and
59/// pagelist values; optionally it can be used for ntuple pages (if under the `kOidPerPage` mapping strategy).
60/// `kAttributeKeyDefault` is the attribute key for ntuple pages under `kOidPerPage`.
61/// `kAttributeKey{Anchor,Header,Footer}` are the respective attribute keys for anchor/header/footer metadata elements.
62static constexpr DistributionKey_t kDistributionKeyDefault = 0x5a3c69f0cafe4a11;
63static constexpr AttributeKey_t kAttributeKeyDefault = 0x4243544b53444229;
64static constexpr AttributeKey_t kAttributeKeyAnchor = 0x4243544b5344422a;
65static constexpr AttributeKey_t kAttributeKeyHeader = 0x4243544b5344422b;
66static constexpr AttributeKey_t kAttributeKeyFooter = 0x4243544b5344422c;
67
68/// \brief Pre-defined 64 LSb of the OIDs for ntuple metadata (holds anchor/header/footer) and clusters' pagelists.
69static constexpr decltype(daos_obj_id_t::lo) kOidLowMetadata = -1;
70static constexpr decltype(daos_obj_id_t::lo) kOidLowPageList = -2;
71
72static constexpr daos_oclass_id_t kCidMetadata = OC_SX;
73
75{
76 return RDaosKey{daos_obj_id_t{static_cast<decltype(daos_obj_id_t::lo)>(pageCount),
77 static_cast<decltype(daos_obj_id_t::hi)>(ntplId)},
79}
80
81struct RDaosURI {
82 /// \brief Label of the DAOS pool
83 std::string fPoolLabel;
84 /// \brief Label of the container for this RNTuple
85 std::string fContainerLabel;
86};
87
88/**
89 \brief Parse a DAOS RNTuple URI of the form 'daos://pool_id/container_id'.
90*/
91RDaosURI ParseDaosURI(std::string_view uri)
92{
93 std::regex re("daos://([^/]+)/(.+)");
94 std::cmatch m;
95 if (!std::regex_match(uri.data(), m, re))
96 throw ROOT::RException(R__FAIL("Invalid DAOS pool URI."));
97 return {m[1], m[2]};
98}
99
100/// \brief Helper structure concentrating the functionality required to locate an ntuple within a DAOS container.
101/// It includes a hashing function that converts the RNTuple's name into a 32-bit identifier; this value is used to
102/// index the subspace for the ntuple among all objects in the container. A zero-value hash value is reserved for
103/// storing any future metadata related to container-wide management; a zero-index ntuple is thus disallowed and
104/// remapped to "1". Once the index is computed, `InitNTupleDescriptorBuilder()` can be called to return a
105/// partially-filled builder with the ntuple's anchor, header and footer, lacking only pagelists. Upon that call,
106/// a copy of the anchor is stored in `fAnchor`.
107struct RDaosContainerNTupleLocator {
108 std::string fName{};
109 ntuple_index_t fIndex{};
110 std::optional<ROOT::Experimental::Internal::RDaosNTupleAnchor> fAnchor;
111 static const ntuple_index_t kReservedIndex = 0;
112
113 RDaosContainerNTupleLocator() = default;
114 explicit RDaosContainerNTupleLocator(const std::string &ntupleName) : fName(ntupleName), fIndex(Hash(ntupleName)) {}
115
116 bool IsValid() { return fAnchor.has_value() && fAnchor->fNBytesHeader; }
117 [[nodiscard]] ntuple_index_t GetIndex() const { return fIndex; };
118 static ntuple_index_t Hash(const std::string &ntupleName)
119 {
120 // Convert string to numeric representation via `std::hash`.
121 uint64_t h = std::hash<std::string>{}(ntupleName);
122 // Fold the hash into 32-bit using `boost::hash_combine()` algorithm and magic number.
123 auto seed = static_cast<uint32_t>(h >> 32);
124 seed ^= static_cast<uint32_t>(h & 0xffffffff) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
125 auto hash = static_cast<ntuple_index_t>(seed);
126 return (hash == kReservedIndex) ? kReservedIndex + 1 : hash;
127 }
128
131 {
132 std::unique_ptr<unsigned char[]> buffer, zipBuffer;
133 auto &anchor = fAnchor.emplace();
134 int err;
135
137 daos_obj_id_t oidMetadata{kOidLowMetadata, static_cast<decltype(daos_obj_id_t::hi)>(this->GetIndex())};
138
140 if ((err = cont.ReadSingleAkey(buffer.get(), anchorSize, oidMetadata, kDistributionKeyDefault,
142 return err;
143 }
144
145 anchor.Deserialize(buffer.get(), anchorSize).Unwrap();
146
147 builder.SetVersion(anchor.fVersionEpoch, anchor.fVersionMajor, anchor.fVersionMinor, anchor.fVersionPatch);
148 builder.SetOnDiskHeaderSize(anchor.fNBytesHeader);
149 buffer = MakeUninitArray<unsigned char>(anchor.fLenHeader);
151 if ((err = cont.ReadSingleAkey(zipBuffer.get(), anchor.fNBytesHeader, oidMetadata, kDistributionKeyDefault,
153 return err;
154 RNTupleDecompressor::Unzip(zipBuffer.get(), anchor.fNBytesHeader, anchor.fLenHeader, buffer.get());
155 RNTupleSerializer::DeserializeHeader(buffer.get(), anchor.fLenHeader, builder);
156
157 builder.AddToOnDiskFooterSize(anchor.fNBytesFooter);
158 buffer = MakeUninitArray<unsigned char>(anchor.fLenFooter);
160 if ((err = cont.ReadSingleAkey(zipBuffer.get(), anchor.fNBytesFooter, oidMetadata, kDistributionKeyDefault,
162 return err;
163 RNTupleDecompressor::Unzip(zipBuffer.get(), anchor.fNBytesFooter, anchor.fLenFooter, buffer.get());
164 RNTupleSerializer::DeserializeFooter(buffer.get(), anchor.fLenFooter, builder);
165
166 return 0;
167 }
168
169 static std::pair<RDaosContainerNTupleLocator, ROOT::Internal::RNTupleDescriptorBuilder>
171 {
172 auto result = std::make_pair(RDaosContainerNTupleLocator(ntupleName), ROOT::Internal::RNTupleDescriptorBuilder());
173
174 auto &loc = result.first;
175 auto &builder = result.second;
176
177 if (int err = loc.InitNTupleDescriptorBuilder(cont, builder); !err) {
178 if (ntupleName.empty() || ntupleName != builder.GetDescriptor().GetName()) {
179 // Hash already taken by a differently-named ntuple.
180 throw ROOT::RException(
181 R__FAIL("LocateNTuple: ntuple name '" + ntupleName + "' unavailable in this container."));
182 }
183 }
184 return result;
185 }
186};
187
188} // anonymous namespace
189
190////////////////////////////////////////////////////////////////////////////////
191
209
212{
213 if (bufSize < 32)
214 return R__FAIL("DAOS anchor too short");
215
216 auto bytes = reinterpret_cast<const unsigned char *>(buffer);
218 if (fVersionAnchor != RDaosNTupleAnchor().fVersionAnchor) {
219 return R__FAIL("unsupported DAOS anchor version: " + std::to_string(fVersionAnchor));
220 }
221
231 if (!result)
232 return R__FORWARD_ERROR(result);
233 return result.Unwrap() + 32;
234}
235
240
241////////////////////////////////////////////////////////////////////////////////
242
244 const ROOT::RNTupleWriteOptions &options)
245 : RPagePersistentSink(ntupleName, options), fURI(uri)
246{
247 static std::once_flag once;
248 std::call_once(once, []() {
249 R__LOG_WARNING(ROOT::Internal::NTupleLog()) << "The DAOS backend is experimental and still under development. "
250 << "Do not store real data with this version of RNTuple!";
251 });
252 EnableDefaultMetrics("RPageSinkDaos");
253}
254
256
258{
259 auto opts = dynamic_cast<RNTupleWriteOptionsDaos *>(fOptions.get());
260 fNTupleAnchor.fObjClass = opts ? opts->GetObjectClass() : RNTupleWriteOptionsDaos().GetObjectClass();
261 auto oclass = RDaosObject::ObjClassId(fNTupleAnchor.fObjClass);
262 if (oclass.IsUnknown())
263 throw ROOT::RException(R__FAIL("Unknown object class " + fNTupleAnchor.fObjClass));
264
265 auto args = ParseDaosURI(fURI);
266 auto pool = std::make_shared<RDaosPool>(args.fPoolLabel);
267
268 fDaosContainer = std::make_unique<RDaosContainer>(pool, args.fContainerLabel, /*create =*/true);
269 fDaosContainer->SetDefaultObjectClass(oclass);
270
271 auto [locator, _] = RDaosContainerNTupleLocator::LocateNTuple(*fDaosContainer, fNTupleName);
272 fNTupleIndex = locator.GetIndex();
273
275 auto szZipHeader =
276 RNTupleCompressor::Zip(serializedHeader, length, GetWriteOptions().GetCompression(), zipBuffer.get());
277 WriteNTupleHeader(zipBuffer.get(), szZipHeader, length);
278}
279
282{
283 auto element = columnHandle.fColumn->GetElement();
285 {
286 Detail::RNTupleAtomicTimer timer(fCounters->fTimeWallZip, fCounters->fTimeCpuZip);
287 sealedPage = SealPage(page, *element);
288 }
289
290 fCounters->fSzZip.Add(page.GetNBytes());
291 return CommitSealedPageImpl(columnHandle.fPhysicalId, sealedPage);
292}
293
297{
298 auto pageId = fPageId.fetch_add(1);
299
300 {
301 Detail::RNTupleAtomicTimer timer(fCounters->fTimeWallWrite, fCounters->fTimeCpuWrite);
302 RDaosKey daosKey = GetPageDaosKey(fNTupleIndex, pageId);
303 fDaosContainer->WriteSingleAkey(sealedPage.GetBuffer(), sealedPage.GetBufferSize(), daosKey.fOid, daosKey.fDkey,
304 daosKey.fAkey);
305 }
306
309 result.SetNBytesOnStorage(sealedPage.GetDataSize());
311 fCounters->fNPageCommitted.Inc();
312 fCounters->fSzWritePayload.Add(sealedPage.GetBufferSize());
313 fNBytesCurrentCluster += sealedPage.GetBufferSize();
314 return result;
315}
316
317std::vector<ROOT::RNTupleLocator>
318ROOT::Experimental::Internal::RPageSinkDaos::CommitSealedPageVImpl(std::span<RPageStorage::RSealedPageGroup> ranges,
319 const std::vector<bool> &mask)
320{
322 std::vector<RNTupleLocator> locators;
323 auto nPages = mask.size();
324 locators.reserve(nPages);
325
326 int64_t payloadSz = 0;
327
328 /// Aggregate batch of requests by object ID and distribution key, determined by the ntuple-DAOS mapping
329 for (auto &range : ranges) {
330 for (auto sealedPageIt = range.fFirst; sealedPageIt != range.fLast; ++sealedPageIt) {
332
333 const auto pageId = fPageId.fetch_add(1);
334
336 d_iov_set(&pageIov, const_cast<void *>(s.GetBuffer()), s.GetBufferSize());
337
338 RDaosKey daosKey = GetPageDaosKey(fNTupleIndex, pageId);
341 it->second.Insert(daosKey.fAkey, pageIov);
342
345 locator.SetNBytesOnStorage(s.GetDataSize());
347 locators.push_back(locator);
348
350 }
351 }
352 fNBytesCurrentCluster += payloadSz;
353
354 {
355 Detail::RNTupleAtomicTimer timer(fCounters->fTimeWallWrite, fCounters->fTimeCpuWrite);
356 if (int err = fDaosContainer->WriteV(writeRequests))
357 throw ROOT::RException(R__FAIL("WriteV: error" + std::string(d_errstr(err))));
358 }
359
360 fCounters->fNPageCommitted.Add(nPages);
361 fCounters->fSzWritePayload.Add(payloadSz);
362
363 return locators;
364}
365
367{
368 return std::exchange(fNBytesCurrentCluster, 0);
369}
370
373 std::uint32_t length)
374{
376 auto szPageListZip =
377 RNTupleCompressor::Zip(serializedPageList, length, GetWriteOptions().GetCompression(), bufPageListZip.get());
378
379 auto offsetData = fClusterGroupId.fetch_add(1);
380 fDaosContainer->WriteSingleAkey(
382 daos_obj_id_t{kOidLowPageList, static_cast<decltype(daos_obj_id_t::hi)>(fNTupleIndex)}, kDistributionKeyDefault,
386 result.SetNBytesOnStorage(szPageListZip);
388 fCounters->fSzWritePayload.Add(static_cast<int64_t>(szPageListZip));
389 return result;
390}
391
394{
396 auto szFooterZip =
397 RNTupleCompressor::Zip(serializedFooter, length, GetWriteOptions().GetCompression(), bufFooterZip.get());
398 WriteNTupleFooter(bufFooterZip.get(), szFooterZip, length);
399 WriteNTupleAnchor();
400
401 // TODO: return the proper anchor locator+length
402 return {};
403}
404
406{
407 fDaosContainer->WriteSingleAkey(
408 data, nbytes, daos_obj_id_t{kOidLowMetadata, static_cast<decltype(daos_obj_id_t::hi)>(fNTupleIndex)},
410 fNTupleAnchor.fLenHeader = lenHeader;
411 fNTupleAnchor.fNBytesHeader = nbytes;
412}
413
415{
416 fDaosContainer->WriteSingleAkey(
417 data, nbytes, daos_obj_id_t{kOidLowMetadata, static_cast<decltype(daos_obj_id_t::hi)>(fNTupleIndex)},
419 fNTupleAnchor.fLenFooter = lenFooter;
420 fNTupleAnchor.fNBytesFooter = nbytes;
421}
422
424{
427 fNTupleAnchor.Serialize(buffer.get());
428 fDaosContainer->WriteSingleAkey(
429 buffer.get(), ntplSize, daos_obj_id_t{kOidLowMetadata, static_cast<decltype(daos_obj_id_t::hi)>(fNTupleIndex)},
431}
432
433std::unique_ptr<ROOT::Internal::RPageSink>
435 const ROOT::RNTupleWriteOptions & /*opts*/) const
436{
437 throw ROOT::RException(R__FAIL("cloning a DAOS sink is not implemented yet"));
438}
439
440////////////////////////////////////////////////////////////////////////////////
441
443 const ROOT::RNTupleReadOptions &options)
444 : RPageSource(ntupleName, options), fURI(uri)
445{
446 EnableDefaultMetrics("RPageSourceDaos");
447
448 auto args = ParseDaosURI(uri);
449 auto pool = std::make_shared<RDaosPool>(args.fPoolLabel);
450 fDaosContainer = std::make_unique<RDaosContainer>(pool, args.fContainerLabel);
451}
452
454{
455 StopClusterPoolBackgroundThread();
456}
457
460{
462 std::unique_ptr<unsigned char[]> buffer, zipBuffer;
463
464 auto [locator, descBuilder] = RDaosContainerNTupleLocator::LocateNTuple(*fDaosContainer, fNTupleName);
465 if (!locator.IsValid())
466 throw ROOT::RException(
467 R__FAIL("Attach: requested ntuple '" + fNTupleName + "' is not present in DAOS container."));
468
469 auto oclass = RDaosObject::ObjClassId(locator.fAnchor->fObjClass);
470 if (oclass.IsUnknown())
471 throw ROOT::RException(R__FAIL("Attach: unknown object class " + locator.fAnchor->fObjClass));
472
473 fDaosContainer->SetDefaultObjectClass(oclass);
474 fNTupleIndex = locator.GetIndex();
476
477 auto desc = descBuilder.MoveDescriptor();
478
479 for (const auto &cgDesc : desc.GetClusterGroupIterable()) {
480 buffer = MakeUninitArray<unsigned char>(cgDesc.GetPageListLength());
481 zipBuffer = MakeUninitArray<unsigned char>(cgDesc.GetPageListLocator().GetNBytesOnStorage());
482 fDaosContainer->ReadSingleAkey(
483 zipBuffer.get(), cgDesc.GetPageListLocator().GetNBytesOnStorage(), oidPageList, kDistributionKeyDefault,
484 cgDesc.GetPageListLocator().GetPosition<RNTupleLocatorObject64>().GetLocation(), kCidMetadata);
485 RNTupleDecompressor::Unzip(zipBuffer.get(), cgDesc.GetPageListLocator().GetNBytesOnStorage(),
486 cgDesc.GetPageListLength(), buffer.get());
487
488 RNTupleSerializer::DeserializePageList(buffer.get(), cgDesc.GetPageListLength(), cgDesc.GetId(), desc, mode);
489 }
490
491 return desc;
492}
493
495{
496 return fDaosContainer->GetDefaultObjectClass().ToString();
497}
498
501{
502 RDaosKey daosKey = GetPageDaosKey(fNTupleIndex, locator.GetPosition<RNTupleLocatorObject64>().GetLocation());
503 fDaosContainer->ReadSingleAkey(const_cast<void *>(sealedPage.GetBuffer()), sealedPage.GetBufferSize(), daosKey.fOid,
504 daosKey.fDkey, daosKey.fAkey);
505}
506
507std::unique_ptr<ROOT::Internal::RPageSource> ROOT::Experimental::Internal::RPageSourceDaos::CloneImpl() const
508{
509 auto clone = new RPageSourceDaos(fNTupleName, fURI, fOptions);
510 return std::unique_ptr<RPageSourceDaos>(clone);
511}
512
513std::vector<std::unique_ptr<RCluster>>
515{
517 ROOT::DescriptorId_t fClusterId = 0;
518 ROOT::DescriptorId_t fColumnId = 0;
519 ROOT::NTupleSize_t fPageNo = 0;
520 std::uint64_t fPageId = 0;
521 std::uint64_t fDataSize = 0; // page payload
522 std::uint64_t fBufferSize = 0; // page payload + checksum (if available)
523 };
524
525 // Prepares read requests for a single cluster; `readRequests` is modified by this function. Requests are coalesced
526 // by OID and distribution key.
527 // TODO(jalopezg): this may be a private member function; that, however, requires additional changes given that
528 // `RDaosContainer::MultiObjectRWOperation_t` cannot be forward-declared
531 auto clusterId = clusterKey.fClusterId;
532 std::vector<RDaosSealedPageLocator> onDiskPages;
533
534 unsigned clusterBufSz = 0, nPages = 0;
535 auto pageZeroMap = std::make_unique<ROOT::Internal::ROnDiskPageMap>();
536 PrepareLoadCluster(
540 const auto &pageLocator = pageInfo.GetLocator();
541 const auto pageId = pageLocator.GetPosition<RNTupleLocatorObject64>().GetLocation();
542 const auto pageBufferSize = pageLocator.GetNBytesOnStorage() + pageInfo.HasChecksum() * kNBytesPageChecksum;
544 pageLocator.GetNBytesOnStorage(), pageBufferSize});
545
546 ++nPages;
548 });
549
550 auto clusterBuffer = new unsigned char[clusterBufSz];
551 auto pageMap =
552 std::make_unique<ROOT::Internal::ROnDiskPageMapHeap>(std::unique_ptr<unsigned char[]>(clusterBuffer));
553
554 // Fill the cluster page map and the read requests for the RDaosContainer::ReadV() call
555 for (const auto &sealedLoc : onDiskPages) {
557 pageMap->Register(key, ROOT::Internal::ROnDiskPage(clusterBuffer, sealedLoc.fBufferSize));
558
559 // Prepare new read request batched up by object ID and distribution key
560 d_iov_t iov;
561 d_iov_set(&iov, clusterBuffer, sealedLoc.fBufferSize);
562
563 RDaosKey daosKey = GetPageDaosKey(fNTupleIndex, sealedLoc.fPageId);
566 itReq->second.Insert(daosKey.fAkey, iov);
567
568 clusterBuffer += sealedLoc.fBufferSize;
569 }
570 fCounters->fNPageRead.Add(nPages);
571 fCounters->fSzReadPayload.Add(clusterBufSz);
572
573 auto cluster = std::make_unique<RCluster>(clusterId);
574 cluster->Adopt(std::move(pageMap));
575 cluster->Adopt(std::move(pageZeroMap));
576 for (auto colId : clusterKey.fPhysicalColumnSet)
577 cluster->SetColumnAvailable(colId);
578 return cluster;
579 };
580
581 fCounters->fNClusterLoaded.Add(clusterKeys.size());
582
583 std::vector<std::unique_ptr<ROOT::Internal::RCluster>> clusters;
585 for (auto key : clusterKeys) {
586 clusters.emplace_back(fnPrepareSingleCluster(key, readRequests));
587 }
588
589 {
590 Detail::RNTupleAtomicTimer timer(fCounters->fTimeWallRead, fCounters->fTimeCpuRead);
591 if (int err = fDaosContainer->ReadV(readRequests))
592 throw ROOT::RException(R__FAIL("ReadV: error" + std::string(d_errstr(err))));
593 }
594 fCounters->fNReadV.Inc();
595 fCounters->fNRead.Add(readRequests.size());
596
597 return clusters;
598}
599
601{
602 R__LOG_WARNING(ROOT::Internal::NTupleLog()) << "DAOS-backed sources have no associated StreamerInfo to load.";
603}
604
605std::unique_ptr<ROOT::Internal::RPageSource>
#define R__FORWARD_ERROR(res)
Short-hand to return an RResult<T> in an error state (i.e. after checking)
Definition RError.hxx:303
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
Definition RError.hxx:299
#define R__LOG_WARNING(...)
Definition RLogger.hxx:357
#define h(i)
Definition RSha256.hxx:106
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t bytes
UInt_t Hash(const TString &s)
Definition TString.h:503
#define _(A, B)
Definition cfortran.h:108
A RDaosContainer provides read/write access to objects in a given container.
Definition RDaos.hxx:156
RDaosObject::DistributionKey_t DistributionKey_t
Definition RDaos.hxx:159
std::unordered_map< ROidDkeyPair, RWOperation, ROidDkeyPair::Hash > MultiObjectRWOperation_t
Definition RDaos.hxx:230
RDaosObject::AttributeKey_t AttributeKey_t
Definition RDaos.hxx:160
std::unique_ptr< ROOT::Internal::RPageSink > CloneAsHidden(std::string_view name, const ROOT::RNTupleWriteOptions &opts) const final
Creates a new sink with the same underlying storage as this but writing to a different RNTuple named ...
RNTupleLocator CommitPageImpl(ColumnHandle_t columnHandle, const ROOT::Internal::RPage &page) final
std::vector< RNTupleLocator > CommitSealedPageVImpl(std::span< RPageStorage::RSealedPageGroup > ranges, const std::vector< bool > &mask) final
Vector commit of preprocessed pages.
void WriteNTupleFooter(const void *data, size_t nbytes, size_t lenFooter)
std::uint64_t StageClusterImpl() final
Returns the number of bytes written to storage (excluding metadata)
RNTupleLocator CommitClusterGroupImpl(unsigned char *serializedPageList, std::uint32_t length) final
Returns the locator of the page list envelope of the given buffer that contains the serialized page l...
void WriteNTupleHeader(const void *data, size_t nbytes, size_t lenHeader)
void InitImpl(unsigned char *serializedHeader, std::uint32_t length) final
RPageSinkDaos(std::string_view ntupleName, std::string_view uri, const ROOT::RNTupleWriteOptions &options)
RNTupleLocator CommitSealedPageImpl(ROOT::DescriptorId_t physicalColumnId, const RPageStorage::RSealedPage &sealedPage) final
Storage provider that reads ntuple pages from a DAOS container.
void LoadStreamerInfo() final
Forces the loading of ROOT StreamerInfo from the underlying file.
std::string GetObjectClass() const
Return the object class used for user data OIDs in this ntuple.
std::unique_ptr< RPageSource > CloneImpl() const final
The cloned page source creates a new connection to the pool/container.
void LoadSealedPageImpl(const RNTupleLocator &locator, RSealedPage &sealedPage) final
std::vector< std::unique_ptr< ROOT::Internal::RCluster > > LoadClusters(std::span< ROOT::Internal::RCluster::RKey > clusterKeys) final
Populates all the pages of the given cluster ids and columns; it is possible that some columns do not...
std::unique_ptr< RPageSource > OpenWithDifferentAnchor(const ROOT::Internal::RNTupleLink &anchorLink, const ROOT::RNTupleReadOptions &options={}) final
Creates a new PageSource using the same underlying file as this but referring to a different RNTuple,...
std::unique_ptr< RDaosContainer > fDaosContainer
A container that stores object data (header/footer, pages, etc.)
RPageSourceDaos(std::string_view ntupleName, std::string_view uri, const ROOT::RNTupleReadOptions &options)
ROOT::RNTupleDescriptor AttachImpl(ROOT::Internal::RNTupleSerializer::EDescriptorDeserializeMode mode) final
LoadStructureImpl() has been called before AttachImpl() is called
DAOS-specific user-tunable settings for storing ntuples.
An in-memory subset of the packed and compressed pages of a cluster.
Definition RCluster.hxx:147
Helper class to compress data blocks in the ROOT compression frame format.
static std::size_t Zip(const void *from, std::size_t nbytes, int compression, void *to)
Returns the size of the compressed data, written into the provided output buffer.
Helper class to uncompress data blocks in the ROOT compression frame format.
static void Unzip(const void *from, size_t nbytes, size_t dataLen, void *to)
The nbytes parameter provides the size ls of the from buffer.
A helper class for piece-wise construction of an RNTupleDescriptor.
void SetVersion(std::uint16_t versionEpoch, std::uint16_t versionMajor, std::uint16_t versionMinor, std::uint16_t versionPatch)
const RNTupleDescriptor & GetDescriptor() const
void AddToOnDiskFooterSize(std::uint64_t size)
The real footer size also include the page list envelopes.
A helper class for serializing and deserialization of the RNTuple binary format.
static RResult< std::uint32_t > DeserializeString(const void *buffer, std::uint64_t bufSize, std::string &val)
static std::uint32_t SerializeUInt32(std::uint32_t val, void *buffer)
static std::uint32_t DeserializeUInt32(const void *buffer, std::uint32_t &val)
static std::uint32_t SerializeUInt16(std::uint16_t val, void *buffer)
static RResult< void > DeserializePageList(const void *buffer, std::uint64_t bufSize, ROOT::DescriptorId_t clusterGroupId, RNTupleDescriptor &desc, EDescriptorDeserializeMode mode)
static std::uint32_t SerializeString(const std::string &val, void *buffer)
static std::uint32_t DeserializeUInt16(const void *buffer, std::uint16_t &val)
static std::uint32_t DeserializeUInt64(const void *buffer, std::uint64_t &val)
static std::uint32_t SerializeUInt64(std::uint64_t val, void *buffer)
A page as being stored on disk, that is packed and compressed.
Definition RCluster.hxx:40
Base class for a sink with a physical storage backend.
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSink.
Abstract interface to read data from an ntuple.
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSource.
A page is a slice of a column that is mapped into memory.
Definition RPage.hxx:43
Base class for all ROOT issued exceptions.
Definition RError.hxx:78
The on-storage metadata of an RNTuple.
RNTupleLocator payload that is common for object stores using 64bit location information.
std::uint64_t GetLocation() const
Generic information about the physical location of data.
Common user-tunable settings for reading RNTuples.
Common user-tunable settings for storing RNTuples.
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
Definition RError.hxx:197
@ OC_SX
Definition daos.h:129
const char * d_errstr(int rc)
static void d_iov_set(d_iov_t *iov, void *buf, size_t size)
Definition daos.h:50
uint16_t daos_oclass_id_t
Definition daos.h:135
ROOT::RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.
std::unique_ptr< T[]> MakeUninitArray(std::size_t size)
Make an array of default-initialized elements.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
A pair of <object ID, distribution key> that can be used to issue a fetch/update request for multiple...
Definition RDaos.hxx:165
Describes a read/write operation on multiple attribute keys under the same object ID and distribution...
Definition RDaos.hxx:189
Entry point for an RNTuple in a DAOS container.
std::uint32_t fNBytesFooter
The size of the compressed ntuple footer.
std::uint64_t fVersionAnchor
Allows for evolving the struct in future versions.
std::string fObjClass
The object class for user data OIDs, e.g. SX
std::uint16_t fVersionEpoch
Version of the binary format supported by the writer.
RResult< std::uint32_t > Deserialize(const void *buffer, std::uint32_t bufSize)
std::uint32_t fLenHeader
The size of the uncompressed ntuple header.
std::uint32_t fLenFooter
The size of the uncompressed ntuple footer.
std::uint32_t fNBytesHeader
The size of the compressed ntuple header.
static constexpr std::size_t kOCNameMaxLength
This limit is currently not defined in any header and any call to daos_oclass_id2name() within DAOS u...
Definition RDaos.hxx:107
The identifiers that specifies the content of a (partial) cluster.
Definition RCluster.hxx:151
On-disk pages within a page source are identified by the column and page number.
Definition RCluster.hxx:50
A sealed page contains the bytes of a page as written to storage (packed & compressed).
Information about a single page in the context of a cluster's page range.
iovec for memory buffer
Definition daos.h:37
uint64_t hi
Definition daos.h:147
uint64_t lo
Definition daos.h:146
TMarker m
Definition textangle.C:8