16#ifndef ROOT7_RNTupleWriter
17#define ROOT7_RNTupleWriter
40class RNTupleWriteOptions;
44std::unique_ptr<RNTupleWriter>
45CreateRNTupleWriter(std::unique_ptr<ROOT::RNTupleModel> model, std::unique_ptr<Experimental::Internal::RPageSink>
sink);
62 friend std::unique_ptr<RNTupleWriter>
64 std::unique_ptr<Experimental::Internal::RPageSink>);
69 std::unique_ptr<Experimental::Internal::RPageStorage::RTaskScheduler>
fZipTasks;
75 RNTupleWriter(std::unique_ptr<ROOT::RNTupleModel> model, std::unique_ptr<Experimental::Internal::RPageSink>
sink);
84 static std::unique_ptr<RNTupleWriter>
Create(std::unique_ptr<ROOT::RNTupleModel> model,
85 std::unique_ptr<Experimental::Internal::RPageSink>
sink,
90 static std::unique_ptr<RNTupleWriter>
93 static std::unique_ptr<RNTupleWriter>
97 static std::unique_ptr<RNTupleWriter>
Append(std::unique_ptr<ROOT::RNTupleModel> model, std::string_view
ntupleName,
182 return std::make_unique<ROOT::RNTupleModel::RUpdater>(*
this);
186namespace Experimental {
188using RNTupleWriter [[deprecated(
"ROOT::Experimental::RNTupleWriter moved to ROOT::RNTupleWriter")]] =
A collection of Counter objects with a name, a unit, and a description.
A container of const raw pointers, corresponding to a row in the data set.
Abstract interface to write data into an ntuple.
A context for filling entries (data) into clusters of an RNTuple.
ROOT::NTupleSize_t GetNEntries() const
Return the number of entries filled so far.
void FillNoFlush(ROOT::REntry &entry, ROOT::RNTupleFillStatus &status)
Fill an entry into this context, but don't commit the cluster.
std::unique_ptr< ROOT::RNTupleModel > fModel
Needs to be destructed before fSink.
void FlushCluster()
Flush so far filled entries to storage.
std::size_t Fill(ROOT::REntry &entry)
Fill an entry into this context.
ROOT::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< ROOT::REntry > CreateEntry() const
std::unique_ptr< Internal::RPageSink > fSink
std::unique_ptr< Detail::RRawPtrWriteEntry > CreateRawPtrWriteEntry() const
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
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 RNTuple.
Common user-tunable settings for storing RNTuples.
An RNTuple that gets filled with entries (data) and writes them to storage.
std::unique_ptr< ROOT::REntry > CreateEntry() const
std::size_t Fill(Experimental::Detail::RRawPtrWriteEntry &entry)
Fill an RRawPtrWriteEntry into this ntuple.
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< ROOT::RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Throws an exception if the model is null.
RNTupleWriter(const RNTupleWriter &)=delete
Experimental::Detail::RNTupleMetrics fMetrics
const Experimental::Detail::RNTupleMetrics & GetMetrics() const
void CommitClusterGroup()
ROOT::RNTupleModel & GetUpdatableModel()
void FillNoFlush(Experimental::Detail::RRawPtrWriteEntry &entry, RNTupleFillStatus &status)
Fill an RRawPtrWriteEntry into this ntuple, but don't commit the cluster.
static std::unique_ptr< RNTupleWriter > Create(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Experimental::Internal::RPageSink > sink, const ROOT::RNTupleWriteOptions &options)
Create a writer, potentially wrapping the sink in a RPageSinkBuf.
static std::unique_ptr< RNTupleWriter > Append(std::unique_ptr< ROOT::RNTupleModel > model, std::string_view ntupleName, TDirectory &fileOrDirectory, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Throws an exception if the model is null.
std::size_t Fill(ROOT::REntry &entry)
Multiple entries can have been instantiated from the ntuple model.
void FillNoFlush(ROOT::REntry &entry, RNTupleFillStatus &status)
Fill an entry into this ntuple, but don't commit the cluster.
ROOT::NTupleSize_t GetLastCommitted() const
Return the entry number that was last committed in a cluster.
ROOT::NTupleSize_t GetLastCommittedClusterGroup() const
Return the entry number that was last committed in a cluster group.
void CommitDataset()
Closes the underlying file (page sink) and expires the model.
const ROOT::RNTupleModel & GetModel() const
ROOT::NTupleSize_t fLastCommittedClusterGroup
void FlushColumns()
Flush column data, preparing for CommitCluster or to reduce memory usage.
RNTupleWriter(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Experimental::Internal::RPageSink > sink)
RNTupleWriter & operator=(const RNTupleWriter &)=delete
ROOT::NTupleSize_t GetLastFlushed() const
Return the entry number that was last flushed in a cluster.
std::unique_ptr< Experimental::Detail::RRawPtrWriteEntry > CreateRawPtrWriteEntry() const
std::unique_ptr< ROOT::RNTupleModel::RUpdater > CreateModelUpdater()
Get a RNTupleModel::RUpdater that provides limited support for incremental updates to the underlying ...
std::unique_ptr< Experimental::Internal::RPageStorage::RTaskScheduler > fZipTasks
The page sink's parallel page compression scheduler if IMT is on.
void FlushCluster()
Flush so far filled entries to storage.
ROOT::NTupleSize_t GetNEntries() const
Return the number of entries filled so far.
void CommitCluster(bool commitClusterGroup=false)
Ensure that the data from the so far seen Fill calls has been written to storage.
Experimental::Internal::RPageSink & GetSink()
Experimental::RNTupleFillContext fFillContext
std::size_t Fill()
The simplest user interface if the default entry that comes with the ntuple model is used.
Describe directory structure in memory.
std::unique_ptr< RNTupleWriter > CreateRNTupleWriter(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Experimental::Internal::RPageSink > sink)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.