44#include <condition_variable>
54 static std::once_flag once;
55 std::call_once(once, []() {
57 <<
"Do not store real data with this version of RNTuple!";
59 fCompressor = std::make_unique<RNTupleCompressor>();
82 auto zipBuffer = std::make_unique<unsigned char[]>(
length);
83 auto szZipHeader = fCompressor->Zip(serializedHeader,
length, GetWriteOptions().GetCompression(),
85 fWriter->WriteNTupleHeader(zipBuffer.get(), szZipHeader,
length);
90 std::size_t bytesPacked)
92 std::uint64_t offsetData;
95 offsetData = fWriter->WriteBlob(sealedPage.
fBuffer, sealedPage.
fSize, bytesPacked);
99 result.fPosition = offsetData;
101 fCounters->fNPageCommitted.Inc();
102 fCounters->fSzWritePayload.Add(sealedPage.
fSize);
103 fNBytesCurrentCluster += sealedPage.
fSize;
114 sealedPage = SealPage(page, *element, GetWriteOptions().GetCompression());
118 return WriteSealedPage(sealedPage, element->GetPackedSize(page.
GetNElements()));
126 fDescriptorBuilder.GetDescriptor().GetColumnDescriptor(physicalColumnId).GetModel().GetType());
127 const auto bytesPacked = (bitsOnStorage * sealedPage.
fNElements + 7) / 8;
129 return WriteSealedPage(sealedPage, bytesPacked);
132std::vector<ROOT::Experimental::RNTupleLocator>
135 size_t size = 0, bytesPacked = 0;
136 for (
auto &range : ranges) {
137 if (range.fFirst == range.fLast) {
143 fDescriptorBuilder.GetDescriptor().GetColumnDescriptor(range.fPhysicalColumnId).GetModel().GetType());
144 for (
auto sealedPageIt = range.fFirst; sealedPageIt != range.fLast; ++sealedPageIt) {
145 size += sealedPageIt->fSize;
146 bytesPacked += (bitsOnStorage * sealedPageIt->fNElements + 7) / 8;
149 if (
size >= std::numeric_limits<std::int32_t>::max() || bytesPacked >= std::numeric_limits<std::int32_t>::max()) {
157 std::uint64_t
offset = fWriter->ReserveBlob(
size, bytesPacked);
160 std::vector<ROOT::Experimental::RNTupleLocator> locators;
161 for (
auto &range : ranges) {
162 for (
auto sealedPageIt = range.fFirst; sealedPageIt != range.fLast; ++sealedPageIt) {
163 fWriter->WriteIntoReservedBlob(sealedPageIt->fBuffer, sealedPageIt->fSize,
offset);
167 locators.push_back(locator);
168 offset += sealedPageIt->fSize;
172 fCounters->fNPageCommitted.Add(locators.size());
173 fCounters->fSzWritePayload.Add(
size);
174 fNBytesCurrentCluster +=
size;
181 auto result = fNBytesCurrentCluster;
182 fNBytesCurrentCluster = 0;
190 auto bufPageListZip = std::make_unique<unsigned char[]>(
length);
191 auto szPageListZip = fCompressor->Zip(serializedPageList,
length, GetWriteOptions().GetCompression(),
195 result.fBytesOnStorage = szPageListZip;
196 result.fPosition = fWriter->WriteBlob(bufPageListZip.get(), szPageListZip,
length);
203 auto bufFooterZip = std::make_unique<unsigned char[]>(
length);
204 auto szFooterZip = fCompressor->Zip(serializedFooter,
length, GetWriteOptions().GetCompression(),
206 fWriter->WriteNTupleFooter(bufFooterZip.get(), szFooterZip,
length);
216 return fPageAllocator->NewPage(columnHandle.
fPhysicalId, elementSize, nElements);
221 fPageAllocator->DeletePage(page);
230 fPagePool(std::make_shared<
RPagePool>()),
231 fClusterPool(std::make_unique<
RClusterPool>(*this, options.GetClusterBunchSize()))
238 std::unique_ptr<ROOT::Internal::RRawFile> file,
242 fFile = std::move(file);
260 static std::once_flag once;
261 std::call_once(once, [&anchor]() {
267 auto buffer = std::make_unique<unsigned char[]>(anchor.
GetLenHeader());
268 auto zipBuffer = std::make_unique<unsigned char[]>(anchor.
GetNBytesHeader());
274 buffer = std::make_unique<unsigned char[]>(anchor.
GetLenFooter());
275 zipBuffer = std::make_unique<unsigned char[]>(anchor.
GetNBytesFooter());
281std::unique_ptr<ROOT::Experimental::Internal::RPageSourceFile>
286 throw RException(
R__FAIL(
"This RNTuple object was not streamed from a ROOT file (TFile or descendant)"));
288 std::unique_ptr<ROOT::Internal::RRawFile> rawFile;
293 auto protocol = std::string(url->GetProtocol());
296 }
else if (protocol ==
"http" || protocol ==
"https" || protocol ==
"root" || protocol ==
"roots") {
302 auto pageSource = std::make_unique<RPageSourceFile>(
"", std::move(rawFile), options);
303 pageSource->InitDescriptor(anchor);
304 pageSource->fNTupleName = pageSource->fDescriptorBuilder.GetDescriptor().GetName();
314 if (fDescriptorBuilder.GetDescriptor().GetOnDiskHeaderSize() == 0) {
315 auto anchor = fReader.GetNTuple(fNTupleName).Unwrap();
316 InitDescriptor(anchor);
319 auto desc = fDescriptorBuilder.MoveDescriptor();
321 for (
const auto &cgDesc : desc.GetClusterGroupIterable()) {
322 auto buffer = std::make_unique<unsigned char[]>(cgDesc.GetPageListLength());
323 auto zipBuffer = std::make_unique<unsigned char[]>(cgDesc.GetPageListLocator().fBytesOnStorage);
324 fReader.ReadBuffer(zipBuffer.get(), cgDesc.GetPageListLocator().fBytesOnStorage,
325 cgDesc.GetPageListLocator().GetPosition<std::uint64_t>());
326 fDecompressor->Unzip(zipBuffer.get(), cgDesc.GetPageListLocator().fBytesOnStorage, cgDesc.GetPageListLength(),
342 auto descriptorGuard = GetSharedDescriptorGuard();
343 const auto &clusterDescriptor = descriptorGuard->GetClusterDescriptor(clusterId);
344 pageInfo = clusterDescriptor.GetPageRange(physicalColumnId).Find(clusterIndex.
GetIndex());
348 sealedPage.
fSize = bytesOnStorage;
353 fReader.ReadBuffer(
const_cast<void *
>(sealedPage.
fBuffer), bytesOnStorage,
366 const auto clusterId = clusterInfo.
fClusterId;
367 const auto pageInfo = clusterInfo.
fPageInfo;
370 const auto elementSize = element->
GetSize();
371 const auto bytesOnStorage = pageInfo.fLocator.fBytesOnStorage;
373 const void *sealedPageBuffer =
nullptr;
374 std::unique_ptr<unsigned char []> directReadBuffer;
378 pageZero.GrowUnchecked(pageInfo.fNElements);
379 pageZero.SetWindow(clusterInfo.
fColumnOffset + pageInfo.fFirstInPage,
381 fPagePool->RegisterPage(pageZero,
RPageDeleter([](
const RPage &,
void *) {},
nullptr));
386 directReadBuffer = std::unique_ptr<unsigned char[]>(
new unsigned char[bytesOnStorage]);
387 fReader.ReadBuffer(directReadBuffer.get(), bytesOnStorage, pageInfo.fLocator.GetPosition<std::uint64_t>());
388 fCounters->fNPageLoaded.Inc();
389 fCounters->fNRead.Inc();
390 fCounters->fSzReadPayload.Add(bytesOnStorage);
391 sealedPageBuffer = directReadBuffer.get();
393 if (!fCurrentCluster || (fCurrentCluster->GetId() != clusterId) || !fCurrentCluster->ContainsColumn(columnId))
394 fCurrentCluster = fClusterPool->GetCluster(clusterId, fActivePhysicalColumns.ToColumnSet());
395 R__ASSERT(fCurrentCluster->ContainsColumn(columnId));
397 auto cachedPage = fPagePool->GetPage(columnId,
RClusterIndex(clusterId, idxInCluster));
398 if (!cachedPage.IsNull())
402 auto onDiskPage = fCurrentCluster->GetOnDiskPage(key);
403 R__ASSERT(onDiskPage && (bytesOnStorage == onDiskPage->GetSize()));
404 sealedPageBuffer = onDiskPage->GetAddress();
410 newPage = UnsealPage({sealedPageBuffer, bytesOnStorage, pageInfo.fNElements}, *element, columnId);
411 fCounters->fSzUnzip.Add(elementSize * pageInfo.fNElements);
416 fPagePool->RegisterPage(
418 fCounters->fNPagePopulated.Inc();
426 auto cachedPage = fPagePool->GetPage(columnId, globalIndex);
427 if (!cachedPage.IsNull())
430 std::uint64_t idxInCluster;
433 auto descriptorGuard = GetSharedDescriptorGuard();
434 clusterInfo.
fClusterId = descriptorGuard->FindClusterId(columnId, globalIndex);
437 throw RException(
R__FAIL(
"entry with index " + std::to_string(globalIndex) +
" out of bounds"));
439 const auto &clusterDescriptor = descriptorGuard->GetClusterDescriptor(clusterInfo.
fClusterId);
440 clusterInfo.
fColumnOffset = clusterDescriptor.GetColumnRange(columnId).fFirstElementIndex;
443 clusterInfo.
fPageInfo = clusterDescriptor.GetPageRange(columnId).Find(idxInCluster);
446 return PopulatePageFromCluster(columnHandle, clusterInfo, idxInCluster);
453 const auto idxInCluster = clusterIndex.
GetIndex();
455 auto cachedPage = fPagePool->GetPage(columnId, clusterIndex);
456 if (!cachedPage.IsNull())
464 auto descriptorGuard = GetSharedDescriptorGuard();
465 const auto &clusterDescriptor = descriptorGuard->GetClusterDescriptor(clusterId);
467 clusterInfo.
fColumnOffset = clusterDescriptor.GetColumnRange(columnId).fFirstElementIndex;
468 clusterInfo.
fPageInfo = clusterDescriptor.GetPageRange(columnId).Find(idxInCluster);
471 return PopulatePageFromCluster(columnHandle, clusterInfo, idxInCluster);
476 fPagePool->ReturnPage(page);
484 return std::unique_ptr<RPageSourceFile>(
clone);
487std::unique_ptr<ROOT::Experimental::Internal::RCluster>
489 const RCluster::RKey &clusterKey, std::vector<ROOT::Internal::RRawFile::RIOVec> &readRequests)
491 struct ROnDiskPageLocator {
494 std::uint64_t fOffset = 0;
495 std::uint64_t
fSize = 0;
496 std::size_t fBufPos = 0;
499 std::vector<ROnDiskPageLocator> onDiskPages;
501 auto pageZeroMap = std::make_unique<ROnDiskPageMap>();
502 PrepareLoadCluster(clusterKey, *pageZeroMap,
505 const auto &pageLocator = pageInfo.
fLocator;
507 onDiskPages.push_back({physicalColumnId, pageNo, pageLocator.GetPosition<std::uint64_t>(),
508 pageLocator.fBytesOnStorage, 0});
512 std::sort(onDiskPages.begin(), onDiskPages.end(),
513 [](
const ROnDiskPageLocator &
a,
const ROnDiskPageLocator &
b) {return a.fOffset < b.fOffset;});
522 float maxOverhead = 0.25 * float(activeSize);
523 std::vector<std::size_t> gaps;
524 for (
unsigned i = 1; i < onDiskPages.size(); ++i) {
525 gaps.emplace_back(onDiskPages[i].fOffset - (onDiskPages[i-1].
fSize + onDiskPages[i-1].fOffset));
527 std::sort(gaps.begin(), gaps.end());
528 std::size_t gapCut = 0;
529 std::size_t currentGap = 0;
531 for (
auto g : gaps) {
532 if (
g != currentGap) {
537 if (szExtra > maxOverhead)
545 const auto currentReadRequestIdx = readRequests.size();
548 std::size_t szPayload = 0;
549 std::size_t szOverhead = 0;
550 for (
auto &s : onDiskPages) {
554 auto overhead = s.fOffset - readUpTo;
555 szPayload += s.fSize;
556 if (overhead <= gapCut) {
557 szOverhead += overhead;
558 s.fBufPos =
reinterpret_cast<intptr_t
>(req.
fBuffer) + req.
fSize + overhead;
559 req.
fSize += overhead + s.fSize;
565 readRequests.emplace_back(req);
568 s.fBufPos =
reinterpret_cast<intptr_t
>(req.
fBuffer);
573 readRequests.emplace_back(req);
574 fCounters->fSzReadPayload.Add(szPayload);
575 fCounters->fSzReadOverhead.Add(szOverhead);
578 auto buffer =
new unsigned char[
reinterpret_cast<intptr_t
>(req.
fBuffer) + req.
fSize];
579 auto pageMap = std::make_unique<ROnDiskPageMapHeap>(std::unique_ptr<
unsigned char []>(buffer));
580 for (
const auto &s : onDiskPages) {
582 pageMap->Register(key,
ROnDiskPage(buffer + s.fBufPos, s.fSize));
584 fCounters->fNPageLoaded.Add(onDiskPages.size());
585 for (
auto i = currentReadRequestIdx; i < readRequests.size(); ++i) {
586 readRequests[i].fBuffer = buffer +
reinterpret_cast<intptr_t
>(readRequests[i].fBuffer);
589 auto cluster = std::make_unique<RCluster>(clusterKey.
fClusterId);
590 cluster->Adopt(std::move(pageMap));
591 cluster->Adopt(std::move(pageZeroMap));
593 cluster->SetColumnAvailable(colId);
597std::vector<std::unique_ptr<ROOT::Experimental::Internal::RCluster>>
600 fCounters->fNClusterLoaded.Add(clusterKeys.size());
602 std::vector<std::unique_ptr<ROOT::Experimental::Internal::RCluster>> clusters;
603 std::vector<ROOT::Internal::RRawFile::RIOVec> readRequests;
605 for (
auto key: clusterKeys) {
606 clusters.emplace_back(PrepareSingleCluster(key, readRequests));
609 auto nReqs = readRequests.size();
610 auto readvLimits = fFile->GetReadVLimits();
614 auto nBatch = std::min(nReqs, readvLimits.fMaxReqs);
616 if (readvLimits.HasSizeLimit()) {
617 std::uint64_t totalSize = 0;
618 for (std::size_t i = 0; i < nBatch; ++i) {
619 if (readRequests[iReq + i].
fSize > readvLimits.fMaxSingleSize) {
624 totalSize += readRequests[iReq + i].fSize;
625 if (totalSize > readvLimits.fMaxTotalSize) {
635 fFile->ReadAt(readRequests[iReq].
fBuffer, readRequests[iReq].
fSize, readRequests[iReq].fOffset);
638 fFile->ReadV(&readRequests[iReq], nBatch);
640 fCounters->fNReadV.Inc();
641 fCounters->fNRead.Add(nBatch);
654 const auto clusterId = cluster->
GetId();
655 auto descriptorGuard = GetSharedDescriptorGuard();
656 const auto &clusterDescriptor = descriptorGuard->GetClusterDescriptor(clusterId);
658 std::vector<std::unique_ptr<RColumnElementBase>> allElements;
661 for (
const auto columnId : columnsInCluster) {
662 const auto &columnDesc = descriptorGuard->GetColumnDescriptor(columnId);
666 const auto &pageRange = clusterDescriptor.GetPageRange(columnId);
667 std::uint64_t pageNo = 0;
668 std::uint64_t firstInPage = 0;
669 for (
const auto &pi : pageRange.fPageInfos) {
672 R__ASSERT(onDiskPage && (onDiskPage->GetSize() == pi.fLocator.fBytesOnStorage));
674 auto taskFunc = [
this, columnId, clusterId, firstInPage, onDiskPage, element = allElements.back().get(),
675 nElements = pi.fNElements,
676 indexOffset = clusterDescriptor.GetColumnRange(columnId).fFirstElementIndex]() {
677 auto newPage = UnsealPage({onDiskPage->GetAddress(), onDiskPage->GetSize(), nElements}, *element, columnId);
678 fCounters->fSzUnzip.Add(element->GetSize() * nElements);
681 fPagePool->PreloadPage(
685 fTaskScheduler->AddTask(taskFunc);
687 firstInPage += pi.fNElements;
694 fTaskScheduler->Wait();
#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(...)
TObject * clone(const char *newname) const override
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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
Record wall time and CPU time between construction and destruction.
Managed a set of clusters containing compressed and packed pages.
An in-memory subset of the packed and compressed pages of a cluster.
const ColumnSet_t & GetAvailPhysicalColumns() const
const ROnDiskPage * GetOnDiskPage(const ROnDiskPage::Key &key) const
size_t GetNOnDiskPages() const
DescriptorId_t GetId() const
std::size_t GetSize() const
std::size_t GetBitsOnStorage() const
static std::unique_ptr< RColumnElementBase > Generate(EColumnType type)
If CppT == void, use the default C++ type for the given column type.
RColumnElementBase * GetElement() const
Read RNTuple data blocks from a TFile container, provided by a RRawFile.
static Writer_t MakeMemCopyWriter(unsigned char *dest)
static RNTupleFileWriter * Append(std::string_view ntupleName, TFile &file)
Add a new RNTuple identified by ntupleName to the existing TFile.
static RNTupleFileWriter * Recreate(std::string_view ntupleName, std::string_view path, int defaultCompression, EContainerFormat containerFormat)
Create or truncate the local file given by path with the new empty RNTuple identified by ntupleName.
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 RResult< void > DeserializePageList(const void *buffer, std::uint64_t bufSize, DescriptorId_t clusterGroupId, RNTupleDescriptor &desc)
A page as being stored on disk, that is packed and compressed.
Uses standard C++ memory allocation for the column data pages.
static void DeletePage(const RPage &page)
Releases the memory pointed to by page and resets the page's information.
A closure that can free the memory associated with a mapped page.
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.
virtual std::vector< RNTupleLocator > CommitSealedPageVImpl(std::span< RPageStorage::RSealedPageGroup > ranges)
Vector commit of preprocessed pages.
A thread-safe cache of column pages.
Storage provider that write ntuple pages into a file.
void ReleasePage(RPage &page) final
Every page store needs to be able to free pages it handed out.
std::vector< RNTupleLocator > CommitSealedPageVImpl(std::span< RPageStorage::RSealedPageGroup > ranges) final
Vector commit of preprocessed pages.
std::uint64_t CommitClusterImpl() final
Returns the number of bytes written to storage (excluding metadata)
RNTupleLocator WriteSealedPage(const RPageStorage::RSealedPage &sealedPage, std::size_t bytesPacked)
void InitImpl(unsigned char *serializedHeader, std::uint32_t length) final
RPage ReservePage(ColumnHandle_t columnHandle, std::size_t nElements) final
Get a new, empty page for the given column that can be filled with up to nElements.
RNTupleLocator CommitPageImpl(ColumnHandle_t columnHandle, const RPage &page) final
RNTupleLocator CommitSealedPageImpl(DescriptorId_t physicalColumnId, const RPageStorage::RSealedPage &sealedPage) final
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...
~RPageSinkFile() override
RPageSinkFile(std::string_view ntupleName, const RNTupleWriteOptions &options)
std::unique_ptr< RNTupleFileWriter > fWriter
void CommitDatasetImpl(unsigned char *serializedFooter, std::uint32_t length) 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 file.
static std::unique_ptr< RPageSourceFile > CreateFromAnchor(const RNTuple &anchor, const RNTupleReadOptions &options=RNTupleReadOptions())
Used from the RNTuple class to build a datasource if the anchor is already available.
RPage PopulatePage(ColumnHandle_t columnHandle, NTupleSize_t globalIndex) final
Allocates and fills a page that contains the index-th element.
RPageSourceFile(std::string_view ntupleName, const RNTupleReadOptions &options)
void UnzipClusterImpl(RCluster *cluster) final
void ReleasePage(RPage &page) final
Every page store needs to be able to free pages it handed out.
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...
std::unique_ptr< RPageSource > Clone() const final
The cloned page source creates a new raw file and reader and opens its own file descriptor to the dat...
std::unique_ptr< RCluster > PrepareSingleCluster(const RCluster::RKey &clusterKey, std::vector< ROOT::Internal::RRawFile::RIOVec > &readRequests)
Helper function for LoadClusters: it prepares the memory buffer (page map) and the read requests for ...
RMiniFileReader fReader
Takes the fFile to read ntuple blobs from it.
RPage PopulatePageFromCluster(ColumnHandle_t columnHandle, const RClusterInfo &clusterInfo, ClusterSize_t::ValueType idxInCluster)
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 selaedPage.
~RPageSourceFile() override
void InitDescriptor(const RNTuple &anchor)
Deserialized header and footer into a minimal descriptor held by fDescriptorBuilder.
RNTupleDescriptor AttachImpl() final
std::unique_ptr< ROOT::Internal::RRawFile > fFile
An RRawFile is used to request the necessary byte ranges from a local or a remote file.
Abstract interface to read data from an ntuple.
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSource.
std::unique_ptr< RNTupleDecompressor > fDecompressor
Helper to unzip pages and header/footer; comprises a 16MB (kMAXZIPBUF) unzip buffer.
Stores information about the cluster in which this page resides.
A page is a slice of a column that is mapped into memory.
static RPage MakePageZero(ColumnId_t columnId, ClusterSize_t::ValueType elementSize)
Make a 'zero' page for column columnId (that is comprised of 0x00 bytes only).
std::uint32_t GetNBytes() const
The space taken by column elements in the buffer.
std::uint32_t GetNElements() const
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.
Common user-tunable settings for reading ntuples.
Common user-tunable settings for storing ntuples.
int GetCompression() const
Representation of an RNTuple data set in a ROOT file.
std::uint64_t GetLenFooter() const
static constexpr std::uint16_t kVersionEpoch
std::uint64_t GetNBytesHeader() const
std::uint64_t GetLenHeader() const
std::uint16_t GetVersionEpoch() const
std::uint64_t GetNBytesFooter() const
TFile * fFile
! The file from which the ntuple was streamed, registered in the custom streamer
std::uint64_t GetSeekHeader() const
std::uint16_t GetVersionMajor() const
std::uint64_t GetSeekFooter() const
The RRawFileTFile wraps an open TFile, but does not take ownership.
The RRawFile provides read-only access to local and remote files.
static std::unique_ptr< RRawFile > Create(std::string_view url, ROptions options=ROptions())
Factory method that returns a suitable concrete implementation according to the transport in the url.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
virtual const TUrl * GetEndpointUrl() const
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
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.
constexpr DescriptorId_t kInvalidDescriptorId
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
The identifiers that specifies the content of a (partial) cluster.
DescriptorId_t fClusterId
ColumnSet_t fPhysicalColumnSet
On-disk pages within a page source are identified by the column and page number.
Summarizes cluster-level information that are necessary to populate a certain page.
RClusterDescriptor::RPageRange::RPageInfoExtended fPageInfo
Location of the page on disk.
DescriptorId_t fClusterId
std::uint64_t fColumnOffset
The first element number of the page's column in the given cluster.
DescriptorId_t fPhysicalId
A sealed page contains the bytes of a page as written to storage (packed & compressed).
Generic information about the physical location of data.
ELocatorType fType
For non-disk locators, the value for the Type field.
std::uint32_t fBytesOnStorage
std::variant< std::uint64_t, std::string, RNTupleLocatorObject64 > fPosition
Simple on-disk locators consisting of a 64-bit offset use variant type uint64_t; extended locators ha...
const T & GetPosition() const
Used for vector reads from multiple offsets into multiple buffers.
std::size_t fSize
The number of desired bytes.
void * fBuffer
The destination for reading.
std::uint64_t fOffset
The file offset.