14#ifndef ROOT_RNTupleFillContext
15#define ROOT_RNTupleFillContext
56 std::unique_ptr<ROOT::Internal::RPageStorage::RTaskScheduler>
fZipTasks;
57 std::unique_ptr<ROOT::Internal::RPageSink>
fSink;
59 std::unique_ptr<ROOT::RNTupleModel>
fModel;
83 template <
typename Entry>
99 template <
typename Entry>
109 RNTupleFillContext(std::unique_ptr<ROOT::RNTupleModel> model, std::unique_ptr<ROOT::Internal::RPageSink>
sink);
153 return fModel->CreateRawPtrWriteEntry();
164 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...
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.
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.
A context for filling entries (data) into clusters of an RNTuple.
void FlushCluster()
Flush so far filled entries to storage.
ROOT::NTupleSize_t fLastFlushed
std::size_t Fill(Experimental::Detail::RRawPtrWriteEntry &entry)
Fill an RRawPtrWriteEntry into this context.
void FillNoFlushImpl(Entry &entry, ROOT::RNTupleFillStatus &status)
std::size_t fUnzippedClusterSizeEst
Estimator of uncompressed cluster size, taking into account the estimated compression ratio.
void FillNoFlush(Experimental::Detail::RRawPtrWriteEntry &entry, ROOT::RNTupleFillStatus &status)
Fill an RRawPtrWriteEntry into this context, but don't commit the cluster.
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< Experimental::Detail::RRawPtrWriteEntry > CreateRawPtrWriteEntry() const
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.
const ROOT::RNTupleModel & GetModel() const
RNTupleFillContext & operator=(const RNTupleFillContext &)=delete
const Experimental::Detail::RNTupleMetrics & GetMetrics() const
ROOT::NTupleSize_t fNEntries
void CommitStagedClusters()
Logically append staged clusters to the RNTuple.
RNTupleFillContext(const 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.
A writer to fill an RNTuple from multiple contexts.
An RNTuple that gets filled with entries (data) and writes them to storage.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.