A context for filling entries (data) into clusters of an RNTuple.
An output cluster can be filled with entries. The caller has to make sure that the data that gets filled into a cluster is not modified for the time of the Fill() call. The fill call serializes the C++ object into the column format and writes data into the corresponding column page buffers. Writing of the buffers to storage is deferred and can be triggered by FlushCluster() or by destructing the context. On I/O errors, an exception is thrown.
Instances of this class are not meant to be used in isolation and can be created from an RNTupleParallelWriter. For sequential writing, please refer to RNTupleWriter.
Definition at line 52 of file RNTupleFillContext.hxx.
Public Member Functions | |
~RNTupleFillContext () | |
void | CommitStagedClusters () |
Logically append staged clusters to the RNTuple. | |
std::unique_ptr< ROOT::REntry > | CreateEntry () const |
std::unique_ptr< Detail::RRawPtrWriteEntry > | CreateRawPtrWriteEntry () const |
void | EnableMetrics () |
void | EnableStagedClusterCommitting (bool val=true) |
std::size_t | Fill (Detail::RRawPtrWriteEntry &entry) |
Fill an RRawPtrWriteEntry into this context. | |
std::size_t | Fill (ROOT::REntry &entry) |
Fill an entry into this context. | |
void | FillNoFlush (Detail::RRawPtrWriteEntry &entry, ROOT::RNTupleFillStatus &status) |
Fill an RRawPtrWriteEntry into this context, but don't commit the cluster. | |
void | FillNoFlush (ROOT::REntry &entry, ROOT::RNTupleFillStatus &status) |
Fill an entry into this context, but don't commit the cluster. | |
void | FlushCluster () |
Flush so far filled entries to storage. | |
void | FlushColumns () |
Flush column data, preparing for CommitCluster or to reduce memory usage. | |
ROOT::NTupleSize_t | GetLastFlushed () const |
Return the entry number that was last flushed in a cluster. | |
const Detail::RNTupleMetrics & | GetMetrics () const |
const ROOT::RNTupleModel & | GetModel () const |
ROOT::NTupleSize_t | GetNEntries () const |
Return the number of entries filled so far. | |
bool | IsStagedClusterCommittingEnabled () const |
Private Member Functions | |
RNTupleFillContext (const RNTupleFillContext &)=delete | |
RNTupleFillContext (std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< ROOT::Internal::RPageSink > sink) | |
template<typename Entry > | |
std::size_t | FillImpl (Entry &entry) |
template<typename Entry > | |
void | FillNoFlushImpl (Entry &entry, ROOT::RNTupleFillStatus &status) |
RNTupleFillContext & | operator= (const RNTupleFillContext &)=delete |
Private Attributes | |
ROOT::NTupleSize_t | fLastFlushed = 0 |
std::size_t | fMaxUnzippedClusterSize |
Limit for committing cluster no matter the other tunables. | |
Detail::RNTupleMetrics | fMetrics |
std::unique_ptr< ROOT::RNTupleModel > | fModel |
Needs to be destructed before fSink. | |
std::uint64_t | fNBytesFilled = 0 |
The total number of bytes filled into all the so far committed clusters, i.e. | |
std::uint64_t | fNBytesFlushed = 0 |
The total number of bytes written to storage (i.e., after compression) | |
ROOT::NTupleSize_t | fNEntries = 0 |
std::unique_ptr< ROOT::Internal::RPageSink > | fSink |
bool | fStagedClusterCommitting = false |
Whether to enable staged cluster committing, where only an explicit call to CommitStagedClusters() will logically append the clusters to the RNTuple. | |
std::vector< ROOT::Internal::RPageSink::RStagedCluster > | fStagedClusters |
Vector of currently staged clusters. | |
std::size_t | fUnzippedClusterSize = 0 |
Keeps track of the number of bytes written into the current cluster. | |
std::size_t | fUnzippedClusterSizeEst |
Estimator of uncompressed cluster size, taking into account the estimated compression ratio. | |
std::unique_ptr< ROOT::Internal::RPageStorage::RTaskScheduler > | fZipTasks |
The page sink's parallel page compression scheduler if IMT is on. | |
Friends | |
class | RNTupleParallelWriter |
class | ROOT::RNTupleWriter |
#include <ROOT/RNTupleFillContext.hxx>
|
private |
Definition at line 30 of file RNTupleFillContext.cxx.
|
privatedelete |
ROOT::Experimental::RNTupleFillContext::~RNTupleFillContext | ( | ) |
Definition at line 45 of file RNTupleFillContext.cxx.
void ROOT::Experimental::RNTupleFillContext::CommitStagedClusters | ( | ) |
Logically append staged clusters to the RNTuple.
Definition at line 94 of file RNTupleFillContext.cxx.
|
inline |
Definition at line 153 of file RNTupleFillContext.hxx.
|
inline |
Definition at line 154 of file RNTupleFillContext.hxx.
|
inline |
Definition at line 173 of file RNTupleFillContext.hxx.
|
inline |
Definition at line 164 of file RNTupleFillContext.hxx.
|
inline |
Fill an RRawPtrWriteEntry into this context.
This method will check the entry's model ID to ensure it comes from the context's own model or throw an exception otherwise.
Definition at line 142 of file RNTupleFillContext.hxx.
|
inline |
Fill an entry into this context.
This method will check the entry's model ID to ensure it comes from the context's own model or throw an exception otherwise.
Definition at line 128 of file RNTupleFillContext.hxx.
|
inlineprivate |
Definition at line 103 of file RNTupleFillContext.hxx.
|
inline |
Fill an RRawPtrWriteEntry into this context, but don't commit the cluster.
The calling code must pass an RNTupleFillStatus and check RNTupleFillStatus::ShouldFlushCluster.
This method will check the entry's model ID to ensure it comes from the context's own model or throw an exception otherwise.
Definition at line 135 of file RNTupleFillContext.hxx.
|
inline |
Fill an entry into this context, but don't commit the cluster.
The calling code must pass an RNTupleFillStatus and check RNTupleFillStatus::ShouldFlushCluster.
This method will check the entry's model ID to ensure it comes from the context's own model or throw an exception otherwise.
Definition at line 124 of file RNTupleFillContext.hxx.
|
inlineprivate |
Definition at line 87 of file RNTupleFillContext.hxx.
void ROOT::Experimental::RNTupleFillContext::FlushCluster | ( | ) |
Flush so far filled entries to storage.
Definition at line 66 of file RNTupleFillContext.cxx.
void ROOT::Experimental::RNTupleFillContext::FlushColumns | ( | ) |
Flush column data, preparing for CommitCluster or to reduce memory usage.
This will trigger compression of pages, but not actually write to storage.
Definition at line 59 of file RNTupleFillContext.cxx.
|
inline |
Return the entry number that was last flushed in a cluster.
Definition at line 160 of file RNTupleFillContext.hxx.
|
inline |
Definition at line 174 of file RNTupleFillContext.hxx.
|
inline |
Definition at line 152 of file RNTupleFillContext.hxx.
|
inline |
Return the number of entries filled so far.
Definition at line 162 of file RNTupleFillContext.hxx.
|
inline |
Definition at line 171 of file RNTupleFillContext.hxx.
|
privatedelete |
|
friend |
Definition at line 54 of file RNTupleFillContext.hxx.
|
friend |
Definition at line 53 of file RNTupleFillContext.hxx.
|
private |
Definition at line 66 of file RNTupleFillContext.hxx.
|
private |
Limit for committing cluster no matter the other tunables.
Definition at line 76 of file RNTupleFillContext.hxx.
|
private |
Definition at line 64 of file RNTupleFillContext.hxx.
|
private |
Needs to be destructed before fSink.
Definition at line 62 of file RNTupleFillContext.hxx.
|
private |
The total number of bytes filled into all the so far committed clusters, i.e.
the uncompressed size of the written clusters
Definition at line 74 of file RNTupleFillContext.hxx.
|
private |
The total number of bytes written to storage (i.e., after compression)
Definition at line 71 of file RNTupleFillContext.hxx.
|
private |
Definition at line 67 of file RNTupleFillContext.hxx.
|
private |
Definition at line 60 of file RNTupleFillContext.hxx.
Whether to enable staged cluster committing, where only an explicit call to CommitStagedClusters() will logically append the clusters to the RNTuple.
Definition at line 82 of file RNTupleFillContext.hxx.
|
private |
Vector of currently staged clusters.
Definition at line 84 of file RNTupleFillContext.hxx.
|
private |
Keeps track of the number of bytes written into the current cluster.
Definition at line 69 of file RNTupleFillContext.hxx.
|
private |
Estimator of uncompressed cluster size, taking into account the estimated compression ratio.
Definition at line 78 of file RNTupleFillContext.hxx.
|
private |
The page sink's parallel page compression scheduler if IMT is on.
Needs to be destructed after the page sink is destructed and so declared before.
Definition at line 59 of file RNTupleFillContext.hxx.