Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RPageNullSink.hxx
Go to the documentation of this file.
1/// \file ROOT/RPageNullSink.hxx
2/// \ingroup NTuple
3/// \author Jonas Hahnfeld <jonas.hahnfeld@cern.ch>
4/// \date 2024-01-31
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef ROOT_RPageNullSink
17#define ROOT_RPageNullSink
18
19#include <ROOT/RColumn.hxx>
20#include <ROOT/RFieldBase.hxx>
21#include <ROOT/RNTupleModel.hxx>
22#include <ROOT/RPageStorage.hxx>
23
24namespace ROOT {
25namespace Experimental {
26namespace Internal {
27
28/**
29\class ROOT::Experimental::Internal::RPageNullSink
30\ingroup NTuple
31\brief Dummy sink that discards all pages
32
33The RPageNullSink class is for internal testing only and can be used to measure the software overhead of serializing
34elements into pages, without actually writing them onto disk or even serializing the RNTuple headers and footers.
35*/
38 std::uint64_t fNBytesCurrentCluster = 0;
39
40public:
41 RPageNullSink(std::string_view ntupleName, const ROOT::RNTupleWriteOptions &options) : RPageSink(ntupleName, options)
42 {
43 }
44
46 {
47 return {fNColumns++, &column};
48 }
49
55
57
58 void ConnectFields(const std::vector<ROOT::RFieldBase *> &fields, ROOT::NTupleSize_t firstEntry)
59 {
60 auto connectField = [&](ROOT::RFieldBase &f) {
62 };
63 for (auto *f : fields) {
65 for (auto &descendant : *f) {
67 }
68 }
69 }
70 void InitImpl(ROOT::RNTupleModel &model) final
71 {
73 ConnectFields(fieldZero.GetMutableSubfields(), 0);
74 }
80
83 {
84 fNBytesCurrentCluster += page.GetNBytes();
85 }
87 {
88 fNBytesCurrentCluster += page.GetBufferSize();
89 }
90 void CommitSealedPageV(std::span<RSealedPageGroup> ranges) final
91 {
92 for (auto &range : ranges) {
93 for (auto sealedPageIt = range.fFirst; sealedPageIt != range.fLast; ++sealedPageIt) {
94 fNBytesCurrentCluster += sealedPageIt->GetBufferSize();
95 }
96 }
97 }
98
106 void CommitStagedClusters(std::span<RStagedCluster>) final {}
109};
110
111} // namespace Internal
112} // namespace Experimental
113} // namespace ROOT
114
115#endif
#define f(i)
Definition RSha256.hxx:104
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Dummy sink that discards all pages.
void CommitSuppressedColumn(ColumnHandle_t) final
Commits a suppressed column for the current cluster.
void UpdateSchema(const ROOT::Internal::RNTupleModelChangeset &changeset, ROOT::NTupleSize_t firstEntry) final
Incorporate incremental changes to the model into the ntuple descriptor.
ROOT::NTupleSize_t GetNEntries() const final
void CommitClusterGroup() final
Write out the page locations (page list envelope) for all the committed clusters since the last call ...
void CommitSealedPageV(std::span< RSealedPageGroup > ranges) final
Write a vector of preprocessed pages to storage. The corresponding columns must have been added befor...
void InitImpl(ROOT::RNTupleModel &model) final
void UpdateExtraTypeInfo(const ROOT::RExtraTypeInfoDescriptor &) final
Adds an extra type information record to schema.
const ROOT::RNTupleDescriptor & GetDescriptor() const final
Return the RNTupleDescriptor being constructed.
RStagedCluster StageCluster(ROOT::NTupleSize_t) final
Stage the current cluster and create a new one for the following data.
void CommitStagedClusters(std::span< RStagedCluster >) final
Commit staged clusters, logically appending them to the ntuple descriptor.
void CommitSealedPage(ROOT::DescriptorId_t, const RSealedPage &page) final
Write a preprocessed page to storage. The column must have been added before.
void CommitPage(ColumnHandle_t, const ROOT::Internal::RPage &page) final
Write a page to the storage. The column must have been added before.
RPageNullSink(std::string_view ntupleName, const ROOT::RNTupleWriteOptions &options)
ColumnHandle_t AddColumn(ROOT::DescriptorId_t, ROOT::Internal::RColumn &column) final
Register a new column.
void ConnectFields(const std::vector< ROOT::RFieldBase * > &fields, ROOT::NTupleSize_t firstEntry)
A column is a storage-backed array of a simple, fixed-size type, from which pages can be mapped into ...
Definition RColumn.hxx:38
Abstract interface to write data into an ntuple.
A page is a slice of a column that is mapped into memory.
Definition RPage.hxx:44
Field specific extra type information from the header / extenstion header.
A field translates read and write calls from/to underlying columns to/from tree values.
The on-storage metadata of an RNTuple.
The RNTupleModel encapulates the schema of an RNTuple.
Common user-tunable settings for storing RNTuples.
ROOT::RFieldZero & GetFieldZeroOfModel(RNTupleModel &model)
void CallConnectPageSinkOnField(RFieldBase &, ROOT::Internal::RPageSink &, ROOT::NTupleSize_t firstEntry=0)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
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 incremental changes to a RNTupleModel
Cluster that was staged, but not yet logically appended to the RNTuple.
A sealed page contains the bytes of a page as written to storage (packed & compressed).