23void EnsureValidTunables(std::size_t zippedClusterSize, std::size_t unzippedClusterSize,
24 std::size_t initialNElementsPerPage, std::size_t maxUnzippedPageSize)
27 if (zippedClusterSize == 0) {
28 throw RException(
R__FAIL(
"invalid target cluster size: 0"));
30 if (maxUnzippedPageSize == 0) {
31 throw RException(
R__FAIL(
"invalid maximum page size: 0"));
33 if (initialNElementsPerPage == 0) {
34 throw RException(
R__FAIL(
"invalid initial number of elements per page: 0"));
36 if (zippedClusterSize > unzippedClusterSize) {
37 throw RException(
R__FAIL(
"compressed target cluster size must not be larger than "
38 "maximum uncompressed cluster size"));
40 if (maxUnzippedPageSize > unzippedClusterSize) {
41 throw RException(
R__FAIL(
"maximum page size must not be larger than "
42 "maximum uncompressed cluster size"));
50 return std::make_unique<RNTupleWriteOptions>(*
this);
55 EnsureValidTunables(val, fMaxUnzippedClusterSize, fInitialNElementsPerPage, fMaxUnzippedPageSize);
56 fApproxZippedClusterSize = val;
61 EnsureValidTunables(fApproxZippedClusterSize, val, fInitialNElementsPerPage, fMaxUnzippedPageSize);
62 fMaxUnzippedClusterSize = val;
67 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, val, fMaxUnzippedPageSize);
68 fInitialNElementsPerPage = val;
73 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, fInitialNElementsPerPage, val);
74 fMaxUnzippedPageSize = val;
79 if (fPageBufferBudget != 0)
80 return fPageBufferBudget;
82 return GetApproxZippedClusterSize() + (GetCompression() != 0) * GetApproxZippedClusterSize();
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
Base class for all ROOT issued exceptions.
void SetInitialNElementsPerPage(std::size_t val)
std::size_t GetPageBufferBudget() const
void SetApproxZippedClusterSize(std::size_t val)
void SetMaxUnzippedPageSize(std::size_t val)
virtual std::unique_ptr< RNTupleWriteOptions > Clone() const
void SetMaxUnzippedClusterSize(std::size_t val)