@@ -49,12 +49,6 @@ using ROOT::Internal::RNTupleCompressor;
4949using ROOT ::Internal::RNTupleDecompressor;
5050using ROOT ::Internal::RNTupleSerializer;
5151
52- // / \brief RNTuple page-DAOS mappings
53- enum EDaosMapping {
54- kOidPerCluster ,
55- kOidPerPage
56- };
57-
5852struct RDaosKey {
5953 daos_obj_id_t fOid ;
6054 DistributionKey_t fDkey ;
@@ -77,21 +71,11 @@ static constexpr decltype(daos_obj_id_t::lo) kOidLowPageList = -2;
7771
7872static constexpr daos_oclass_id_t kCidMetadata = OC_SX ;
7973
80- static constexpr EDaosMapping kDefaultDaosMapping = kOidPerCluster ;
81-
82- template <EDaosMapping mapping>
83- RDaosKey GetPageDaosKey (ROOT ::Experimental::Internal::ntuple_index_t ntplId, long unsigned clusterId,
84- long unsigned columnId, long unsigned pageCount)
74+ RDaosKey GetPageDaosKey (ROOT ::Experimental::Internal::ntuple_index_t ntplId, long unsigned pageCount)
8575{
86- if constexpr (mapping == kOidPerCluster ) {
87- return RDaosKey{daos_obj_id_t {static_cast <decltype (daos_obj_id_t ::lo)>(clusterId),
88- static_cast <decltype (daos_obj_id_t ::hi)>(ntplId)},
89- static_cast <DistributionKey_t>(columnId), static_cast <AttributeKey_t>(pageCount)};
90- } else if constexpr (mapping == kOidPerPage ) {
91- return RDaosKey{daos_obj_id_t {static_cast <decltype (daos_obj_id_t ::lo)>(pageCount),
92- static_cast <decltype (daos_obj_id_t ::hi)>(ntplId)},
93- kDistributionKeyDefault , kAttributeKeyDefault };
94- }
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)},
78+ kDistributionKeyDefault , kAttributeKeyDefault };
9579}
9680
9781struct RDaosURI {
@@ -308,15 +292,14 @@ ROOT::RNTupleLocator ROOT::Experimental::Internal::RPageSinkDaos::CommitPageImpl
308292}
309293
310294ROOT ::RNTupleLocator
311- ROOT ::Experimental::Internal::RPageSinkDaos::CommitSealedPageImpl(ROOT ::DescriptorId_t physicalColumnId ,
295+ ROOT ::Experimental::Internal::RPageSinkDaos::CommitSealedPageImpl(ROOT ::DescriptorId_t,
312296 const RPageStorage::RSealedPage &sealedPage)
313297{
314298 auto pageId = fPageId .fetch_add (1 );
315- ROOT ::DescriptorId_t clusterId = fDescriptorBuilder .GetDescriptor ().GetNActiveClusters ();
316299
317300 {
318301 Detail::RNTupleAtomicTimer timer (fCounters ->fTimeWallWrite , fCounters ->fTimeCpuWrite );
319- RDaosKey daosKey = GetPageDaosKey< kDefaultDaosMapping > (fNTupleIndex , clusterId, physicalColumnId , pageId);
302+ RDaosKey daosKey = GetPageDaosKey (fNTupleIndex , pageId);
320303 fDaosContainer ->WriteSingleAkey (sealedPage.GetBuffer (), sealedPage.GetBufferSize (), daosKey.fOid , daosKey.fDkey ,
321304 daosKey.fAkey );
322305 }
@@ -340,7 +323,6 @@ ROOT::Experimental::Internal::RPageSinkDaos::CommitSealedPageVImpl(std::span<RPa
340323 auto nPages = mask.size ();
341324 locators.reserve (nPages);
342325
343- ROOT ::DescriptorId_t clusterId = fDescriptorBuilder .GetDescriptor ().GetNActiveClusters ();
344326 int64_t payloadSz = 0 ;
345327
346328 // / Aggregate batch of requests by object ID and distribution key, determined by the ntuple-DAOS mapping
@@ -353,8 +335,7 @@ ROOT::Experimental::Internal::RPageSinkDaos::CommitSealedPageVImpl(std::span<RPa
353335 d_iov_t pageIov;
354336 d_iov_set (&pageIov, const_cast <void *>(s.GetBuffer ()), s.GetBufferSize ());
355337
356- RDaosKey daosKey =
357- GetPageDaosKey<kDefaultDaosMapping >(fNTupleIndex , clusterId, range.fPhysicalColumnId , pageId);
338+ RDaosKey daosKey = GetPageDaosKey (fNTupleIndex , pageId);
358339 auto odPair = RDaosContainer::ROidDkeyPair{daosKey.fOid , daosKey.fDkey };
359340 auto [it, ret] = writeRequests.emplace (odPair, RDaosContainer::RWOperation (odPair));
360341 it->second .Insert (daosKey.fAkey , pageIov);
@@ -515,9 +496,12 @@ std::string ROOT::Experimental::Internal::RPageSourceDaos::GetObjectClass() cons
515496 return fDaosContainer ->GetDefaultObjectClass ().ToString ();
516497}
517498
518- void ROOT::Experimental::Internal::RPageSourceDaos::LoadSealedPageImpl (const RNTupleLocator &, RSealedPage &)
499+ void ROOT::Experimental::Internal::RPageSourceDaos::LoadSealedPageImpl (const RNTupleLocator &locator,
500+ RSealedPage &sealedPage)
519501{
520- throw ROOT::RException (R__FAIL (" temporarily not implemented" ));
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 );
521505}
522506
523507ROOT ::Internal::RPageRef ROOT::Experimental::Internal::RPageSourceDaos::LoadPageImpl (ColumnHandle_t columnHandle,
@@ -539,8 +523,8 @@ ROOT::Internal::RPageRef ROOT::Experimental::Internal::RPageSourceDaos::LoadPage
539523
540524 if (fOptions .GetClusterCache () == ROOT ::RNTupleReadOptions::EClusterCache::kOff ) {
541525 directReadBuffer = MakeUninitArray<unsigned char >(sealedPage.GetBufferSize ());
542- RDaosKey daosKey = GetPageDaosKey< kDefaultDaosMapping >(
543- fNTupleIndex , clusterId, columnId , pageInfo.GetLocator ().GetPosition <RNTupleLocatorObject64>().GetLocation ());
526+ RDaosKey daosKey =
527+ GetPageDaosKey ( fNTupleIndex , pageInfo.GetLocator ().GetPosition <RNTupleLocatorObject64>().GetLocation ());
544528 fDaosContainer ->ReadSingleAkey (directReadBuffer.get (), sealedPage.GetBufferSize (), daosKey.fOid , daosKey.fDkey ,
545529 daosKey.fAkey );
546530 fCounters ->fNPageRead .Inc ();
@@ -633,8 +617,7 @@ ROOT::Experimental::Internal::RPageSourceDaos::LoadClusters(std::span<RCluster::
633617 d_iov_t iov;
634618 d_iov_set (&iov, clusterBuffer, sealedLoc.fBufferSize );
635619
636- RDaosKey daosKey = GetPageDaosKey<kDefaultDaosMapping >(fNTupleIndex , sealedLoc.fClusterId , sealedLoc.fColumnId ,
637- sealedLoc.fPageId );
620+ RDaosKey daosKey = GetPageDaosKey (fNTupleIndex , sealedLoc.fPageId );
638621 auto odPair = RDaosContainer::ROidDkeyPair{daosKey.fOid , daosKey.fDkey };
639622 auto [itReq, ret] = readRequests.emplace (odPair, RDaosContainer::RWOperation (odPair));
640623 itReq->second .Insert (daosKey.fAkey , iov);
0 commit comments