36namespace Experimental {
73 void AddTask(const std::function<
void(
void)> &taskFunc) final;
94 std::unique_ptr<Detail::RPageStorage::RTaskScheduler>
fUnzipTasks;
96 std::unique_ptr<Detail::RPageSource>
fSource;
98 std::unique_ptr<RNTupleModel>
fModel;
107 void InitPageSource();
135 static std::unique_ptr<RNTupleReader> Open(std::unique_ptr<RNTupleModel> model,
136 std::string_view ntupleName,
137 std::string_view storage,
139 static std::unique_ptr<RNTupleReader> Open(std::string_view ntupleName,
140 std::string_view storage,
144 RNTupleReader(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Detail::RPageSource> source);
146 explicit RNTupleReader(std::unique_ptr<Detail::RPageSource> source);
147 std::unique_ptr<RNTupleReader>
Clone() {
return std::make_unique<RNTupleReader>(fSource->Clone()); }
161 std::ostream &
output = std::cout);
170 fModel = fSource->GetDescriptor().GenerateModel();
171 ConnectModel(*fModel);
174 for (
auto& value : entry) {
175 value.GetField()->Read(index, &value);
184 template <
typename T>
186 auto fieldId = fSource->GetDescriptor().FindFieldId(fieldName);
190 auto fieldId = fSource->GetDescriptor().FindFieldId(fieldName);
216 std::unique_ptr<Detail::RPageSink>
fSink;
224 static std::unique_ptr<RNTupleWriter> Recreate(std::unique_ptr<RNTupleModel> model,
225 std::string_view ntupleName,
226 std::string_view storage,
228 static std::unique_ptr<RNTupleWriter> Append(std::unique_ptr<RNTupleModel> model,
229 std::string_view ntupleName,
232 RNTupleWriter(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Detail::RPageSink> sink);
242 for (
auto& value : entry) {
243 value.GetField()->Append(value);
246 if ((fNEntries % fClusterSizeEntries) == 0)
250 void CommitCluster();
276 for (
auto& treeValue : *entry) {
277 treeValue.GetField()->Append(treeValue);
#define R__unlikely(expr)
TTime operator*(const TTime &t1, const TTime &t2)
A collection of Counter objects with a name, a unit, and a description.
The interface of a task scheduler to schedule page (de)compression tasks.
A virtual ntuple for collections that can be used to some extent like a real ntuple.
ClusterSize_t * GetOffsetPtr()
RCollectionNTuple(const RCollectionNTuple &)=delete
std::unique_ptr< REntry > fDefaultEntry
~RCollectionNTuple()=default
RCollectionNTuple & operator=(const RCollectionNTuple &)=delete
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
The on-storage meta-data of an ntuple.
Used to loop over indexes (entries or collections) between start and end.
void Reset() final
Start a new set of tasks.
std::unique_ptr< TTaskGroup > fTaskGroup
void AddTask(const std::function< void(void)> &taskFunc) final
Take a callable that represents a task.
virtual ~RNTupleImtTaskScheduler()=default
void Wait() final
Blocks until all scheduled tasks finished.
The RNTupleModel encapulates the schema of an ntuple.
Common user-tunable settings for reading ntuples.
NTupleSize_t difference_type
bool operator!=(const iterator &rh) const
bool operator==(const iterator &rh) const
RIterator(NTupleSize_t index)
std::forward_iterator_tag iterator_category
An RNTuple that is used to read data from storage.
std::unique_ptr< RNTupleReader > Clone()
Detail::RNTupleMetrics fMetrics
std::unique_ptr< Detail::RPageStorage::RTaskScheduler > fUnzipTasks
Set as the page source's scheduler for parallel page decompression if IMT is on Needs to be destructe...
std::unique_ptr< RNTupleReader > fDisplayReader
We use a dedicated on-demand reader for Show() and Scan().
const Detail::RNTupleMetrics & GetMetrics() const
const RNTupleDescriptor & GetDescriptor() const
RNTupleView< T > GetView(std::string_view fieldName)
Provides access to an individual field that can contain either a scalar value or a collection,...
NTupleSize_t GetNEntries() const
std::unique_ptr< Detail::RPageSource > fSource
RNTupleGlobalRange GetEntryRange()
RNTupleViewCollection GetViewCollection(std::string_view fieldName)
void LoadEntry(NTupleSize_t index)
Analogous to Fill(), fills the default entry of the model.
std::unique_ptr< RNTupleModel > fModel
Needs to be destructed before fSource.
void LoadEntry(NTupleSize_t index, REntry &entry)
Fills a user provided entry after checking that the entry has been instantiated from the ntuple model...
A view for a collection, that can itself generate new ntuple views for its nested fields.
An RNTupleView provides read-only access to a single field of the ntuple.
Common user-tunable settings for storing ntuples.
An RNTuple that gets filled with entries (data) and writes them to storage.
NTupleSize_t fLastCommitted
std::unique_ptr< RNTupleModel > fModel
Needs to be destructed before fSink.
RNTupleWriter(const RNTupleWriter &)=delete
RNTupleWriter & operator=(const RNTupleWriter &)=delete
std::unique_ptr< Detail::RPageSink > fSink
void Fill()
The simplest user interface if the default entry that comes with the ntuple model is used.
NTupleSize_t fClusterSizeEntries
void Fill(REntry &entry)
Multiple entries can have been instantiated from the tnuple model.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
ENTupleInfo
Listing of the different options that can be printed by RNTupleReader::GetInfo()
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr NTupleSize_t kInvalidNTupleIndex
ENTupleShowFormat
Listing of the different entry output formats of RNTupleReader::Show()
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...
static void output(int code)