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