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
20void EnsureValidTunables(std::size_t zippedClusterSize, std::size_t unzippedClusterSize,
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 }
32 if (zippedClusterSize > unzippedClusterSize) {
33 throw ROOT::RException(R__FAIL("compressed target cluster size must not be larger than "
34 "maximum uncompressed cluster size"));
35 }
36 if (initialUnzippedPageSize > maxUnzippedPageSize) {
37 throw ROOT::RException(R__FAIL("initial page size must not be larger than maximum page size"));
38 }
39 if (maxUnzippedPageSize > unzippedClusterSize) {
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
57
63
69
75
77{
78 if (val && !fEnablePageChecksums) {
79 throw RException(R__FAIL("same page merging requires page checksums, which were previously disabled"));
80 }
82}
83
#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
Base class for all ROOT issued exceptions.
Definition RError.hxx:78
std::size_t GetPageBufferBudget() const
void SetMaxUnzippedClusterSize(std::size_t val)
std::size_t GetApproxZippedClusterSize() const
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)
std::uint32_t GetCompression() const