92 auto zipBuffer = MakeUninitArray<unsigned char>(
length);
95 fWriter->WriteNTupleHeader(zipBuffer.get(), szZipHeader,
length);
104 const TClass *cl =
nullptr;
105 if (
auto classField =
dynamic_cast<const RClassField *
>(field)) {
107 }
else if (
auto streamerField =
dynamic_cast<const RStreamerField *
>(field)) {
110 cl = soaField->GetSoAClass();
118 std::to_string(field->GetTypeVersion()) +
"]"));
120 fInfosOfClassFields[streamerInfo->GetNumber()] = streamerInfo;
124 fnAddStreamerInfo(field);
125 for (
const auto &subField : *field) {
126 fnAddStreamerInfo(&subField);
134 std::uint64_t offsetData;
136 RNTupleAtomicTimer timer(fCounters->fTimeWallWrite, fCounters->fTimeCpuWrite);
141 result.SetPosition(offsetData);
143 fCounters->fNPageCommitted.Inc();
152 const auto nBits = fDescriptorBuilder.GetDescriptor().GetColumnDescriptor(physicalColumnId).GetBitsOnStorage();
153 const auto bytesPacked = (nBits * sealedPage.
GetNElements() + 7) / 8;
154 return WriteSealedPage(sealedPage, bytesPacked);
159 RNTupleAtomicTimer timer(fCounters->fTimeWallWrite, fCounters->fTimeCpuWrite);
163 locators.reserve(locators.size() + batch.
fSealedPages.size());
166 fWriter->WriteIntoReservedBlob(pagePtr->GetBuffer(), pagePtr->GetBufferSize(),
offset);
170 locators.push_back(locator);
171 offset += pagePtr->GetBufferSize();
174 fCounters->fNPageCommitted.Add(batch.
fSealedPages.size());
175 fCounters->fSzWritePayload.Add(batch.
fSize);
176 fNBytesCurrentCluster += batch.
fSize;
183std::vector<ROOT::RNTupleLocator>
185 const std::vector<bool> &
mask)
187 const std::uint64_t maxKeySize = fOptions->GetMaxKeySize();
190 std::vector<RNTupleLocator> locators;
192 std::size_t iPage = 0;
193 for (
auto rangeIt = ranges.begin(); rangeIt != ranges.end(); ++rangeIt) {
194 auto &range = *rangeIt;
195 if (range.fFirst == range.fLast) {
200 const auto bitsOnStorage =
201 fDescriptorBuilder.GetDescriptor().GetColumnDescriptor(range.fPhysicalColumnId).GetBitsOnStorage();
203 for (
auto sealedPageIt = range.fFirst; sealedPageIt != range.fLast; ++sealedPageIt, ++iPage) {
207 const auto bytesPacked = (bitsOnStorage * sealedPageIt->GetNElements() + 7) / 8;
209 if (batch.fSize > 0 && batch.fSize + sealedPageIt->GetBufferSize() > maxKeySize) {
217 CommitBatchOfPages(batch, locators);
220 if (sealedPageIt->GetBufferSize() > maxKeySize) {
226 assert(batch.fSize == 0);
229 fWriter->WriteBlob(sealedPageIt->GetBuffer(), sealedPageIt->GetBufferSize(), bytesPacked);
233 locators.push_back(locator);
235 fCounters->fNPageCommitted.Inc();
236 fCounters->fSzWritePayload.Add(sealedPageIt->GetBufferSize());
237 fNBytesCurrentCluster += sealedPageIt->GetBufferSize();
240 batch.fSealedPages.emplace_back(&(*sealedPageIt));
241 batch.fSize += sealedPageIt->GetBufferSize();
242 batch.fBytesPacked += bytesPacked;
247 if (batch.fSize > 0) {
248 CommitBatchOfPages(batch, locators);
256 auto result = fNBytesCurrentCluster;
257 fNBytesCurrentCluster = 0;
264 auto bufPageListZip = MakeUninitArray<unsigned char>(
length);
269 result.SetNBytesOnStorage(szPageListZip);
270 result.SetPosition(fWriter->WriteBlob(bufPageListZip.get(), szPageListZip,
length));
279 for (
const auto &extraTypeInfo : fDescriptorBuilder.GetDescriptor().GetExtraTypeInfoIterable()) {
287 fWriter->UpdateStreamerInfos(fInfosOfClassFields);
289 auto bufFooterZip = MakeUninitArray<unsigned char>(
length);
292 fWriter->WriteNTupleFooter(bufFooterZip.get(), szFooterZip,
length);
293 return fWriter->Commit(GetWriteOptions().GetCompression());
296std::unique_ptr<ROOT::Internal::RPageSink>
317 "cumulative seek distance (excluding header/footer reads)"),
319 "szFile",
"B",
"total file size",
fMetrics,
322 return {true, static_cast<double>(fFileSize)};
327 "ratio of seek distance to bytes read (excluding file structure reads)",
fMetrics,
330 if (
const auto szReadPayload = metrics.
GetLocalCounter(
"szReadPayload")) {
331 if (
const auto szReadOverhead = metrics.
GetLocalCounter(
"szReadOverhead")) {
332 auto totalRead = szReadPayload->GetValueAsInt() + szReadOverhead->GetValueAsInt();
334 return {
true, (1. * szSkip->GetValueAsInt()) / totalRead};
343 "ratio of bytes read to total file size (excluding file structure reads)",
fMetrics,
344 [
this](
const RNTupleMetrics &metrics) -> std::pair<bool, double> {
346 if (
const auto szReadPayload = metrics.
GetLocalCounter(
"szReadPayload")) {
347 if (
const auto szReadOverhead = metrics.
GetLocalCounter(
"szReadOverhead")) {
348 auto totalRead = szReadPayload->GetValueAsInt() + szReadOverhead->GetValueAsInt();
349 return {
true, (1. * totalRead) /
fFileSize};
358 std::unique_ptr<ROOT::Internal::RRawFile> file,
362 fFile = std::move(file);
373std::unique_ptr<ROOT::Internal::RPageSourceFile>
377 throw RException(
R__FAIL(
"This RNTuple object was not streamed from a ROOT file (TFile or descendant)"));
379 std::unique_ptr<ROOT::Internal::RRawFile> rawFile;
385 if (className ==
"TFile") {
387 }
else if (className ==
"TDavixFile" || className ==
"TCurlFile" || className ==
"TNetXNGFile") {
393 auto pageSource = std::make_unique<RPageSourceFile>(
"", std::move(rawFile), options);
394 pageSource->fAnchor = anchor;
401 StopClusterPoolBackgroundThread();
404std::unique_ptr<ROOT::Internal::RPageSource>
413 auto pageSource = std::make_unique<RPageSourceFile>(
"", fFile->Clone(), options);
414 pageSource->fAnchor = anchor;
424 fAnchor = fReader.GetNTuple(fNTupleName).Unwrap();
428 fReader.LoadStreamerInfo();
430 fReader.SetMaxKeySize(fAnchor->GetMaxKeySize());
432 fDescriptorBuilder.SetVersion(fAnchor->GetVersionEpoch(), fAnchor->GetVersionMajor(), fAnchor->GetVersionMinor(),
433 fAnchor->GetVersionPatch());
434 fDescriptorBuilder.SetOnDiskHeaderSize(fAnchor->GetNBytesHeader());
435 fDescriptorBuilder.AddToOnDiskFooterSize(fAnchor->GetNBytesFooter());
438 const auto bufSize = fAnchor->GetNBytesHeader() + fAnchor->GetNBytesFooter() +
439 std::max(fAnchor->GetLenHeader(), fAnchor->GetLenFooter());
440 fStructureBuffer.fBuffer = MakeUninitArray<unsigned char>(bufSize);
441 fStructureBuffer.fPtrHeader = fStructureBuffer.fBuffer.get();
442 fStructureBuffer.fPtrFooter = fStructureBuffer.fBuffer.get() + fAnchor->GetNBytesHeader();
444 auto readvLimits = fFile->GetReadVLimits();
446 readvLimits.fMaxSingleSize = std::min<size_t>(readvLimits.fMaxSingleSize, fAnchor->GetMaxKeySize());
448 if ((readvLimits.fMaxReqs < 2) ||
449 (std::max(fAnchor->GetNBytesHeader(), fAnchor->GetNBytesFooter()) > readvLimits.fMaxSingleSize) ||
450 (fAnchor->GetNBytesHeader() + fAnchor->GetNBytesFooter() > readvLimits.fMaxTotalSize)) {
451 RNTupleAtomicTimer timer(fCounters->fTimeWallRead, fCounters->fTimeCpuRead);
452 fReader.ReadBuffer(fStructureBuffer.fPtrHeader, fAnchor->GetNBytesHeader(), fAnchor->GetSeekHeader());
453 fReader.ReadBuffer(fStructureBuffer.fPtrFooter, fAnchor->GetNBytesFooter(), fAnchor->GetSeekFooter());
454 fCounters->fNRead.Add(2);
456 RNTupleAtomicTimer timer(fCounters->fTimeWallRead, fCounters->fTimeCpuRead);
457 R__ASSERT(fAnchor->GetNBytesHeader() < std::numeric_limits<std::size_t>::max());
458 R__ASSERT(fAnchor->GetNBytesFooter() < std::numeric_limits<std::size_t>::max());
460 static_cast<std::size_t
>(fAnchor->GetNBytesHeader()), 0},
461 {fStructureBuffer.fPtrFooter, fAnchor->GetSeekFooter(),
462 static_cast<std::size_t
>(fAnchor->GetNBytesFooter()), 0}};
463 fFile->ReadV(readRequests, 2);
464 fCounters->fNReadV.Inc();
470 auto unzipBuf =
reinterpret_cast<unsigned char *
>(fStructureBuffer.fPtrFooter) + fAnchor->GetNBytesFooter();
482 if (fNTupleName.empty())
483 fNTupleName = fDescriptorBuilder.GetDescriptor().GetName();
486 fFile->SetBuffering(
false);
489 fFileSize = fFile->GetSize();
491 return fDescriptorBuilder.MoveDescriptor();
501 RNTupleAtomicTimer timer(fCounters->fTimeWallRead, fCounters->fTimeCpuRead);
504 if (fLastOffset != 0) {
506 const auto distance =
static_cast<std::uint64_t
>(
507 std::abs(
static_cast<std::int64_t
>(
offset) -
static_cast<std::int64_t
>(fLastOffset)));
508 fFileCounters->fSzSkip.Add(distance);
518 clone->fFile = fFile->Clone();
520 return std::unique_ptr<RPageSourceFile>(clone);
523std::unique_ptr<ROOT::Internal::RCluster>
525 std::vector<ROOT::Internal::RRawFile::RIOVec> &readRequests)
527 struct ROnDiskPageLocator {
530 std::uint64_t fOffset = 0;
531 std::uint64_t
fSize = 0;
532 std::size_t fBufPos = 0;
535 std::vector<ROnDiskPageLocator> onDiskPages;
537 auto pageZeroMap = std::make_unique<ROnDiskPageMap>();
539 clusterKey, *pageZeroMap,
542 const auto &pageLocator = pageInfo.
GetLocator();
545 const auto nBytes = pageLocator.GetNBytesOnStorage() + pageInfo.
HasChecksum() * kNBytesPageChecksum;
546 activeSize += nBytes;
547 onDiskPages.push_back({physicalColumnId, pageNo, pageLocator.GetPosition<std::uint64_t>(), nBytes, 0});
551 std::sort(onDiskPages.begin(), onDiskPages.end(),
552 [](
const ROnDiskPageLocator &
a,
const ROnDiskPageLocator &
b) { return a.fOffset < b.fOffset; });
561 float maxOverhead = 0.25 * float(activeSize);
562 std::vector<std::size_t> gaps;
563 if (onDiskPages.size())
564 gaps.reserve(onDiskPages.size() - 1);
565 for (
unsigned i = 1; i < onDiskPages.size(); ++i) {
567 static_cast<int64_t
>(onDiskPages[i].fOffset) - (onDiskPages[i - 1].
fSize + onDiskPages[i - 1].fOffset);
568 gaps.emplace_back(std::max(gap, std::int64_t(0)));
570 activeSize += std::min(gap, std::int64_t(0));
572 std::sort(gaps.begin(), gaps.end());
573 std::size_t gapCut = 0;
574 std::size_t currentGap = 0;
576 for (
auto g : gaps) {
577 if (
g != currentGap) {
582 if (szExtra > maxOverhead)
590 const auto currentReadRequestIdx = readRequests.size();
594 if (!onDiskPages.empty())
595 req.
fOffset = onDiskPages[0].fOffset;
596 std::size_t szPayload = 0;
597 std::size_t szOverhead = 0;
598 const std::uint64_t maxKeySize = fReader.GetMaxKeySize();
599 for (
auto &s : onDiskPages) {
603 const std::uint64_t overhead = std::max(
static_cast<std::int64_t
>(s.fOffset) - readUpTo, std::int64_t(0));
604 const std::uint64_t extent = std::max(
static_cast<std::int64_t
>(s.fOffset + s.fSize) - readUpTo, std::int64_t(0));
605 if (req.
fSize + extent < maxKeySize && overhead <= gapCut) {
606 szPayload += (extent - overhead);
607 szOverhead += overhead;
608 s.fBufPos =
reinterpret_cast<intptr_t
>(req.
fBuffer) + s.fOffset - req.
fOffset;
615 readRequests.emplace_back(req);
618 s.fBufPos =
reinterpret_cast<intptr_t
>(req.
fBuffer);
620 szPayload += s.fSize;
624 readRequests.emplace_back(req);
625 fCounters->fSzReadPayload.Add(szPayload);
626 fCounters->fSzReadOverhead.Add(szOverhead);
629 auto buffer =
new unsigned char[
reinterpret_cast<intptr_t
>(req.
fBuffer) + req.
fSize];
630 auto pageMap = std::make_unique<ROOT::Internal::ROnDiskPageMapHeap>(std::unique_ptr<
unsigned char[]>(buffer));
631 for (
const auto &s : onDiskPages) {
633 pageMap->Register(key,
ROnDiskPage(buffer + s.fBufPos, s.fSize));
635 fCounters->fNPageRead.Add(onDiskPages.size());
636 for (
auto i = currentReadRequestIdx; i < readRequests.size(); ++i) {
637 readRequests[i].fBuffer = buffer +
reinterpret_cast<intptr_t
>(readRequests[i].fBuffer);
640 auto cluster = std::make_unique<RCluster>(clusterKey.
fClusterId);
641 cluster->Adopt(std::move(pageMap));
642 cluster->Adopt(std::move(pageZeroMap));
644 cluster->SetColumnAvailable(colId);
648std::vector<std::unique_ptr<ROOT::Internal::RCluster>>
651 fCounters->fNClusterLoaded.Add(clusterKeys.size());
653 std::vector<std::unique_ptr<ROOT::Internal::RCluster>> clusters;
654 std::vector<ROOT::Internal::RRawFile::RIOVec> readRequests;
656 clusters.reserve(clusterKeys.size());
657 for (
const auto &key : clusterKeys) {
658 clusters.emplace_back(PrepareSingleCluster(key, readRequests));
661 auto nReqs = readRequests.size();
662 auto readvLimits = fFile->GetReadVLimits();
664 readvLimits.fMaxSingleSize = std::min<size_t>(readvLimits.fMaxSingleSize, fReader.GetMaxKeySize());
668 auto nBatch = std::min(nReqs, readvLimits.fMaxReqs);
670 if (readvLimits.HasSizeLimit()) {
671 std::uint64_t totalSize = 0;
672 for (std::size_t i = 0; i < nBatch; ++i) {
673 if (readRequests[iReq + i].
fSize > readvLimits.fMaxSingleSize) {
678 totalSize += readRequests[iReq + i].fSize;
679 if (totalSize > readvLimits.fMaxTotalSize) {
688 for (std::size_t i = 0; i < nBatch; ++i) {
689 const auto offset = readRequests[iReq + i].fOffset;
690 if (fLastOffset != 0) {
691 const auto distance =
static_cast<std::uint64_t
>(std::abs(
692 static_cast<std::int64_t
>(
offset) -
static_cast<std::int64_t
>(fLastOffset)));
693 fFileCounters->fSzSkip.Add(distance);
695 fLastOffset =
offset + readRequests[iReq + i].fSize;
700 RNTupleAtomicTimer timer(fCounters->fTimeWallRead, fCounters->fTimeCpuRead);
701 fReader.ReadBuffer(readRequests[iReq].
fBuffer, readRequests[iReq].
fSize, readRequests[iReq].fOffset);
703 RNTupleAtomicTimer timer(fCounters->fTimeWallRead, fCounters->fTimeCpuRead);
704 fFile->ReadV(&readRequests[iReq], nBatch);
706 fCounters->fNReadV.Inc();
707 fCounters->fNRead.Add(nBatch);
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#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 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
A thread-safe integral performance counter.
A metric element that computes its floating point value from other counters.
A collection of Counter objects with a name, a unit, and a description.
const RNTuplePerfCounter * GetLocalCounter(std::string_view name) const
Searches counters registered in this object only. Returns nullptr if name is not found.
CounterPtrT MakeCounter(const std::string &name, Args &&... args)
Record wall time and CPU time between construction and destruction.
An interface to read from, or write to, a ROOT file, as well as performing other common operations.
The SoA field provides I/O for an in-memory SoA layout linked to an on-disk collection of the underly...
An in-memory subset of the packed and compressed pages of a cluster.
Read RNTuple data blocks from a TFile container, provided by a RRawFile.
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.
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.
Write RNTuple data blocks in a TFile or a bare file container.
static std::unique_ptr< RNTupleFileWriter > Append(std::string_view ntupleName, TDirectory &fileOrDirectory, std::uint64_t maxKeySize, bool isHidden)
The directory parameter can also be a TFile object (TFile inherits from TDirectory).
static std::unique_ptr< RNTupleFileWriter > Recreate(std::string_view ntupleName, std::string_view path, EContainerFormat containerFormat, const ROOT::RNTupleWriteOptions &options)
Create or truncate the local file given by path with the new empty RNTuple identified by ntupleName.
static RResult< void > DeserializeFooter(const void *buffer, std::uint64_t bufSize, ROOT::Internal::RNTupleDescriptorBuilder &descBuilder)
static RResult< StreamerInfoMap_t > DeserializeStreamerInfos(const std::string &extraTypeInfoContent)
static RResult< void > DeserializeHeader(const void *buffer, std::uint64_t bufSize, ROOT::Internal::RNTupleDescriptorBuilder &descBuilder)
A memory region that contains packed and compressed pages.
A page as being stored on disk, that is packed and compressed.
Base class for a sink with a physical storage backend.
void UpdateSchema(const ROOT::Internal::RNTupleModelChangeset &changeset, ROOT::NTupleSize_t firstEntry) override
Incorporate incremental changes to the model into the ntuple descriptor.
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSink.
Storage provider that write ntuple pages into a file.
void CommitBatchOfPages(CommitBatch &batch, std::vector< RNTupleLocator > &locators)
Subroutine of CommitSealedPageVImpl, used to perform a vector write of the (multi-)range of pages con...
RPageSinkFile(std::string_view ntupleName, const ROOT::RNTupleWriteOptions &options)
std::unique_ptr< RPageSink > CloneAsHidden(std::string_view name, const ROOT::RNTupleWriteOptions &opts) const override
Creates a new sink with the same underlying storage as this but writing to a different RNTuple named ...
RNTupleLocator CommitSealedPageImpl(ROOT::DescriptorId_t physicalColumnId, const RPageStorage::RSealedPage &sealedPage) override
std::uint64_t StageClusterImpl() final
Returns the number of bytes written to storage (excluding metadata)
void InitImpl(unsigned char *serializedHeader, std::uint32_t length) final
RNTupleLocator WriteSealedPage(const RPageStorage::RSealedPage &sealedPage, std::size_t bytesPacked)
We pass bytesPacked so that TFile::ls() reports a reasonable value for the compression ratio of the c...
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...
RNTupleLink CommitDatasetImpl() final
std::unique_ptr< ROOT::Internal::RNTupleFileWriter > fWriter
~RPageSinkFile() override
void UpdateSchema(const ROOT::Internal::RNTupleModelChangeset &changeset, ROOT::NTupleSize_t firstEntry) final
Incorporate incremental changes to the model into the ntuple descriptor.
std::vector< RNTupleLocator > CommitSealedPageVImpl(std::span< RPageStorage::RSealedPageGroup > ranges, const std::vector< bool > &mask) final
Vector commit of preprocessed pages.
Storage provider that reads ntuple pages from a file.
ROOT::RNTupleDescriptor AttachImpl() final
LoadStructureImpl() has been called before AttachImpl() is called
std::int64_t fFileSize
Total file size, set once in AttachImpl()
std::unique_ptr< ROOT::Internal::RCluster > PrepareSingleCluster(const ROOT::Internal::RCluster::RKey &clusterKey, std::vector< RRawFile::RIOVec > &readRequests)
Helper function for LoadClusters: it prepares the memory buffer (page map) and the read requests for ...
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,...
~RPageSourceFile() override
static std::unique_ptr< RPageSourceFile > CreateFromAnchor(const RNTuple &anchor, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Used from the RNTuple class to build a datasource if the anchor is already available.
void LoadPageListImpl(const RNTupleLocator &locator, unsigned char *buffer) 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< RFileCounters > fFileCounters
void LoadSealedPageImpl(const RNTupleLocator &locator, RSealedPage &sealedPage) final
RPageSourceFile(std::string_view ntupleName, const ROOT::RNTupleReadOptions &options)
std::unique_ptr< RPageSource > CloneImpl() const final
The cloned page source creates a new raw file and reader and opens its own file descriptor to the dat...
void LoadStructureImpl() final
Fills fStructureBuffer with the compressed header and footer.
std::unique_ptr< RRawFile > fFile
An RRawFile is used to request the necessary byte ranges from a local or a remote file.
std::optional< RNTuple > fAnchor
Either provided by CreateFromAnchor, or read from the ROOT file given the ntuple name.
ROOT::Internal::RMiniFileReader fReader
Takes the fFile to read ntuple blobs from it.
Abstract interface to read data from an ntuple.
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSource.
ROOT::Experimental::Detail::RNTupleMetrics fMetrics
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.
The field for a class with dictionary.
Base class for all ROOT issued exceptions.
A field translates read and write calls from/to underlying columns to/from tree values.
The on-storage metadata of an RNTuple.
Generic information about the physical location of data.
std::uint64_t GetNBytesOnStorage() const
ELocatorType GetType() const
For non-disk locators, the value for the Type field.
T GetPosition() const
Note that for GetPosition() / SetPosition(), the locator type must correspond (kTypeFile,...
void SetPosition(std::uint64_t position)
void SetNBytesOnStorage(std::uint64_t nBytesOnStorage)
Common user-tunable settings for reading RNTuples.
Common user-tunable settings for storing RNTuples.
std::uint64_t GetMaxKeySize() const
Representation of an RNTuple data set in a ROOT file.
TFile * fFile
! The file from which the ntuple was streamed, registered in the custom streamer
The field for a class using ROOT standard streaming.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Describe directory structure in memory.
virtual const TUrl * GetEndpointUrl() const
TClass * IsA() const override
const char * GetName() const override
Returns name of object.
const ROOT::RNTuple * GetAnchorFromFile(const RPageSourceFile &source)
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.
The identifiers that specifies the content of a (partial) cluster.
ROOT::DescriptorId_t fClusterId
ColumnSet_t fPhysicalColumnSet
std::uint32_t fLength
Uncompressed length of the anchor, including the checksum.
The incremental changes to a RNTupleModel
std::vector< ROOT::RFieldBase * > fAddedFields
Points to the fields in fModel that were added as part of an updater transaction.
On-disk pages within a page source are identified by the column and page number.
size_t fSize
Total size in bytes of the batch.
std::vector< const RSealedPage * > fSealedPages
The list of pages to commit.
size_t fBytesPacked
Total uncompressed size of the elements in the page batch.
File-specific I/O performance counters.
A sealed page contains the bytes of a page as written to storage (packed & compressed).
std::uint32_t GetNElements() const
const void * GetBuffer() const
std::size_t GetBufferSize() const
std::size_t GetDataSize() 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.
Information about a single page in the context of a cluster's page range.
const RNTupleLocator & GetLocator() const