30 std::unique_ptr<Internal::RPageSink> sink)
37 const auto &writeOpts =
fSink->GetWriteOptions();
40 const int scale = writeOpts.GetCompression() ? 2 : 1;
58 if (
fSink->GetWriteOptions().GetHasSmallClusters() &&
60 throw RException(
R__FAIL(
"invalid attempt to write a cluster > 512MiB with 'small clusters' option enabled"));
62 for (
auto &field :
fModel->GetFieldZero()) {
70 const float compressionFactor =
73 compressionFactor *
static_cast<float>(
fSink->GetWriteOptions().GetApproxZippedClusterSize());
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#define R__LOG_ERROR(...)
std::string GetReport() const
Format a dignostics report, e.g. for an exception message.
Base class for all ROOT issued exceptions.
const RError & GetError() const
std::size_t fUnzippedClusterSize
Keeps track of the number of bytes written into the current cluster.
std::uint64_t fNBytesFilled
The total number of bytes filled into all the so far committed clusters, i.e.
Detail::RNTupleMetrics fMetrics
NTupleSize_t fLastCommitted
std::size_t fUnzippedClusterSizeEst
Estimator of uncompressed cluster size, taking into account the estimated compression ratio.
void CommitCluster()
Ensure that the data from the so far seen Fill calls has been written to storage.
std::uint64_t fNBytesCommitted
The total number of bytes written to storage (i.e., after compression)
std::unique_ptr< RNTupleModel > fModel
Needs to be destructed before fSink.
std::size_t fMaxUnzippedClusterSize
Limit for committing cluster no matter the other tunables.
RNTupleFillContext(std::unique_ptr< RNTupleModel > model, std::unique_ptr< Internal::RPageSink > sink)
std::unique_ptr< Internal::RPageSink > fSink
static constexpr std::uint64_t kMaxSmallClusterSize
A maximum size of 512MB still allows for a vector of bool to be stored in a small cluster.
void CallCommitClusterOnField(RFieldBase &)
RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.