Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleReadOptions.hxx
Go to the documentation of this file.
1/// \file ROOT/RNTupleReadOptions.hxx
2/// \author Jakob Blomer <jblomer@cern.ch>
3/// \date 2024-02-22
4
5/*************************************************************************
6 * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
13#ifndef ROOT_RNTupleReadOptions
14#define ROOT_RNTupleReadOptions
15
16#include <cstdint>
17
18namespace ROOT {
19
20class RNTupleReadOptions;
21
22namespace Internal {
23
25public:
26 static unsigned int GetClusterBunchSize(const RNTupleReadOptions &options);
27 static void SetClusterBunchSize(RNTupleReadOptions &options, unsigned int val);
28 static std::uint64_t GetMaxEnvelopeSize(const RNTupleReadOptions &options);
29 static void SetMaxEnvelopeSize(RNTupleReadOptions &options, std::uint64_t val);
30};
31
32} // namespace Internal
33
34// clang-format off
35/**
36\class ROOT::RNTupleReadOptions
37\ingroup NTuple
38\brief Common user-tunable settings for reading RNTuples
39
40All page source classes need to support the common options.
41
42<table>
43<tr>
44<th>Option name</th>
45<th>Type</th>
46<th>Default</th>
47<th>Description</th>
48</tr>
49
50<tr>
51<td>`ClusterCache`</td>
52<td>EClusterCache</td>
53<td>EClusterCache::kDefault</td>
54<td>
55Controls if the prefetcher (including the prefetcher thread) is used
56</td>
57</tr>
58
59<tr>
60<td>`UseImplicitMT`</td>
61<td>EImplicitMT</td>
62<td>EImplicitMT::kDefault</td>
63<td>
64Allows to disable parallel page compression and decompression even if ROOT uses implicit MT.
65This is useful, e.g., in the context of RDataFrame where the threads are fully managed by RDataFrame.
66</td>
67</tr>
68
69<tr>
70<td>`EMetadataMode`</td>
71<td>EMetadataMode</td>
72<td>EMetadataMode::kDefault</td>
73<td>
74Set whether cluster metadata (page locations) are loaded entirely on open or on demand during entry iteration.
75By default, the RNTuple reader loads metadata on demand.
76</td>
77</tr>
78
79<tr>
80<td>`EnableMetrics`</td>
81<td>`bool`</td>
82<td>`false`</td>
83<td>
84If `true`, the RNTupleReader will track metrics straight from its construction, as
85if calling RNTupleReader::EnableMetrics() before having created the object.
86</td>
87</tr>
88</table>
89*/
90// clang-format on
93
94public:
95 enum class EClusterCache {
96 kOff,
97 kOn,
98 kDefault = kOn,
99 };
100
101 enum class EImplicitMT {
102 kOff,
103 kDefault,
104 };
105
106 enum class EMetadataMode {
107 kEager,
108 kOnDemand,
110 };
111
112private:
114 /// The number of cluster to be prefetched in a single batch; this option is transitional and will be replaced
115 /// by an option that allows to control the amount of memory that the prefetcher uses.
116 unsigned int fClusterBunchSize = 1;
119 bool fEnableMetrics = false;
120 /// Largest header or footer envelope a page source will accept from an anchor it does not fully trust,
121 /// such as the S3 anchor, which is a separately stored object. Guards the allocation made from those sizes.
122 std::uint64_t fMaxEnvelopeSize = 1024 * 1024 * 1024;
123
124public:
127
130
133
134 bool GetEnableMetrics() const { return fEnableMetrics; }
135 void SetEnableMetrics(bool val) { fEnableMetrics = val; }
136}; // class RNTupleReadOptions
137
138namespace Internal {
139
141{
142 return options.fClusterBunchSize;
143}
144
146{
147 options.fClusterBunchSize = val;
148}
149
151{
152 return options.fMaxEnvelopeSize;
153}
154
156{
157 options.fMaxEnvelopeSize = val;
158}
159
160} // namespace Internal
161} // namespace ROOT
162
163#endif
static void SetMaxEnvelopeSize(RNTupleReadOptions &options, std::uint64_t val)
static void SetClusterBunchSize(RNTupleReadOptions &options, unsigned int val)
static unsigned int GetClusterBunchSize(const RNTupleReadOptions &options)
static std::uint64_t GetMaxEnvelopeSize(const RNTupleReadOptions &options)
Common user-tunable settings for reading RNTuples.
std::uint64_t fMaxEnvelopeSize
Largest header or footer envelope a page source will accept from an anchor it does not fully trust,...
void SetMetadataMode(EMetadataMode val)
EClusterCache GetClusterCache() const
void SetClusterCache(EClusterCache val)
void SetUseImplicitMT(EImplicitMT val)
EImplicitMT GetUseImplicitMT() const
unsigned int fClusterBunchSize
The number of cluster to be prefetched in a single batch; this option is transitional and will be rep...
EMetadataMode GetMetadataMode() const