Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleWriteOptions.cxx
Go to the documentation of this file.
1/// \file RNTupleWriteOptions.cxx
2/// \ingroup NTuple
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2024-02-22
5
6/*************************************************************************
7 * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
8 * All rights reserved. *
9 * *
10 * For the licensing terms see $ROOTSYS/LICENSE. *
11 * For the list of contributors see $ROOTSYS/README/CREDITS. *
12 *************************************************************************/
13
14#include <ROOT/RError.hxx>
16
17#include <utility>
18
19namespace {
20
22 std::size_t initialUnzippedPageSize, std::size_t maxUnzippedPageSize)
23{
24 if (zippedClusterSize == 0) {
25 throw ROOT::RException(R__FAIL("invalid target cluster size: 0"));
26 }
27 if (initialUnzippedPageSize == 0) {
28 throw ROOT::RException(R__FAIL("invalid initial page size: 0"));
29 }
30 if (maxUnzippedPageSize == 0) {
31 throw ROOT::RException(R__FAIL("invalid maximum page size: 0"));
32 }
34 throw ROOT::RException(R__FAIL("compressed target cluster size must not be larger than "
35 "maximum uncompressed cluster size"));
36 }
38 throw ROOT::RException(R__FAIL("initial page size must not be larger than maximum page size"));
39 }
41 throw ROOT::RException(R__FAIL("maximum page size must not be larger than "
42 "maximum uncompressed cluster size"));
43 }
44}
45
46} // anonymous namespace
47
48std::unique_ptr<ROOT::RNTupleWriteOptions> ROOT::RNTupleWriteOptions::Clone() const
49{
50 return std::make_unique<RNTupleWriteOptions>(*this);
51}
52
54{
55 EnsureValidTunables(val, fMaxUnzippedClusterSize, fInitialUnzippedPageSize, fMaxUnzippedPageSize);
56 fApproxZippedClusterSize = val;
57}
58
60{
61 EnsureValidTunables(fApproxZippedClusterSize, val, fInitialUnzippedPageSize, fMaxUnzippedPageSize);
62 fMaxUnzippedClusterSize = val;
63}
64
66{
67 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, val, fMaxUnzippedPageSize);
68 fInitialUnzippedPageSize = val;
69}
70
72{
73 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, fInitialUnzippedPageSize, val);
74 fMaxUnzippedPageSize = val;
75}
76
78{
79 if (val && !fEnablePageChecksums) {
80 throw RException(R__FAIL("same page merging requires page checksums, which were previously disabled"));
81 }
82 fEnableSamePageMerging = val;
83}
84
86{
87 if (fPageBufferBudget != 0)
88 return fPageBufferBudget;
89
90 return GetApproxZippedClusterSize() + (GetCompression() != 0) * GetApproxZippedClusterSize();
91}
#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:79
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)