50enum EDaosMapping { kOidPerCluster, kOidPerPage };
54 DistributionKey_t fDkey;
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;
74static constexpr EDaosMapping kDefaultDaosMapping = kOidPerCluster;
76template <EDaosMapping mapping>
78 long unsigned columnId,
long unsigned pageCount)
80 if constexpr (mapping == kOidPerCluster) {
83 static_cast<DistributionKey_t
>(columnId),
static_cast<AttributeKey_t
>(pageCount)};
84 }
else if constexpr (mapping == kOidPerPage) {
87 kDistributionKeyDefault, kAttributeKeyDefault};
93 std::string fPoolLabel;
95 std::string fContainerLabel;
101RDaosURI ParseDaosURI(std::string_view uri)
103 std::regex re(
"daos://([^/]+)/(.+)");
105 if (!std::regex_match(uri.data(),
m, re))
114 auto position =
static_cast<uint32_t
>(address.
fLocation & 0xFFFFFFFF);
116 return {position,
offset};
123 uint64_t address = (position & 0xFFFFFFFF) | (
offset << 32);
134struct RDaosContainerNTupleLocator {
137 std::optional<ROOT::Experimental::Internal::RDaosNTupleAnchor> fAnchor;
140 RDaosContainerNTupleLocator() =
default;
141 explicit RDaosContainerNTupleLocator(
const std::string &ntupleName) : fName(ntupleName), fIndex(
Hash(ntupleName)){};
143 bool IsValid() {
return fAnchor.has_value() && fAnchor->fNBytesHeader; }
148 uint64_t
h = std::hash<std::string>{}(ntupleName);
150 auto seed =
static_cast<uint32_t
>(
h >> 32);
151 seed ^=
static_cast<uint32_t
>(
h & 0xffffffff) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
153 return (hash == kReservedIndex) ? kReservedIndex + 1 : hash;
159 std::unique_ptr<unsigned char[]> buffer, zipBuffer;
160 auto &anchor = fAnchor.emplace();
166 buffer = MakeUninitArray<unsigned char>(anchorSize);
167 if ((err = cont.
ReadSingleAkey(buffer.get(), anchorSize, oidMetadata, kDistributionKeyDefault,
168 kAttributeKeyAnchor, kCidMetadata))) {
172 anchor.Deserialize(buffer.get(), anchorSize).Unwrap();
175 R__FAIL(
"unsupported RNTuple epoch version: " + std::to_string(anchor.fVersionEpoch)));
179 buffer = MakeUninitArray<unsigned char>(anchor.fLenHeader);
180 zipBuffer = MakeUninitArray<unsigned char>(anchor.fNBytesHeader);
181 if ((err = cont.
ReadSingleAkey(zipBuffer.get(), anchor.fNBytesHeader, oidMetadata, kDistributionKeyDefault,
182 kAttributeKeyHeader, kCidMetadata)))
189 buffer = MakeUninitArray<unsigned char>(anchor.fLenFooter);
190 zipBuffer = MakeUninitArray<unsigned char>(anchor.fNBytesFooter);
191 if ((err = cont.
ReadSingleAkey(zipBuffer.get(), anchor.fNBytesFooter, oidMetadata, kDistributionKeyDefault,
192 kAttributeKeyFooter, kCidMetadata)))
201 static std::pair<RDaosContainerNTupleLocator, ROOT::Experimental::Internal::RNTupleDescriptorBuilder>
204 auto result = std::make_pair(RDaosContainerNTupleLocator(ntupleName),
208 auto &builder =
result.second;
210 if (
int err = loc.InitNTupleDescriptorBuilder(cont, builder); !err) {
214 R__FAIL(
"LocateNTuple: ntuple name '" + ntupleName +
"' unavailable in this container."));
228 if (buffer !=
nullptr) {
229 auto bytes =
reinterpret_cast<unsigned char *
>(buffer);
248 return R__FAIL(
"DAOS anchor too short");
251 auto bytes =
reinterpret_cast<const unsigned char *
>(buffer);
254 return R__FAIL(
"unsupported DAOS anchor version: " + std::to_string(fVersionAnchor));
268 return result.Unwrap() + 32;
282 static std::once_flag once;
283 std::call_once(once, []() {
285 <<
"Do not store real data with this version of RNTuple!";
287 fCompressor = std::make_unique<RNTupleCompressor>();
298 if (oclass.IsUnknown())
303 fCageSizeLimit = std::max(cageSz, pageSz);
305 auto args = ParseDaosURI(fURI);
306 auto pool = std::make_shared<RDaosPool>(args.fPoolLabel);
308 fDaosContainer = std::make_unique<RDaosContainer>(pool, args.fContainerLabel,
true);
309 fDaosContainer->SetDefaultObjectClass(oclass);
311 auto [locator,
_] = RDaosContainerNTupleLocator::LocateNTuple(*fDaosContainer, fNTupleName);
312 fNTupleIndex = locator.GetIndex();
314 auto zipBuffer = MakeUninitArray<unsigned char>(
length);
315 auto szZipHeader = fCompressor->Zip(serializedHeader,
length, GetWriteOptions().GetCompression(),
317 WriteNTupleHeader(zipBuffer.get(), szZipHeader,
length);
327 sealedPage = SealPage(page, *element);
331 return CommitSealedPageImpl(columnHandle.
fPhysicalId, sealedPage);
338 auto offsetData = fPageId.fetch_add(1);
339 DescriptorId_t clusterId = fDescriptorBuilder.GetDescriptor().GetNActiveClusters();
343 RDaosKey daosKey = GetPageDaosKey<kDefaultDaosMapping>(fNTupleIndex, clusterId, physicalColumnId, offsetData);
344 fDaosContainer->WriteSingleAkey(sealedPage.
GetBuffer(), sealedPage.
GetBufferSize(), daosKey.fOid, daosKey.fDkey,
349 result.fPosition = EncodeDaosPagePosition(offsetData);
352 fCounters->fNPageCommitted.Inc();
358std::vector<ROOT::Experimental::RNTupleLocator>
360 const std::vector<bool> &
mask)
363 std::vector<ROOT::Experimental::RNTupleLocator> locators;
364 auto nPages =
mask.size();
365 locators.reserve(nPages);
367 const uint32_t maxCageSz = fCageSizeLimit;
368 const bool useCaging = fCageSizeLimit > 0;
371 DescriptorId_t clusterId = fDescriptorBuilder.GetDescriptor().GetNActiveClusters();
372 int64_t payloadSz = 0;
373 std::size_t positionOffset;
374 uint32_t positionIndex;
377 for (
auto &range : ranges) {
382 positionIndex = useCaging ? fPageId.fetch_add(1) : fPageId.load();
384 for (
auto sealedPageIt = range.fFirst; sealedPageIt != range.fLast; ++sealedPageIt) {
389 positionIndex = fPageId.fetch_add(1);
396 GetPageDaosKey<kDefaultDaosMapping>(fNTupleIndex, clusterId, range.fPhysicalColumnId, positionIndex);
399 it->second.Insert(daosKey.fAkey, pageIov);
402 locator.
fPosition = EncodeDaosPagePosition(positionIndex, positionOffset);
406 locators.push_back(locator);
412 fNBytesCurrentCluster += payloadSz;
416 if (
int err = fDaosContainer->WriteV(writeRequests))
420 fCounters->fNPageCommitted.Add(nPages);
421 fCounters->fSzWritePayload.Add(payloadSz);
428 return std::exchange(fNBytesCurrentCluster, 0);
435 auto bufPageListZip = MakeUninitArray<unsigned char>(
length);
436 auto szPageListZip = fCompressor->Zip(serializedPageList,
length, GetWriteOptions().GetCompression(),
439 auto offsetData = fClusterGroupId.fetch_add(1);
440 fDaosContainer->WriteSingleAkey(
441 bufPageListZip.get(), szPageListZip,
442 daos_obj_id_t{kOidLowPageList, static_cast<decltype(daos_obj_id_t::hi)>(fNTupleIndex)}, kDistributionKeyDefault,
443 offsetData, kCidMetadata);
446 result.fBytesOnStorage = szPageListZip;
448 fCounters->fSzWritePayload.Add(
static_cast<int64_t
>(szPageListZip));
455 auto bufFooterZip = MakeUninitArray<unsigned char>(
length);
456 auto szFooterZip = fCompressor->Zip(serializedFooter,
length, GetWriteOptions().GetCompression(),
458 WriteNTupleFooter(bufFooterZip.get(), szFooterZip,
length);
464 fDaosContainer->WriteSingleAkey(
466 kDistributionKeyDefault, kAttributeKeyHeader, kCidMetadata);
467 fNTupleAnchor.fLenHeader = lenHeader;
468 fNTupleAnchor.fNBytesHeader = nbytes;
473 fDaosContainer->WriteSingleAkey(
475 kDistributionKeyDefault, kAttributeKeyFooter, kCidMetadata);
476 fNTupleAnchor.fLenFooter = lenFooter;
477 fNTupleAnchor.fNBytesFooter = nbytes;
483 auto buffer = MakeUninitArray<unsigned char>(ntplSize);
484 fNTupleAnchor.Serialize(buffer.get());
485 fDaosContainer->WriteSingleAkey(
486 buffer.get(), ntplSize,
daos_obj_id_t{kOidLowMetadata, static_cast<decltype(daos_obj_id_t::hi)>(fNTupleIndex)},
487 kDistributionKeyDefault, kAttributeKeyAnchor, kCidMetadata);
496 fClusterPool(std::make_unique<
RClusterPool>(*this, options.GetClusterBunchSize()))
500 auto args = ParseDaosURI(uri);
501 auto pool = std::make_shared<RDaosPool>(args.fPoolLabel);
502 fDaosContainer = std::make_unique<RDaosContainer>(pool, args.fContainerLabel);
510 std::unique_ptr<unsigned char[]> buffer, zipBuffer;
512 auto [locator, descBuilder] = RDaosContainerNTupleLocator::LocateNTuple(*fDaosContainer, fNTupleName);
513 if (!locator.IsValid())
515 R__FAIL(
"Attach: requested ntuple '" + fNTupleName +
"' is not present in DAOS container."));
518 if (oclass.IsUnknown())
521 fDaosContainer->SetDefaultObjectClass(oclass);
522 fNTupleIndex = locator.GetIndex();
525 auto desc = descBuilder.MoveDescriptor();
527 for (
const auto &cgDesc : desc.GetClusterGroupIterable()) {
528 buffer = MakeUninitArray<unsigned char>(cgDesc.GetPageListLength());
529 zipBuffer = MakeUninitArray<unsigned char>(cgDesc.GetPageListLocator().fBytesOnStorage);
530 fDaosContainer->ReadSingleAkey(
531 zipBuffer.get(), cgDesc.GetPageListLocator().fBytesOnStorage, oidPageList, kDistributionKeyDefault,
534 cgDesc.GetPageListLength(), buffer.get());
544 return fDaosContainer->GetDefaultObjectClass().ToString();
554 auto descriptorGuard = GetSharedDescriptorGuard();
555 const auto &clusterDescriptor = descriptorGuard->GetClusterDescriptor(clusterId);
556 pageInfo = clusterDescriptor.GetPageRange(physicalColumnId).Find(clusterIndex.
GetIndex());
576 RDaosKey daosKey = GetPageDaosKey<kDefaultDaosMapping>(fNTupleIndex, clusterId, physicalColumnId, position);
578 auto cageHeadBuffer = MakeUninitArray<unsigned char>(bufSize);
579 fDaosContainer->ReadSingleAkey(cageHeadBuffer.get(), bufSize, daosKey.fOid, daosKey.fDkey, daosKey.fAkey);
582 RDaosKey daosKey = GetPageDaosKey<kDefaultDaosMapping>(
585 daosKey.fOid, daosKey.fDkey, daosKey.fAkey);
597 const auto clusterId = clusterInfo.
fClusterId;
598 const auto &pageInfo = clusterInfo.
fPageInfo;
601 const auto elementSize = element->
GetSize();
602 const auto elementInMemoryType = element->GetIdentifier().fInMemoryType;
605 auto pageZero = fPageAllocator->NewPage(elementSize, pageInfo.fNElements);
606 pageZero.GrowUnchecked(pageInfo.fNElements);
607 memset(pageZero.GetBuffer(), 0, pageZero.GetNBytes());
608 pageZero.SetWindow(clusterInfo.
fColumnOffset + pageInfo.fFirstInPage,
610 return fPagePool.RegisterPage(std::move(pageZero),
RPagePool::RKey{columnId, elementInMemoryType});
616 sealedPage.
SetBufferSize(pageInfo.fLocator.fBytesOnStorage + pageInfo.fHasChecksum * kNBytesPageChecksum);
617 std::unique_ptr<unsigned char[]> directReadBuffer;
622 R__FAIL(
"accessing caged pages is only supported in conjunction with cluster cache"));
625 directReadBuffer = MakeUninitArray<unsigned char>(sealedPage.
GetBufferSize());
626 RDaosKey daosKey = GetPageDaosKey<kDefaultDaosMapping>(
628 fDaosContainer->ReadSingleAkey(directReadBuffer.get(), sealedPage.
GetBufferSize(), daosKey.fOid, daosKey.fDkey,
630 fCounters->fNPageRead.Inc();
631 fCounters->fNRead.Inc();
633 sealedPage.
SetBuffer(directReadBuffer.get());
635 if (!fCurrentCluster || (fCurrentCluster->GetId() != clusterId) || !fCurrentCluster->ContainsColumn(columnId))
636 fCurrentCluster = fClusterPool->GetCluster(clusterId, fActivePhysicalColumns.ToColumnSet());
637 R__ASSERT(fCurrentCluster->ContainsColumn(columnId));
641 if (!cachedPageRef.Get().IsNull())
642 return cachedPageRef;
645 auto onDiskPage = fCurrentCluster->GetOnDiskPage(key);
647 sealedPage.
SetBuffer(onDiskPage->GetAddress());
653 newPage = UnsealPage(sealedPage, *element).Unwrap();
654 fCounters->fSzUnzip.Add(elementSize * pageInfo.fNElements);
659 fCounters->fNPageUnsealed.Inc();
660 return fPagePool.RegisterPage(std::move(newPage),
RPagePool::RKey{columnId, elementInMemoryType});
663std::unique_ptr<ROOT::Experimental::Internal::RPageSource>
667 return std::unique_ptr<RPageSourceDaos>(clone);
670std::vector<std::unique_ptr<ROOT::Experimental::Internal::RCluster>>
673 struct RDaosSealedPageLocator {
677 std::uint64_t fPosition = 0;
678 std::uint64_t fCageOffset = 0;
679 std::uint64_t fDataSize = 0;
680 std::uint64_t fBufferSize = 0;
687 auto fnPrepareSingleCluster = [&](
const RCluster::RKey &clusterKey,
692 std::unordered_map<std::uint32_t, std::vector<RDaosSealedPageLocator>> onDiskPages;
694 unsigned clusterBufSz = 0, nPages = 0;
695 auto pageZeroMap = std::make_unique<ROnDiskPageMap>();
697 clusterKey, *pageZeroMap,
700 const auto &pageLocator = pageInfo.
fLocator;
701 uint32_t position,
offset;
703 auto [itLoc,
_] = onDiskPages.emplace(position, std::vector<RDaosSealedPageLocator>());
704 auto pageBufferSize = pageLocator.fBytesOnStorage + pageInfo.
fHasChecksum * kNBytesPageChecksum;
706 itLoc->second.push_back(
707 {clusterId, physicalColumnId, pageNo, position,
offset, pageLocator.fBytesOnStorage, pageBufferSize});
709 clusterBufSz += pageBufferSize;
712 auto clusterBuffer =
new unsigned char[clusterBufSz];
713 auto pageMap = std::make_unique<ROnDiskPageMapHeap>(std::unique_ptr<
unsigned char[]>(clusterBuffer));
715 auto cageBuffer = clusterBuffer;
717 for (
auto &[cageIndex, pageVec] : onDiskPages) {
718 auto columnId = pageVec[0].fColumnId;
719 std::size_t cageSz = 0;
721 for (
auto &s : pageVec) {
722 assert(columnId == s.fColumnId);
723 assert(cageIndex == s.fPosition);
726 pageMap->Register(key,
ROnDiskPage(cageBuffer + s.fCageOffset, s.fBufferSize));
727 cageSz += s.fBufferSize;
734 RDaosKey daosKey = GetPageDaosKey<kDefaultDaosMapping>(fNTupleIndex, clusterId, columnId, cageIndex);
737 itReq->second.Insert(daosKey.fAkey, iov);
739 cageBuffer += cageSz;
741 fCounters->fNPageRead.Add(nPages);
742 fCounters->fSzReadPayload.Add(clusterBufSz);
744 auto cluster = std::make_unique<RCluster>(clusterId);
745 cluster->Adopt(std::move(pageMap));
746 cluster->Adopt(std::move(pageZeroMap));
748 cluster->SetColumnAvailable(colId);
752 fCounters->fNClusterLoaded.Add(clusterKeys.size());
754 std::vector<std::unique_ptr<ROOT::Experimental::Internal::RCluster>> clusters;
756 for (
auto key : clusterKeys) {
757 clusters.emplace_back(fnPrepareSingleCluster(key, readRequests));
762 if (
int err = fDaosContainer->ReadV(readRequests))
765 fCounters->fNReadV.Inc();
766 fCounters->fNRead.Add(readRequests.size());
#define R__FORWARD_ERROR(res)
Short-hand to return an RResult<T> in an error state (i.e. after checking)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#define R__LOG_WARNING(...)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
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 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 offset
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 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)
Record wall time and CPU time between construction and destruction.
Managed a set of clusters containing compressed and packed pages.
std::size_t GetSize() const
RColumnElementBase * GetElement() const
A RDaosContainer provides read/write access to objects in a given container.
RDaosObject::DistributionKey_t DistributionKey_t
std::unordered_map< ROidDkeyPair, RWOperation, ROidDkeyPair::Hash > MultiObjectRWOperation_t
int ReadSingleAkey(void *buffer, std::size_t length, daos_obj_id_t oid, DistributionKey_t dkey, AttributeKey_t akey, ObjClassId_t cid)
Read data from a single object attribute key to the given buffer.
RDaosObject::AttributeKey_t AttributeKey_t
static Writer_t MakeMemCopyWriter(unsigned char *dest)
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 SetOnDiskHeaderSize(std::uint64_t size)
void AddToOnDiskFooterSize(std::uint64_t size)
The real footer size also include the page list envelopes.
const RNTupleDescriptor & GetDescriptor() const
A helper class for serializing and deserialization of the RNTuple binary format.
static std::uint32_t DeserializeUInt16(const void *buffer, std::uint16_t &val)
static RResult< void > DeserializeHeader(const void *buffer, std::uint64_t bufSize, RNTupleDescriptorBuilder &descBuilder)
static RResult< void > DeserializeFooter(const void *buffer, std::uint64_t bufSize, RNTupleDescriptorBuilder &descBuilder)
static std::uint32_t SerializeString(const std::string &val, void *buffer)
static std::uint32_t DeserializeUInt32(const void *buffer, std::uint32_t &val)
static std::uint32_t SerializeUInt64(std::uint64_t val, void *buffer)
static RResult< void > DeserializePageList(const void *buffer, std::uint64_t bufSize, DescriptorId_t clusterGroupId, RNTupleDescriptor &desc)
static std::uint32_t DeserializeUInt64(const void *buffer, std::uint64_t &val)
static RResult< std::uint32_t > DeserializeString(const void *buffer, std::uint64_t bufSize, std::string &val)
static std::uint32_t SerializeUInt16(std::uint16_t val, void *buffer)
static std::uint32_t SerializeUInt32(std::uint32_t val, void *buffer)
A page as being stored on disk, that is packed and compressed.
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.
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...
RPageSinkDaos(std::string_view ntupleName, std::string_view uri, const RNTupleWriteOptions &options)
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)
void WriteNTupleHeader(const void *data, size_t nbytes, size_t lenHeader)
void InitImpl(unsigned char *serializedHeader, std::uint32_t length) final
~RPageSinkDaos() override
RNTupleLocator CommitPageImpl(ColumnHandle_t columnHandle, const RPage &page) final
RNTupleLocator CommitSealedPageImpl(DescriptorId_t physicalColumnId, const RPageStorage::RSealedPage &sealedPage) final
std::vector< RNTupleLocator > CommitSealedPageVImpl(std::span< RPageStorage::RSealedPageGroup > ranges, const std::vector< bool > &mask) final
Vector commit of preprocessed pages.
void CommitDatasetImpl() final
std::unique_ptr< RNTupleCompressor > fCompressor
Helper to zip pages and header/footer; includes a 16MB (kMAXZIPBUF) zip buffer.
Storage provider that reads ntuple pages from a DAOS container.
std::string GetObjectClass() const
Return the object class used for user data OIDs in this ntuple.
RPageRef LoadPageImpl(ColumnHandle_t columnHandle, const RClusterInfo &clusterInfo, ClusterSize_t::ValueType idxInCluster) final
std::vector< std::unique_ptr< RCluster > > LoadClusters(std::span< RCluster::RKey > clusterKeys) final
Populates all the pages of the given cluster ids and columns; it is possible that some columns do not...
RPageSourceDaos(std::string_view ntupleName, std::string_view uri, const RNTupleReadOptions &options)
~RPageSourceDaos() override
void LoadSealedPage(DescriptorId_t physicalColumnId, RClusterIndex clusterIndex, RSealedPage &sealedPage) final
Read the packed and compressed bytes of a page into the memory buffer provided by sealedPage.
RNTupleDescriptor AttachImpl() final
LoadStructureImpl() has been called before AttachImpl() is called
std::unique_ptr< RDaosContainer > fDaosContainer
A container that stores object data (header/footer, pages, etc.)
std::unique_ptr< RPageSource > CloneImpl() const final
The cloned page source creates a new connection to the pool/container.
Abstract interface to read data from an ntuple.
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSource.
Stores information about the cluster in which this page resides.
A page is a slice of a column that is mapped into memory.
std::size_t GetNBytes() const
The space taken by column elements in the buffer.
void SetWindow(const NTupleSize_t rangeFirst, const RClusterInfo &clusterInfo)
Seek the page to a certain position of the column.
static const void * GetPageZeroBuffer()
Return a pointer to the page zero buffer used if there is no on-disk data for a particular deferred c...
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
DescriptorId_t GetClusterId() const
ClusterSize_t::ValueType GetIndex() const
Base class for all ROOT issued exceptions.
The on-storage meta-data of an ntuple.
const std::string & GetName() const
Common user-tunable settings for reading ntuples.
DAOS-specific user-tunable settings for storing ntuples.
uint32_t GetMaxCageSize() const
const std::string & GetObjectClass() const
Common user-tunable settings for storing ntuples.
std::size_t GetMaxUnzippedPageSize() const
void ThrowOnError()
Short-hand method to throw an exception in the case of errors.
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
static constexpr std::uint16_t kVersionEpoch
const char * d_errstr(int rc)
static void d_iov_set(d_iov_t *iov, void *buf, size_t size)
uint16_t daos_oclass_id_t
std::unique_ptr< T[]> MakeUninitArray(std::size_t size)
Make an array of default-initialized elements.
std::uint32_t ntuple_index_t
RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
The identifiers that specifies the content of a (partial) cluster.
DescriptorId_t fClusterId
ColumnSet_t fPhysicalColumnSet
A pair of <object ID, distribution key> that can be used to issue a fetch/update request for multiple...
Describes a read/write operation on multiple attribute keys under the same object ID and distribution...
Entry point for an RNTuple in a DAOS container.
std::uint32_t fNBytesFooter
The size of the compressed ntuple footer.
RResult< std::uint32_t > Deserialize(const void *buffer, std::uint32_t bufSize)
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 fVersionPatch
std::uint32_t Serialize(void *buffer) const
std::uint16_t fVersionEpoch
Version of the binary format supported by the writer.
std::uint16_t fVersionMinor
std::uint32_t fLenHeader
The size of the uncompressed ntuple header.
static std::uint32_t GetSize()
std::uint32_t fLenFooter
The size of the uncompressed ntuple footer.
std::uint16_t fVersionMajor
std::uint32_t fNBytesHeader
The size of the compressed ntuple header.
Wrap around a daos_oclass_id_t.
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...
On-disk pages within a page source are identified by the column and page number.
Summarizes cluster-level information that are necessary to load a certain page.
DescriptorId_t fClusterId
std::uint64_t fColumnOffset
The first element number of the page's column in the given cluster.
RClusterDescriptor::RPageRange::RPageInfoExtended fPageInfo
Location of the page on disk.
DescriptorId_t fPhysicalId
A sealed page contains the bytes of a page as written to storage (packed & compressed).
const void * GetBuffer() const
void SetHasChecksum(bool hasChecksum)
void SetNElements(std::uint32_t nElements)
void SetBuffer(const void *buffer)
void SetBufferSize(std::size_t bufferSize)
RResult< void > VerifyChecksumIfEnabled() const
std::size_t GetBufferSize() const
std::size_t GetDataSize() const
RNTupleLocator payload that is common for object stores using 64bit location information.
Generic information about the physical location of data.
std::uint64_t fBytesOnStorage
std::uint8_t fReserved
Reserved for use by concrete storage backends.
ELocatorType fType
For non-disk locators, the value for the Type field.
std::variant< std::uint64_t, RNTupleLocatorObject64 > fPosition
Simple on-disk locators consisting of a 64-bit offset use variant type uint64_t; extended locators ha...
const T & GetPosition() const