23void EnsureValidTunables(std::size_t zippedClusterSize, std::size_t unzippedClusterSize,
24 std::size_t initialUnzippedPageSize, std::size_t maxUnzippedPageSize)
27 if (zippedClusterSize == 0) {
28 throw RException(
R__FAIL(
"invalid target cluster size: 0"));
30 if (initialUnzippedPageSize == 0) {
31 throw RException(
R__FAIL(
"invalid initial page size: 0"));
33 if (maxUnzippedPageSize == 0) {
34 throw RException(
R__FAIL(
"invalid maximum page size: 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 (initialUnzippedPageSize > maxUnzippedPageSize) {
41 throw RException(
R__FAIL(
"initial page size must not be larger than maximum page size"));
43 if (maxUnzippedPageSize > unzippedClusterSize) {
44 throw RException(
R__FAIL(
"maximum page size must not be larger than "
45 "maximum uncompressed cluster size"));
53 return std::make_unique<RNTupleWriteOptions>(*
this);
58 EnsureValidTunables(val, fMaxUnzippedClusterSize, fInitialUnzippedPageSize, fMaxUnzippedPageSize);
59 fApproxZippedClusterSize = val;
64 EnsureValidTunables(fApproxZippedClusterSize, val, fInitialUnzippedPageSize, fMaxUnzippedPageSize);
65 fMaxUnzippedClusterSize = val;
70 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, val, fMaxUnzippedPageSize);
71 fInitialUnzippedPageSize = val;
76 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, fInitialUnzippedPageSize, val);
77 fMaxUnzippedPageSize = val;
82 if (fPageBufferBudget != 0)
83 return fPageBufferBudget;
85 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.
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 SetInitialUnzippedPageSize(std::size_t val)
void SetMaxUnzippedClusterSize(std::size_t val)