16#ifndef ROOT7_RNTupleWriter
17#define ROOT7_RNTupleWriter
38namespace Experimental {
40class RNTupleWriteOptions;
44std::unique_ptr<RNTupleWriter>
45CreateRNTupleWriter(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Internal::RPageSink> sink);
62 friend std::unique_ptr<RNTupleWriter>
68 std::unique_ptr<Internal::RPageStorage::RTaskScheduler>
fZipTasks;
74 RNTupleWriter(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Internal::RPageSink> sink);
83 static std::unique_ptr<RNTupleWriter>
Create(std::unique_ptr<RNTupleModel> model,
84 std::unique_ptr<Internal::RPageSink> sink,
89 static std::unique_ptr<RNTupleWriter>
Recreate(std::unique_ptr<RNTupleModel> model, std::string_view ntupleName,
90 std::string_view storage,
92 static std::unique_ptr<RNTupleWriter>
93 Recreate(std::initializer_list<std::pair<std::string_view, std::string_view>> fields, std::string_view ntupleName,
96 static std::unique_ptr<RNTupleWriter>
Append(std::unique_ptr<RNTupleModel> model, std::string_view ntupleName,
122 if (commitClusterGroup)
163 return std::make_unique<RNTupleModel::RUpdater>(*
this);
A collection of Counter objects with a name, a unit, and a description.
Abstract interface to write data into an ntuple.
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
A context for filling entries (data) into clusters of an RNTuple.
void FlushCluster()
Flush so far filled entries to storage.
void FillNoFlush(REntry &entry, RNTupleFillStatus &status)
Fill an entry into this context, but don't commit the cluster.
std::size_t Fill(REntry &entry)
Fill an entry into this context.
std::unique_ptr< RNTupleModel > fModel
Needs to be destructed before fSink.
NTupleSize_t GetNEntries() const
Return the number of entries filled so far.
std::unique_ptr< REntry > CreateEntry()
NTupleSize_t GetLastFlushed() const
Return the entry number that was last flushed in a cluster.
void FlushColumns()
Flush column data, preparing for CommitCluster or to reduce memory usage.
std::unique_ptr< Internal::RPageSink > fSink
A status object after filling an entry.
A model is usually immutable after passing it to an RNTupleWriter.
The RNTupleModel encapulates the schema of an ntuple.
Common user-tunable settings for storing ntuples.
An RNTuple that gets filled with entries (data) and writes them to storage.
void FlushCluster()
Flush so far filled entries to storage.
std::unique_ptr< RNTupleModel::RUpdater > CreateModelUpdater()
Get a RNTupleModel::RUpdater that provides limited support for incremental updates to the underlying ...
Internal::RPageSink & GetSink()
const Detail::RNTupleMetrics & GetMetrics() const
NTupleSize_t GetLastCommittedClusterGroup() const
Return the entry number that was last committed in a cluster group.
std::unique_ptr< Internal::RPageStorage::RTaskScheduler > fZipTasks
The page sink's parallel page compression scheduler if IMT is on.
void FillNoFlush(REntry &entry, RNTupleFillStatus &status)
Fill an entry into this ntuple, but don't commit the cluster.
const RNTupleModel & GetModel() const
void FlushColumns()
Flush column data, preparing for CommitCluster or to reduce memory usage.
std::size_t Fill()
The simplest user interface if the default entry that comes with the ntuple model is used.
NTupleSize_t GetLastFlushed() const
Return the entry number that was last flushed in a cluster.
std::unique_ptr< REntry > CreateEntry()
static std::unique_ptr< RNTupleWriter > Create(std::unique_ptr< RNTupleModel > model, std::unique_ptr< Internal::RPageSink > sink, const RNTupleWriteOptions &options)
Create a writer, potentially wrapping the sink in a RPageSinkBuf.
RNTupleModel & GetUpdatableModel()
NTupleSize_t GetLastCommitted() const
Return the entry number that was last committed in a cluster.
void CommitCluster(bool commitClusterGroup=false)
Ensure that the data from the so far seen Fill calls has been written to storage.
RNTupleWriter(const RNTupleWriter &)=delete
void CommitClusterGroup()
Detail::RNTupleMetrics fMetrics
std::size_t Fill(REntry &entry)
Multiple entries can have been instantiated from the ntuple model.
RNTupleWriter & operator=(const RNTupleWriter &)=delete
NTupleSize_t fLastCommittedClusterGroup
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const RNTupleWriteOptions &options=RNTupleWriteOptions())
Throws an exception if the model is null.
NTupleSize_t GetNEntries() const
Return the number of entries filled so far.
RNTupleFillContext fFillContext
static std::unique_ptr< RNTupleWriter > Append(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, TFile &file, const RNTupleWriteOptions &options=RNTupleWriteOptions())
Throws an exception if the model is null.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
std::unique_ptr< RNTupleWriter > CreateRNTupleWriter(std::unique_ptr< RNTupleModel > model, std::unique_ptr< Internal::RPageSink > sink)
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...