101 fWriter->WriteNTupleHeader(zipBuffer.get(), szZipHeader, length);
110 const TClass *cl =
nullptr;
111 if (
auto classField =
dynamic_cast<const RClassField *
>(field)) {
113 }
else if (
auto streamerField =
dynamic_cast<const RStreamerField *
>(field)) {
116 cl = soaField->GetSoAClass();
124 std::to_string(field->GetTypeVersion()) +
"]"));
130 fnAddStreamerInfo(field);
131 for (
const auto &subField : *field) {
132 fnAddStreamerInfo(&subField);
140 std::uint64_t offsetData;
162 sealedPage =
SealPage(page, *element);
172 const auto nBits =
fDescriptorBuilder.GetDescriptor().GetColumnDescriptor(physicalColumnId).GetBitsOnStorage();
173 const auto bytesPacked = (nBits * sealedPage.
GetNElements() + 7) / 8;
183 locators.reserve(locators.size() + batch.
fSealedPages.size());
186 fWriter->WriteIntoReservedBlob(pagePtr->GetBuffer(), pagePtr->GetBufferSize(), offset);
190 locators.push_back(locator);
191 offset += pagePtr->GetBufferSize();
203std::vector<ROOT::RNTupleLocator>
205 const std::vector<bool> &mask)
207 const std::uint64_t maxKeySize =
fOptions->GetMaxKeySize();
210 std::vector<RNTupleLocator> locators;
212 std::size_t iPage = 0;
213 for (
auto rangeIt = ranges.begin(); rangeIt != ranges.end(); ++rangeIt) {
214 auto &range = *rangeIt;
215 if (range.fFirst == range.fLast) {
220 const auto bitsOnStorage =
221 fDescriptorBuilder.GetDescriptor().GetColumnDescriptor(range.fPhysicalColumnId).GetBitsOnStorage();
223 for (
auto sealedPageIt = range.fFirst; sealedPageIt != range.fLast; ++sealedPageIt, ++iPage) {
227 const auto bytesPacked = (bitsOnStorage * sealedPageIt->GetNElements() + 7) / 8;
229 if (batch.
fSize > 0 && batch.
fSize + sealedPageIt->GetBufferSize() > maxKeySize) {
240 if (sealedPageIt->GetBufferSize() > maxKeySize) {
246 assert(batch.
fSize == 0);
248 std::uint64_t offset =
249 fWriter->WriteBlob(sealedPageIt->GetBuffer(), sealedPageIt->GetBufferSize(), bytesPacked);
253 locators.push_back(locator);
256 fCounters->fSzWritePayload.Add(sealedPageIt->GetBufferSize());
261 batch.
fSize += sealedPageIt->GetBufferSize();
267 if (batch.
fSize > 0) {
299 for (
const auto &extraTypeInfo :
fDescriptorBuilder.GetDescriptor().GetExtraTypeInfoIterable()) {
312 fWriter->WriteNTupleFooter(bufFooterZip.get(), szFooterZip, length);
316std::unique_ptr<ROOT::Internal::RPageSink>
332 "cumulative seek distance (excluding header/footer reads)"),
334 "szFile",
"B",
"total file size",
fMetrics,
337 return {true, static_cast<double>(fFileSize)};
342 "ratio of seek distance to bytes read (excluding file structure reads)",
fMetrics,
344 if (const auto szSkip = metrics.GetLocalCounter(
"szSkip")) {
345 if (const auto szReadPayload = metrics.GetLocalCounter(
"szReadPayload")) {
346 if (const auto szReadOverhead = metrics.GetLocalCounter(
"szReadOverhead")) {
347 auto totalRead = szReadPayload->GetValueAsInt() + szReadOverhead->GetValueAsInt();
349 return {true, (1. * szSkip->GetValueAsInt()) / totalRead};
358 "ratio of bytes read to total file size (excluding file structure reads)", fMetrics,
359 [
this](
const RNTupleMetrics &metrics) -> std::pair<bool, double> {
361 if (const auto szReadPayload = metrics.GetLocalCounter(
"szReadPayload")) {
362 if (const auto szReadOverhead = metrics.GetLocalCounter(
"szReadOverhead")) {
363 auto totalRead = szReadPayload->GetValueAsInt() + szReadOverhead->GetValueAsInt();
364 return {true, (1. * totalRead) / fFileSize};
373 std::unique_ptr<ROOT::Internal::RRawFile> file,
377 fFile = std::move(file);
388std::unique_ptr<ROOT::Internal::RPageSourceFile>
392 throw RException(
R__FAIL(
"This RNTuple object was not streamed from a ROOT file (TFile or descendant)"));
394 std::unique_ptr<ROOT::Internal::RRawFile> rawFile;
400 auto protocol = std::string(url->GetProtocol());
401 if (className ==
"TFile") {
403 }
else if (className ==
"TDavixFile" || className ==
"TCurlFile" || className ==
"TNetXNGFile") {
409 auto pageSource = std::make_unique<RPageSourceFile>(
"", std::move(rawFile), options);
410 pageSource->fAnchor = anchor;
420std::unique_ptr<ROOT::Internal::RPageSource>
429 auto pageSource = std::make_unique<RPageSourceFile>(
"",
fFile->Clone(), options);
430 pageSource->fAnchor = anchor;
450 const auto bufSize =
fAnchor->GetNBytesHeader() +
fAnchor->GetNBytesFooter() +
456 auto readvLimits =
fFile->GetReadVLimits();
458 readvLimits.fMaxSingleSize = std::min<size_t>(readvLimits.fMaxSingleSize,
fAnchor->GetMaxKeySize());
460 if ((readvLimits.fMaxReqs < 2) ||
461 (std::max(
fAnchor->GetNBytesHeader(),
fAnchor->GetNBytesFooter()) > readvLimits.fMaxSingleSize) ||
462 (
fAnchor->GetNBytesHeader() +
fAnchor->GetNBytesFooter() > readvLimits.fMaxTotalSize)) {
469 R__ASSERT(
fAnchor->GetNBytesHeader() < std::numeric_limits<std::size_t>::max());
470 R__ASSERT(
fAnchor->GetNBytesFooter() < std::numeric_limits<std::size_t>::max());
472 static_cast<std::size_t
>(
fAnchor->GetNBytesHeader()), 0},
474 static_cast<std::size_t
>(
fAnchor->GetNBytesFooter()), 0}};
475 fFile->ReadV(readRequests, 2);
499 std::vector<unsigned char> buffer;
500 for (
const auto &cgDesc : desc.GetClusterGroupIterable()) {
501 buffer.resize(std::max<size_t>(buffer.size(),
502 cgDesc.GetPageListLength() + cgDesc.GetPageListLocator().GetNBytesOnStorage()));
503 auto *zipBuffer = buffer.data() + cgDesc.GetPageListLength();
504 fReader.ReadBuffer(zipBuffer, cgDesc.GetPageListLocator().GetNBytesOnStorage(),
505 cgDesc.GetPageListLocator().GetPosition<std::uint64_t>());
507 cgDesc.GetPageListLength(), buffer.data());
513 fFile->SetBuffering(
false);
529 const auto &clusterDescriptor = descriptorGuard->GetClusterDescriptor(clusterId);
530 pageInfo = clusterDescriptor.GetPageRange(physicalColumnId).Find(localIndex.
GetIndexInCluster());
555 const auto clusterId = clusterInfo.
fClusterId;
556 const auto pageInfo = clusterInfo.
fPageInfo;
559 const auto elementSize = element->
GetSize();
560 const auto elementInMemoryType = element->GetIdentifier().fInMemoryType;
563 auto pageZero =
fPageAllocator->NewPage(elementSize, pageInfo.GetNElements());
564 pageZero.GrowUnchecked(pageInfo.GetNElements());
565 memset(pageZero.GetBuffer(), 0, pageZero.GetNBytes());
566 pageZero.SetWindow(clusterInfo.
fColumnOffset + pageInfo.GetFirstElementIndex(),
575 std::unique_ptr<unsigned char[]> directReadBuffer;
581 const auto offset = pageInfo.GetLocator().GetPosition<std::uint64_t>();
585 const auto distance =
static_cast<std::uint64_t
>(std::abs(
586 static_cast<std::int64_t
>(offset) -
static_cast<std::int64_t
>(
fLastOffset)));
595 sealedPage.
SetBuffer(directReadBuffer.get());
603 if (!cachedPageRef.Get().IsNull())
604 return cachedPageRef;
609 sealedPage.
SetBuffer(onDiskPage->GetAddress());
615 newPage =
UnsealPage(sealedPage, *element).Unwrap();
616 fCounters->fSzUnzip.Add(elementSize * pageInfo.GetNElements());
628 clone->fFile =
fFile->Clone();
630 return std::unique_ptr<RPageSourceFile>(clone);
633std::unique_ptr<ROOT::Internal::RCluster>
635 std::vector<ROOT::Internal::RRawFile::RIOVec> &readRequests)
637 struct ROnDiskPageLocator {
640 std::uint64_t fOffset = 0;
641 std::uint64_t fSize = 0;
642 std::size_t fBufPos = 0;
645 std::vector<ROnDiskPageLocator> onDiskPages;
647 auto pageZeroMap = std::make_unique<ROnDiskPageMap>();
649 clusterKey, *pageZeroMap,
652 const auto &pageLocator = pageInfo.
GetLocator();
656 activeSize += nBytes;
657 onDiskPages.push_back({physicalColumnId, pageNo, pageLocator.GetPosition<std::uint64_t>(), nBytes, 0});
661 std::sort(onDiskPages.begin(), onDiskPages.end(),
662 [](
const ROnDiskPageLocator &
a,
const ROnDiskPageLocator &
b) { return a.fOffset < b.fOffset; });
671 float maxOverhead = 0.25 * float(activeSize);
672 std::vector<std::size_t> gaps;
673 if (onDiskPages.size())
674 gaps.reserve(onDiskPages.size() - 1);
675 for (
unsigned i = 1; i < onDiskPages.size(); ++i) {
677 static_cast<int64_t
>(onDiskPages[i].fOffset) - (onDiskPages[i - 1].fSize + onDiskPages[i - 1].fOffset);
678 gaps.emplace_back(std::max(gap, std::int64_t(0)));
680 activeSize += std::min(gap, std::int64_t(0));
682 std::sort(gaps.begin(), gaps.end());
683 std::size_t gapCut = 0;
684 std::size_t currentGap = 0;
686 for (
auto g : gaps) {
687 if (
g != currentGap) {
692 if (szExtra > maxOverhead)
700 const auto currentReadRequestIdx = readRequests.size();
704 if (!onDiskPages.empty())
705 req.
fOffset = onDiskPages[0].fOffset;
706 std::size_t szPayload = 0;
707 std::size_t szOverhead = 0;
708 const std::uint64_t maxKeySize =
fReader.GetMaxKeySize();
709 for (
auto &s : onDiskPages) {
713 const std::uint64_t overhead = std::max(
static_cast<std::int64_t
>(s.fOffset) - readUpTo, std::int64_t(0));
714 const std::uint64_t extent = std::max(
static_cast<std::int64_t
>(s.fOffset + s.fSize) - readUpTo, std::int64_t(0));
715 if (req.
fSize + extent < maxKeySize && overhead <= gapCut) {
716 szPayload += (extent - overhead);
717 szOverhead += overhead;
718 s.fBufPos =
reinterpret_cast<intptr_t
>(req.
fBuffer) + s.fOffset - req.
fOffset;
725 readRequests.emplace_back(req);
728 s.fBufPos =
reinterpret_cast<intptr_t
>(req.
fBuffer);
730 szPayload += s.fSize;
734 readRequests.emplace_back(req);
735 fCounters->fSzReadPayload.Add(szPayload);
736 fCounters->fSzReadOverhead.Add(szOverhead);
739 auto buffer =
new unsigned char[
reinterpret_cast<intptr_t
>(req.
fBuffer) + req.
fSize];
740 auto pageMap = std::make_unique<ROOT::Internal::ROnDiskPageMapHeap>(std::unique_ptr<
unsigned char[]>(buffer));
741 for (
const auto &s : onDiskPages) {
743 pageMap->Register(key,
ROnDiskPage(buffer + s.fBufPos, s.fSize));
745 fCounters->fNPageRead.Add(onDiskPages.size());
746 for (
auto i = currentReadRequestIdx; i < readRequests.size(); ++i) {
747 readRequests[i].fBuffer = buffer +
reinterpret_cast<intptr_t
>(readRequests[i].fBuffer);
750 auto cluster = std::make_unique<RCluster>(clusterKey.
fClusterId);
751 cluster->Adopt(std::move(pageMap));
752 cluster->Adopt(std::move(pageZeroMap));
754 cluster->SetColumnAvailable(colId);
758std::vector<std::unique_ptr<ROOT::Internal::RCluster>>
761 fCounters->fNClusterLoaded.Add(clusterKeys.size());
763 std::vector<std::unique_ptr<ROOT::Internal::RCluster>> clusters;
764 std::vector<ROOT::Internal::RRawFile::RIOVec> readRequests;
766 clusters.reserve(clusterKeys.size());
767 for (
auto key : clusterKeys) {
771 auto nReqs = readRequests.size();
772 auto readvLimits =
fFile->GetReadVLimits();
774 readvLimits.fMaxSingleSize = std::min<size_t>(readvLimits.fMaxSingleSize,
fReader.GetMaxKeySize());
778 auto nBatch = std::min(nReqs, readvLimits.fMaxReqs);
780 if (readvLimits.HasSizeLimit()) {
781 std::uint64_t totalSize = 0;
782 for (std::size_t i = 0; i < nBatch; ++i) {
783 if (readRequests[iReq + i].fSize > readvLimits.fMaxSingleSize) {
788 totalSize += readRequests[iReq + i].fSize;
789 if (totalSize > readvLimits.fMaxTotalSize) {
798 for (std::size_t i = 0; i < nBatch; ++i) {
799 const auto offset = readRequests[iReq + i].fOffset;
801 const auto distance =
static_cast<std::uint64_t
>(std::abs(
802 static_cast<std::int64_t
>(offset) -
static_cast<std::int64_t
>(
fLastOffset)));
805 fLastOffset = offset + readRequests[iReq + i].fSize;
811 fReader.ReadBuffer(readRequests[iReq].
fBuffer, readRequests[iReq].fSize, readRequests[iReq].fOffset);
814 fFile->ReadV(&readRequests[iReq], 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.
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.
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...
Managed a set of clusters containing compressed and packed pages.
An in-memory subset of the packed and compressed pages of a cluster.
std::size_t GetSize() const
ROOT::Internal::RColumnElementBase * GetElement() const
Read RNTuple data blocks from a TFile container, provided by a RRawFile.
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.
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.
A helper class for serializing and deserialization of the RNTuple binary format.
static RResult< void > DeserializePageList(const void *buffer, std::uint64_t bufSize, ROOT::DescriptorId_t clusterGroupId, RNTupleDescriptor &desc, EDescriptorDeserializeMode mode)
static RResult< void > DeserializeFooter(const void *buffer, std::uint64_t bufSize, ROOT::Internal::RNTupleDescriptorBuilder &descBuilder)
static RResult< StreamerInfoMap_t > DeserializeStreamerInfos(const std::string &extraTypeInfoContent)
EDescriptorDeserializeMode
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.
void UpdateSchema(const ROOT::Internal::RNTupleModelChangeset &changeset, ROOT::NTupleSize_t firstEntry) override
Incorporate incremental changes to the model into the ntuple descriptor.
ROOT::Internal::RNTupleDescriptorBuilder fDescriptorBuilder
RPagePersistentSink(std::string_view ntupleName, const ROOT::RNTupleWriteOptions &options)
std::unique_ptr< RCounters > fCounters
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSink.
A thread-safe cache of pages loaded from the page source.
std::uint64_t fNBytesCurrentCluster
Number of bytes committed to storage in the current cluster.
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 ...
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 CommitPageImpl(ColumnHandle_t columnHandle, const RPage &page) override
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...
RNTupleLocator CommitSealedPageImpl(ROOT::DescriptorId_t physicalColumnId, const RPageStorage::RSealedPage &sealedPage) final
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.
ROOT::Internal::RNTupleSerializer::StreamerInfoMap_t fInfosOfClassFields
On UpdateSchema(), the new class fields register the corresponding streamer info here so that the str...
std::unique_ptr< ROOT::RNTupleWriteOptions > fOptions
const ROOT::RNTupleWriteOptions & GetWriteOptions() const
Returns the sink's write options.
RSealedPage SealPage(const ROOT::Internal::RPage &page, const ROOT::Internal::RColumnElementBase &element)
Helper for streaming a page.
std::int64_t fFileSize
Total file size, set once in AttachImpl().
RNTupleDescriptorBuilder fDescriptorBuilder
The descriptor is created from the header and footer either in AttachImpl or in CreateFromAnchor.
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::uint64_t fLastOffset
Tracks the last read offset for seek distance calculation.
ROOT::Internal::RCluster * fCurrentCluster
The last cluster from which a page got loaded. Points into fClusterPool->fPool.
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
RPageRef LoadPageImpl(ColumnHandle_t columnHandle, const RClusterInfo &clusterInfo, ROOT::NTupleSize_t idxInCluster) final
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.
ROOT::RNTupleDescriptor AttachImpl(RNTupleSerializer::EDescriptorDeserializeMode mode) final
LoadStructureImpl() has been called before AttachImpl() is called
std::vector< std::unique_ptr< ROOT::Internal::RCluster > > LoadClusters(std::span< ROOT::Internal::RCluster::RKey > clusterKeys) final
std::unique_ptr< RFileCounters > fFileCounters
friend class ROOT::RNTuple
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
void LoadStreamerInfo() final
Forces the loading of ROOT StreamerInfo from the underlying file.
RStructureBuffer fStructureBuffer
Populated by LoadStructureImpl(), reset at the end of Attach().
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.
void LoadSealedPage(ROOT::DescriptorId_t physicalColumnId, RNTupleLocalIndex localIndex, RSealedPage &sealedPage) final
Read the packed and compressed bytes of a page into the memory buffer provided by sealedPage.
ROOT::Internal::RClusterPool fClusterPool
The cluster pool asynchronously preloads the next few clusters.
ROOT::RNTupleReadOptions fOptions
const RSharedDescriptorGuard GetSharedDescriptorGuard() const
Takes the read lock for the descriptor.
void PrepareLoadCluster(const ROOT::Internal::RCluster::RKey &clusterKey, ROOT::Internal::ROnDiskPageMap &pageZeroMap, std::function< void(ROOT::DescriptorId_t, ROOT::NTupleSize_t, const ROOT::RClusterDescriptor::RPageInfo &)> perPageFunc)
Prepare a page range read for the column set in clusterKey.
void EnableDefaultMetrics(const std::string &prefix)
Enables the default set of metrics provided by RPageSource.
std::unique_ptr< RCounters > fCounters
ROOT::Internal::RPagePool fPagePool
Pages that are unzipped with IMT are staged into the page pool.
RPageSource(std::string_view ntupleName, const ROOT::RNTupleReadOptions &fOptions)
RActivePhysicalColumns fActivePhysicalColumns
The active columns are implicitly defined by the model fields or views.
static std::unique_ptr< RPageSource > Create(std::string_view ntupleName, std::string_view location, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Guess the concrete derived page source from the file name (location).
static RResult< ROOT::Internal::RPage > UnsealPage(const RSealedPage &sealedPage, const ROOT::Internal::RColumnElementBase &element, ROOT::Internal::RPageAllocator &pageAlloc)
Helper for unstreaming a page.
std::unique_ptr< ROOT::Internal::RPageAllocator > fPageAllocator
For the time being, we will use the heap allocator for all sources and sinks. This may change in the ...
static constexpr std::size_t kNBytesPageChecksum
The page checksum is a 64bit xxhash3.
RColumnHandle ColumnHandle_t
The column handle identifies a column with the current open page storage.
ROOT::Experimental::Detail::RNTupleMetrics fMetrics
const std::string & GetNTupleName() const
Returns the NTuple name.
Stores information about the cluster in which this page resides.
A page is a slice of a column that is mapped into memory.
std::uint32_t GetNElements() const
std::size_t GetNBytes() const
The space taken by column elements in the buffer.
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...
void SetWindow(const ROOT::NTupleSize_t rangeFirst, const RClusterInfo &clusterInfo)
Seek the page to a certain position of the column.
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.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
ROOT::NTupleSize_t GetIndexInCluster() const
ROOT::DescriptorId_t GetClusterId() const
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
TFile * fFile
! The file from which the ntuple was streamed, registered in the custom streamer
void ThrowOnError()
Short-hand method to throw an exception in the case of errors.
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.
RNTupleTimer< RNTupleAtomicCounter, RNTupleTickCounter< RNTupleAtomicCounter > > RNTupleAtomicTimer
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.
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.
Summarizes cluster-level information that are necessary to load a certain page.
std::uint64_t fColumnOffset
The first element number of the page's column in the given cluster.
ROOT::DescriptorId_t fClusterId
ROOT::RClusterDescriptor::RPageInfoExtended fPageInfo
Location of the page on disk.
ROOT::Internal::RColumn * fColumn
ROOT::DescriptorId_t fPhysicalId
A sealed page contains the bytes of a page as written to storage (packed & compressed).
RResult< void > VerifyChecksumIfEnabled() const
void SetBuffer(const void *buffer)
std::uint32_t GetNElements() const
void SetHasChecksum(bool hasChecksum)
const void * GetBuffer() const
void SetNElements(std::uint32_t nElements)
std::size_t GetBufferSize() const
void SetBufferSize(std::size_t bufferSize)
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.
std::uint32_t GetNElements() const
const RNTupleLocator & GetLocator() const