Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::RNTupleFillContext Class Reference

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 CommitCluster() 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 CommitCluster ()
 Ensure that the data from the so far seen Fill calls has been written to storage.
 
std::unique_ptr< REntryCreateEntry ()
 
void EnableMetrics ()
 
std::size_t Fill (REntry &entry)
 Fill an entry into this context.
 
NTupleSize_t GetLastCommitted () const
 Return the entry number that was last committed in a cluster.
 
const Detail::RNTupleMetricsGetMetrics () const
 
NTupleSize_t GetNEntries () const
 Return the number of entries filled so far.
 

Private Member Functions

 RNTupleFillContext (const RNTupleFillContext &)=delete
 
 RNTupleFillContext (std::unique_ptr< RNTupleModel > model, std::unique_ptr< Internal::RPageSink > sink)
 
RNTupleFillContextoperator= (const RNTupleFillContext &)=delete
 

Private Attributes

NTupleSize_t fLastCommitted = 0
 
std::size_t fMaxUnzippedClusterSize
 Limit for committing cluster no matter the other tunables.
 
Detail::RNTupleMetrics fMetrics
 
std::unique_ptr< RNTupleModelfModel
 Needs to be destructed before fSink.
 
std::uint64_t fNBytesCommitted = 0
 The total number of bytes written to storage (i.e., after compression)
 
std::uint64_t fNBytesFilled = 0
 The total number of bytes filled into all the so far committed clusters, i.e.
 
NTupleSize_t fNEntries = 0
 
std::unique_ptr< Internal::RPageSinkfSink
 
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.
 

Friends

class RNTupleParallelWriter
 
class RNTupleWriter
 

#include <ROOT/RNTupleFillContext.hxx>

Constructor & Destructor Documentation

◆ RNTupleFillContext() [1/2]

ROOT::Experimental::RNTupleFillContext::RNTupleFillContext ( std::unique_ptr< RNTupleModel model,
std::unique_ptr< Internal::RPageSink sink 
)
private

Definition at line 29 of file RNTupleFillContext.cxx.

◆ RNTupleFillContext() [2/2]

ROOT::Experimental::RNTupleFillContext::RNTupleFillContext ( const RNTupleFillContext )
privatedelete

◆ ~RNTupleFillContext()

ROOT::Experimental::RNTupleFillContext::~RNTupleFillContext ( )

Definition at line 44 of file RNTupleFillContext.cxx.

Member Function Documentation

◆ CommitCluster()

void ROOT::Experimental::RNTupleFillContext::CommitCluster ( )

Ensure that the data from the so far seen Fill calls has been written to storage.

Definition at line 53 of file RNTupleFillContext.cxx.

◆ CreateEntry()

std::unique_ptr< REntry > ROOT::Experimental::RNTupleFillContext::CreateEntry ( )
inline

Definition at line 102 of file RNTupleFillContext.hxx.

◆ EnableMetrics()

void ROOT::Experimental::RNTupleFillContext::EnableMetrics ( )
inline

Definition at line 109 of file RNTupleFillContext.hxx.

◆ Fill()

std::size_t ROOT::Experimental::RNTupleFillContext::Fill ( REntry entry)
inline

Fill an entry into this context.

This method will perform a light check whether the entry comes from the context's own model.

Returns
The number of uncompressed bytes written.

Definition at line 87 of file RNTupleFillContext.hxx.

◆ GetLastCommitted()

NTupleSize_t ROOT::Experimental::RNTupleFillContext::GetLastCommitted ( ) const
inline

Return the entry number that was last committed in a cluster.

Definition at line 105 of file RNTupleFillContext.hxx.

◆ GetMetrics()

const Detail::RNTupleMetrics & ROOT::Experimental::RNTupleFillContext::GetMetrics ( ) const
inline

Definition at line 110 of file RNTupleFillContext.hxx.

◆ GetNEntries()

NTupleSize_t ROOT::Experimental::RNTupleFillContext::GetNEntries ( ) const
inline

Return the number of entries filled so far.

Definition at line 107 of file RNTupleFillContext.hxx.

◆ operator=()

RNTupleFillContext & ROOT::Experimental::RNTupleFillContext::operator= ( const RNTupleFillContext )
privatedelete

Friends And Related Symbol Documentation

◆ RNTupleParallelWriter

friend class RNTupleParallelWriter
friend

Definition at line 54 of file RNTupleFillContext.hxx.

◆ RNTupleWriter

friend class RNTupleWriter
friend

Definition at line 53 of file RNTupleFillContext.hxx.

Member Data Documentation

◆ fLastCommitted

NTupleSize_t ROOT::Experimental::RNTupleFillContext::fLastCommitted = 0
private

Definition at line 63 of file RNTupleFillContext.hxx.

◆ fMaxUnzippedClusterSize

std::size_t ROOT::Experimental::RNTupleFillContext::fMaxUnzippedClusterSize
private

Limit for committing cluster no matter the other tunables.

Definition at line 73 of file RNTupleFillContext.hxx.

◆ fMetrics

Detail::RNTupleMetrics ROOT::Experimental::RNTupleFillContext::fMetrics
private

Definition at line 61 of file RNTupleFillContext.hxx.

◆ fModel

std::unique_ptr<RNTupleModel> ROOT::Experimental::RNTupleFillContext::fModel
private

Needs to be destructed before fSink.

Definition at line 59 of file RNTupleFillContext.hxx.

◆ fNBytesCommitted

std::uint64_t ROOT::Experimental::RNTupleFillContext::fNBytesCommitted = 0
private

The total number of bytes written to storage (i.e., after compression)

Definition at line 68 of file RNTupleFillContext.hxx.

◆ fNBytesFilled

std::uint64_t ROOT::Experimental::RNTupleFillContext::fNBytesFilled = 0
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 71 of file RNTupleFillContext.hxx.

◆ fNEntries

NTupleSize_t ROOT::Experimental::RNTupleFillContext::fNEntries = 0
private

Definition at line 64 of file RNTupleFillContext.hxx.

◆ fSink

std::unique_ptr<Internal::RPageSink> ROOT::Experimental::RNTupleFillContext::fSink
private

Definition at line 57 of file RNTupleFillContext.hxx.

◆ fUnzippedClusterSize

std::size_t ROOT::Experimental::RNTupleFillContext::fUnzippedClusterSize = 0
private

Keeps track of the number of bytes written into the current cluster.

Definition at line 66 of file RNTupleFillContext.hxx.

◆ fUnzippedClusterSizeEst

std::size_t ROOT::Experimental::RNTupleFillContext::fUnzippedClusterSizeEst
private

Estimator of uncompressed cluster size, taking into account the estimated compression ratio.

Definition at line 75 of file RNTupleFillContext.hxx.

Libraries for ROOT::Experimental::RNTupleFillContext:

The documentation for this class was generated from the following files: