Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:46

0001 /// \file ROOT/RNTupleWriteOptionsDaos.hxx
0002 /// \ingroup NTuple ROOT7
0003 /// \author Jakob Blomer <jblomer@cern.ch>
0004 /// \date 2024-02-22
0005 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
0006 /// is welcome!
0007 
0008 /*************************************************************************
0009  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0010  * All rights reserved.                                                  *
0011  *                                                                       *
0012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0014  *************************************************************************/
0015 
0016 #ifndef ROOT7_RNTupleWriteOptionsDaos
0017 #define ROOT7_RNTupleWriteOptionsDaos
0018 
0019 #include <ROOT/RNTupleWriteOptions.hxx>
0020 
0021 #include <cstdint>
0022 #include <memory>
0023 #include <string>
0024 #include <utility>
0025 
0026 namespace ROOT {
0027 namespace Experimental {
0028 
0029 // clang-format off
0030 /**
0031 \class ROOT::Experimental::RNTupleWriteOptionsDaos
0032 \ingroup NTuple
0033 \brief DAOS-specific user-tunable settings for storing ntuples
0034 */
0035 // clang-format on
0036 class RNTupleWriteOptionsDaos : public RNTupleWriteOptions {
0037    std::string fObjectClass{"SX"};
0038    /// The maximum cage size is set to the equivalent of 16 uncompressed pages - 1MiB by default. Empirically, such a
0039    /// cage size yields acceptable results in throughput and page granularity for most use cases. A `fMaxCageSize` of 0
0040    /// disables the caging mechanism.
0041    uint32_t fMaxCageSize = 16 * RNTupleWriteOptions::fApproxUnzippedPageSize;
0042 
0043 public:
0044    ~RNTupleWriteOptionsDaos() override = default;
0045    std::unique_ptr<RNTupleWriteOptions> Clone() const override
0046    {
0047       return std::make_unique<RNTupleWriteOptionsDaos>(*this);
0048    }
0049 
0050    const std::string &GetObjectClass() const { return fObjectClass; }
0051    /// Set the object class used to generate OIDs that relate to user data. Any
0052    /// `OC_xxx` constant defined in `daos_obj_class.h` may be used here without
0053    /// the OC_ prefix.
0054    void SetObjectClass(const std::string &val) { fObjectClass = val; }
0055 
0056    uint32_t GetMaxCageSize() const { return fMaxCageSize; }
0057    /// Set the upper bound for page concatenation into cages, in bytes. It is assumed
0058    /// that cage size will be no smaller than the approximate uncompressed page size.
0059    /// To disable page concatenation, set this value to 0.
0060    void SetMaxCageSize(uint32_t cageSz) { fMaxCageSize = cageSz; }
0061 };
0062 
0063 } // namespace Experimental
0064 } // namespace ROOT
0065 
0066 #endif // ROOT7_RNTupleWriteOptionsDaos