Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleWriteOptions.cxx
Go to the documentation of this file.
1/// \file RNTupleWriteOptions.cxx
2/// \author Jakob Blomer <jblomer@cern.ch>
3/// \date 2024-02-22
4
5/*************************************************************************
6 * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
13#include <ROOT/RError.hxx>
15
16#include <utility>
17
18namespace {
19
21 std::size_t initialUnzippedPageSize, std::size_t maxUnzippedPageSize)
22{
23 if (zippedClusterSize == 0) {
24 throw ROOT::RException(R__FAIL("invalid target cluster size: 0"));
25 }
26 if (initialUnzippedPageSize == 0) {
27 throw ROOT::RException(R__FAIL("invalid initial page size: 0"));
28 }
29 if (maxUnzippedPageSize == 0) {
30 throw ROOT::RException(R__FAIL("invalid maximum page size: 0"));
31 }
33 throw ROOT::RException(R__FAIL("compressed target cluster size must not be larger than "
34 "maximum uncompressed cluster size"));
35 }
37 throw ROOT::RException(R__FAIL("initial page size must not be larger than maximum page size"));
38 }
40 throw ROOT::RException(R__FAIL("maximum page size must not be larger than "
41 "maximum uncompressed cluster size"));
42 }
43}
44
45} // anonymous namespace
46
47std::unique_ptr<ROOT::RNTupleWriteOptions> ROOT::RNTupleWriteOptions::Clone() const
48{
49 return std::make_unique<RNTupleWriteOptions>(*this);
50}
51
53{
54 EnsureValidTunables(val, fMaxUnzippedClusterSize, fInitialUnzippedPageSize, fMaxUnzippedPageSize);
55 fApproxZippedClusterSize = val;
56}
57
59{
60 EnsureValidTunables(fApproxZippedClusterSize, val, fInitialUnzippedPageSize, fMaxUnzippedPageSize);
61 fMaxUnzippedClusterSize = val;
62}
63
65{
66 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, val, fMaxUnzippedPageSize);
67 fInitialUnzippedPageSize = val;
68}
69
71{
72 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, fInitialUnzippedPageSize, val);
73 fMaxUnzippedPageSize = val;
74}
75
77{
78 if (val && !fEnablePageChecksums) {
79 throw RException(R__FAIL("same page merging requires page checksums, which were previously disabled"));
80 }
81 fEnableSamePageMerging = val;
82}
83
85{
86 if (fPageBufferBudget != 0)
87 return fPageBufferBudget;
88
89 return GetApproxZippedClusterSize() + (GetCompression() != 0) * GetApproxZippedClusterSize();
90}
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
Definition RError.hxx:299
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Base class for all ROOT issued exceptions.
Definition RError.hxx:78
std::size_t GetPageBufferBudget() const
void SetMaxUnzippedClusterSize(std::size_t val)
void SetMaxUnzippedPageSize(std::size_t val)
void SetInitialUnzippedPageSize(std::size_t val)
virtual std::unique_ptr< RNTupleWriteOptions > Clone() const
void SetApproxZippedClusterSize(std::size_t val)