13#ifndef ROOT_RNTupleFillContext
14#define ROOT_RNTupleFillContext
60 std::unique_ptr<ROOT::Internal::RPageStorage::RTaskScheduler>
fZipTasks;
61 std::unique_ptr<ROOT::Internal::RPageSink>
fSink;
63 std::unique_ptr<ROOT::RNTupleModel>
fModel;
87 template <
typename Entry>
93 const std::size_t bytesWritten = entry.Append();
103 template <
typename Entry>
113 RNTupleFillContext(std::unique_ptr<ROOT::RNTupleModel> model, std::unique_ptr<ROOT::Internal::RPageSink> sink);
159 return fModel->CreateRawPtrWriteEntry();
170 throw RException(
R__FAIL(
"cannot disable staged committing with pending clusters"));
#define R__unlikely(expr)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
A container of const raw pointers, corresponding to a row in the data set.
A collection of Counter objects with a name, a unit, and a description.
Class used to write an RNTupleAttrSet in the context of an RNTupleWriter.
The REntry is a collection of values in an RNTuple corresponding to a complete row in the data set.
Base class for all ROOT issued exceptions.
void FlushCluster()
Flush so far filled entries to storage.
friend class RNTupleParallelWriter
ROOT::NTupleSize_t fLastFlushed
void FillNoFlushImpl(Entry &entry, ROOT::RNTupleFillStatus &status)
std::size_t fUnzippedClusterSizeEst
Estimator of uncompressed cluster size, taking into account the estimated compression ratio.
std::size_t Fill(ROOT::Detail::RRawPtrWriteEntry &entry)
Fill an RRawPtrWriteEntry into this context.
std::uint64_t fNBytesFilled
The total number of bytes filled into all the so far committed clusters, i.e.
void EnableStagedClusterCommitting(bool val=true)
ROOT::NTupleSize_t GetLastFlushed() const
Return the entry number that was last flushed in a cluster.
Experimental::Detail::RNTupleMetrics fMetrics
bool IsStagedClusterCommittingEnabled() const
ROOT::NTupleSize_t GetNEntries() const
Return the number of entries filled so far.
std::uint64_t fNBytesFlushed
The total number of bytes written to storage (i.e., after compression).
std::size_t FillImpl(Entry &entry)
std::vector< ROOT::Internal::RPageSink::RStagedCluster > fStagedClusters
Vector of currently staged clusters.
void FlushColumns()
Flush column data, preparing for CommitCluster or to reduce memory usage.
std::unique_ptr< ROOT::REntry > CreateEntry() const
RNTupleFillContext(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< ROOT::Internal::RPageSink > sink)
std::size_t fUnzippedClusterSize
Keeps track of the number of bytes written into the current cluster.
std::unique_ptr< ROOT::Detail::RRawPtrWriteEntry > CreateRawPtrWriteEntry() const
const ROOT::RNTupleModel & GetModel() const
RNTupleFillContext & operator=(const RNTupleFillContext &)=delete
const Experimental::Detail::RNTupleMetrics & GetMetrics() const
void FillNoFlush(ROOT::Detail::RRawPtrWriteEntry &entry, ROOT::RNTupleFillStatus &status)
Fill an RRawPtrWriteEntry into this context, but don't commit the cluster.
RNTupleFillContext(RNTupleFillContext &&)=delete
ROOT::NTupleSize_t fNEntries
void CommitStagedClusters()
Logically append staged clusters to the RNTuple.
RNTupleFillContext(const RNTupleFillContext &)=delete
RNTupleFillContext & operator=(RNTupleFillContext &&)=delete
bool fStagedClusterCommitting
Whether to enable staged cluster committing, where only an explicit call to CommitStagedClusters() wi...
std::unique_ptr< ROOT::Internal::RPageStorage::RTaskScheduler > fZipTasks
The page sink's parallel page compression scheduler if IMT is on.
std::unique_ptr< ROOT::RNTupleModel > fModel
Needs to be destructed before fSink.
std::unique_ptr< ROOT::Internal::RPageSink > fSink
std::size_t fMaxUnzippedClusterSize
Limit for committing cluster no matter the other tunables.
void FillNoFlush(ROOT::REntry &entry, ROOT::RNTupleFillStatus &status)
Fill an entry into this context, but don't commit the cluster.
std::size_t Fill(ROOT::REntry &entry)
Fill an entry into this context.
A status object after filling an entry.
ROOT::NTupleSize_t fNEntriesSinceLastFlush
Number of entries written into the current cluster.
std::size_t fUnzippedClusterSize
Number of bytes written into the current cluster.
std::size_t fLastEntrySize
Number of bytes written for the last entry.
bool ShouldFlushCluster() const
Return true if the caller should call FlushCluster.
std::size_t GetLastEntrySize() const
Return the number of bytes for the last entry.
The RNTupleModel encapulates the schema of an RNTuple.
An RNTuple that gets filled with entries (data) and writes them to storage.
Namespace for ROOT features in testing.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.