Logo ROOT  
Reference Guide
ROOT::Experimental::RNTupleDescriptor Class Reference

The on-storage meta-data of an ntuple.

Represents the on-disk (on storage) information about an ntuple. The meta-data consists of a header and one or several footers. The header carries the ntuple schema, i.e. the fields and the associated columns and their relationships. The footer(s) carry information about one or several clusters. For every cluster, a footer stores its location and size, and for every column the range of element indexes as well as a list of pages and page locations.

The descriptor provide machine-independent (de-)serialization of headers and footers, and it provides lookup routines for ntuple objects (pages, clusters, ...). It is supposed to be usable by all RPageStorage implementations.

The serialization does not use standard ROOT streamers in order to not let it depend on libCore. The serialization uses the concept of frames: header, footer, and substructures have a preamble with version numbers and the size of the writte struct. This allows for forward and backward compatibility when the meta-data evolves.

Definition at line 378 of file RNTupleDescriptor.hxx.

Classes

class  RClusterDescriptorIterable
 Used to loop over all the clusters of an ntuple (in unspecified order) More...
 
class  RClusterGroupDescriptorIterable
 Used to loop over all the cluster groups of an ntuple (in unspecified order) More...
 
class  RColumnDescriptorIterable
 Used to loop over a field's associated columns. More...
 
class  RFieldDescriptorIterable
 Used to loop over a field's child fields. More...
 

Public Member Functions

 RNTupleDescriptor ()=default
 
 RNTupleDescriptor (const RNTupleDescriptor &other)=delete
 
 RNTupleDescriptor (RNTupleDescriptor &&other)=default
 
RResult< voidAddClusterDetails (RClusterDescriptor &&clusterDesc)
 Methods to load and drop cluster details. More...
 
RResult< voidDropClusterDetails (DescriptorId_t clusterId)
 
DescriptorId_t FindClusterId (DescriptorId_t columnId, NTupleSize_t index) const
 
DescriptorId_t FindColumnId (DescriptorId_t fieldId, std::uint32_t columnIndex) const
 
DescriptorId_t FindFieldId (std::string_view fieldName) const
 Searches for a top-level field. More...
 
DescriptorId_t FindFieldId (std::string_view fieldName, DescriptorId_t parentId) const
 
DescriptorId_t FindNextClusterId (DescriptorId_t clusterId) const
 
DescriptorId_t FindPrevClusterId (DescriptorId_t clusterId) const
 
std::unique_ptr< RNTupleModelGenerateModel () const
 Re-create the C++ model from the stored meta-data. More...
 
const RClusterDescriptorGetClusterDescriptor (DescriptorId_t clusterId) const
 
const RClusterGroupDescriptorGetClusterGroupDescriptor (DescriptorId_t clusterGroupId) const
 
RClusterGroupDescriptorIterable GetClusterGroupIterable () const
 
RClusterDescriptorIterable GetClusterIterable () const
 
const RColumnDescriptorGetColumnDescriptor (DescriptorId_t columnId) const
 
RColumnDescriptorIterable GetColumnIterable (const RFieldDescriptor &fieldDesc) const
 
RColumnDescriptorIterable GetColumnIterable (DescriptorId_t fieldId) const
 
std::string GetDescription () const
 
const RFieldDescriptorGetFieldDescriptor (DescriptorId_t fieldId) const
 
RFieldDescriptorIterable GetFieldIterable (const RFieldDescriptor &fieldDesc) const
 
RFieldDescriptorIterable GetFieldIterable (const RFieldDescriptor &fieldDesc, const std::function< bool(DescriptorId_t, DescriptorId_t)> &comparator) const
 
RFieldDescriptorIterable GetFieldIterable (DescriptorId_t fieldId) const
 
RFieldDescriptorIterable GetFieldIterable (DescriptorId_t fieldId, const std::function< bool(DescriptorId_t, DescriptorId_t)> &comparator) const
 
const RFieldDescriptorGetFieldZero () const
 
DescriptorId_t GetFieldZeroId () const
 Returns the logical parent of all top-level NTuple data fields. More...
 
std::string GetName () const
 
std::size_t GetNClusterGroups () const
 
std::size_t GetNClusters () const
 
std::size_t GetNColumns () const
 
NTupleSize_t GetNElements (DescriptorId_t columnId) const
 
NTupleSize_t GetNEntries () const
 
std::size_t GetNFields () const
 
std::uint64_t GetOnDiskFooterSize () const
 
std::uint64_t GetOnDiskHeaderSize () const
 
std::string GetQualifiedFieldName (DescriptorId_t fieldId) const
 Walks up the parents of the field ID and returns a field name of the form a.b.c.d In case of invalid field ID, an empty string is returned. More...
 
RFieldDescriptorIterable GetTopLevelFields () const
 
RFieldDescriptorIterable GetTopLevelFields (const std::function< bool(DescriptorId_t, DescriptorId_t)> &comparator) const
 
RNTupleDescriptoroperator= (const RNTupleDescriptor &other)=delete
 
RNTupleDescriptoroperator= (RNTupleDescriptor &&other)=default
 
bool operator== (const RNTupleDescriptor &other) const
 
void PrintInfo (std::ostream &output) const
 

Private Attributes

std::unordered_map< DescriptorId_t, RClusterDescriptorfClusterDescriptors
 May contain only a subset of all the available clusters, e.g. More...
 
std::unordered_map< DescriptorId_t, RClusterGroupDescriptorfClusterGroupDescriptors
 
std::unordered_map< DescriptorId_t, RColumnDescriptorfColumnDescriptors
 
std::string fDescription
 Free text from the user. More...
 
std::unordered_map< DescriptorId_t, RFieldDescriptorfFieldDescriptors
 
std::string fName
 The ntuple name needs to be unique in a given storage location (file) More...
 
std::uint64_t fOnDiskFooterSize = 0
 Like fOnDiskHeaderSize, contains both cluster summaries and page locations. More...
 
std::uint64_t fOnDiskHeaderSize = 0
 Set by the descriptor builder when deserialized. More...
 

Friends

class RNTupleDescriptorBuilder
 

#include <ROOT/RNTupleDescriptor.hxx>

Constructor & Destructor Documentation

◆ RNTupleDescriptor() [1/3]

ROOT::Experimental::RNTupleDescriptor::RNTupleDescriptor ( )
default

◆ RNTupleDescriptor() [2/3]

ROOT::Experimental::RNTupleDescriptor::RNTupleDescriptor ( const RNTupleDescriptor other)
delete

◆ RNTupleDescriptor() [3/3]

ROOT::Experimental::RNTupleDescriptor::RNTupleDescriptor ( RNTupleDescriptor &&  other)
default

Member Function Documentation

◆ AddClusterDetails()

ROOT::Experimental::RResult< void > ROOT::Experimental::RNTupleDescriptor::AddClusterDetails ( RClusterDescriptor &&  clusterDesc)

Methods to load and drop cluster details.

Definition at line 315 of file RNTupleDescriptor.cxx.

◆ DropClusterDetails()

ROOT::Experimental::RResult< void > ROOT::Experimental::RNTupleDescriptor::DropClusterDetails ( DescriptorId_t  clusterId)

Definition at line 328 of file RNTupleDescriptor.cxx.

◆ FindClusterId()

ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindClusterId ( DescriptorId_t  columnId,
NTupleSize_t  index 
) const

Definition at line 272 of file RNTupleDescriptor.cxx.

◆ FindColumnId()

ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindColumnId ( DescriptorId_t  fieldId,
std::uint32_t  columnIndex 
) const

Definition at line 262 of file RNTupleDescriptor.cxx.

◆ FindFieldId() [1/2]

ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindFieldId ( std::string_view  fieldName) const

Searches for a top-level field.

Definition at line 255 of file RNTupleDescriptor.cxx.

◆ FindFieldId() [2/2]

ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindFieldId ( std::string_view  fieldName,
DescriptorId_t  parentId 
) const

Definition at line 217 of file RNTupleDescriptor.cxx.

◆ FindNextClusterId()

ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindNextClusterId ( DescriptorId_t  clusterId) const

Definition at line 288 of file RNTupleDescriptor.cxx.

◆ FindPrevClusterId()

ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindPrevClusterId ( DescriptorId_t  clusterId) const

Definition at line 303 of file RNTupleDescriptor.cxx.

◆ GenerateModel()

std::unique_ptr< ROOT::Experimental::RNTupleModel > ROOT::Experimental::RNTupleDescriptor::GenerateModel ( ) const

Re-create the C++ model from the stored meta-data.

Definition at line 339 of file RNTupleDescriptor.cxx.

◆ GetClusterDescriptor()

const RClusterDescriptor & ROOT::Experimental::RNTupleDescriptor::GetClusterDescriptor ( DescriptorId_t  clusterId) const
inline

Definition at line 623 of file RNTupleDescriptor.hxx.

◆ GetClusterGroupDescriptor()

const RClusterGroupDescriptor & ROOT::Experimental::RNTupleDescriptor::GetClusterGroupDescriptor ( DescriptorId_t  clusterGroupId) const
inline

Definition at line 619 of file RNTupleDescriptor.hxx.

◆ GetClusterGroupIterable()

RClusterGroupDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetClusterGroupIterable ( ) const
inline

Definition at line 661 of file RNTupleDescriptor.hxx.

◆ GetClusterIterable()

RClusterDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetClusterIterable ( ) const
inline

Definition at line 663 of file RNTupleDescriptor.hxx.

◆ GetColumnDescriptor()

const RColumnDescriptor & ROOT::Experimental::RNTupleDescriptor::GetColumnDescriptor ( DescriptorId_t  columnId) const
inline

Definition at line 616 of file RNTupleDescriptor.hxx.

◆ GetColumnIterable() [1/2]

RColumnDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetColumnIterable ( const RFieldDescriptor fieldDesc) const
inline

Definition at line 652 of file RNTupleDescriptor.hxx.

◆ GetColumnIterable() [2/2]

RColumnDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetColumnIterable ( DescriptorId_t  fieldId) const
inline

Definition at line 656 of file RNTupleDescriptor.hxx.

◆ GetDescription()

std::string ROOT::Experimental::RNTupleDescriptor::GetDescription ( ) const
inline

Definition at line 669 of file RNTupleDescriptor.hxx.

◆ GetFieldDescriptor()

const RFieldDescriptor & ROOT::Experimental::RNTupleDescriptor::GetFieldDescriptor ( DescriptorId_t  fieldId) const
inline

Definition at line 613 of file RNTupleDescriptor.hxx.

◆ GetFieldIterable() [1/4]

RFieldDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetFieldIterable ( const RFieldDescriptor fieldDesc) const
inline

Definition at line 627 of file RNTupleDescriptor.hxx.

◆ GetFieldIterable() [2/4]

RFieldDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetFieldIterable ( const RFieldDescriptor fieldDesc,
const std::function< bool(DescriptorId_t, DescriptorId_t)> &  comparator 
) const
inline

Definition at line 630 of file RNTupleDescriptor.hxx.

◆ GetFieldIterable() [3/4]

RFieldDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetFieldIterable ( DescriptorId_t  fieldId) const
inline

Definition at line 635 of file RNTupleDescriptor.hxx.

◆ GetFieldIterable() [4/4]

RFieldDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetFieldIterable ( DescriptorId_t  fieldId,
const std::function< bool(DescriptorId_t, DescriptorId_t)> &  comparator 
) const
inline

Definition at line 638 of file RNTupleDescriptor.hxx.

◆ GetFieldZero()

const RFieldDescriptor & ROOT::Experimental::RNTupleDescriptor::GetFieldZero ( ) const
inline

Definition at line 682 of file RNTupleDescriptor.hxx.

◆ GetFieldZeroId()

ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::GetFieldZeroId ( ) const

Returns the logical parent of all top-level NTuple data fields.

Definition at line 248 of file RNTupleDescriptor.cxx.

◆ GetName()

std::string ROOT::Experimental::RNTupleDescriptor::GetName ( ) const
inline

Definition at line 668 of file RNTupleDescriptor.hxx.

◆ GetNClusterGroups()

std::size_t ROOT::Experimental::RNTupleDescriptor::GetNClusterGroups ( ) const
inline

Definition at line 673 of file RNTupleDescriptor.hxx.

◆ GetNClusters()

std::size_t ROOT::Experimental::RNTupleDescriptor::GetNClusters ( ) const
inline

Definition at line 674 of file RNTupleDescriptor.hxx.

◆ GetNColumns()

std::size_t ROOT::Experimental::RNTupleDescriptor::GetNColumns ( ) const
inline

Definition at line 672 of file RNTupleDescriptor.hxx.

◆ GetNElements()

ROOT::Experimental::NTupleSize_t ROOT::Experimental::RNTupleDescriptor::GetNElements ( DescriptorId_t  columnId) const

Definition at line 203 of file RNTupleDescriptor.cxx.

◆ GetNEntries()

ROOT::Experimental::NTupleSize_t ROOT::Experimental::RNTupleDescriptor::GetNEntries ( ) const

Definition at line 194 of file RNTupleDescriptor.cxx.

◆ GetNFields()

std::size_t ROOT::Experimental::RNTupleDescriptor::GetNFields ( ) const
inline

Definition at line 671 of file RNTupleDescriptor.hxx.

◆ GetOnDiskFooterSize()

std::uint64_t ROOT::Experimental::RNTupleDescriptor::GetOnDiskFooterSize ( ) const
inline

Definition at line 611 of file RNTupleDescriptor.hxx.

◆ GetOnDiskHeaderSize()

std::uint64_t ROOT::Experimental::RNTupleDescriptor::GetOnDiskHeaderSize ( ) const
inline

Definition at line 610 of file RNTupleDescriptor.hxx.

◆ GetQualifiedFieldName()

std::string ROOT::Experimental::RNTupleDescriptor::GetQualifiedFieldName ( DescriptorId_t  fieldId) const

Walks up the parents of the field ID and returns a field name of the form a.b.c.d In case of invalid field ID, an empty string is returned.

Definition at line 234 of file RNTupleDescriptor.cxx.

◆ GetTopLevelFields() [1/2]

RFieldDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetTopLevelFields ( ) const
inline

Definition at line 643 of file RNTupleDescriptor.hxx.

◆ GetTopLevelFields() [2/2]

RFieldDescriptorIterable ROOT::Experimental::RNTupleDescriptor::GetTopLevelFields ( const std::function< bool(DescriptorId_t, DescriptorId_t)> &  comparator) const
inline

Definition at line 646 of file RNTupleDescriptor.hxx.

◆ operator=() [1/2]

RNTupleDescriptor & ROOT::Experimental::RNTupleDescriptor::operator= ( const RNTupleDescriptor other)
delete

◆ operator=() [2/2]

RNTupleDescriptor & ROOT::Experimental::RNTupleDescriptor::operator= ( RNTupleDescriptor &&  other)
default

◆ operator==()

bool ROOT::Experimental::RNTupleDescriptor::operator== ( const RNTupleDescriptor other) const

Definition at line 184 of file RNTupleDescriptor.cxx.

◆ PrintInfo()

void ROOT::Experimental::RNTupleDescriptor::PrintInfo ( std::ostream &  output) const

Definition at line 82 of file RNTupleDescriptorFmt.cxx.

Friends And Related Function Documentation

◆ RNTupleDescriptorBuilder

friend class RNTupleDescriptorBuilder
friend

Definition at line 379 of file RNTupleDescriptor.hxx.

Member Data Documentation

◆ fClusterDescriptors

std::unordered_map<DescriptorId_t, RClusterDescriptor> ROOT::Experimental::RNTupleDescriptor::fClusterDescriptors
private

May contain only a subset of all the available clusters, e.g.

the clusters of the current file from a chain of files

Definition at line 395 of file RNTupleDescriptor.hxx.

◆ fClusterGroupDescriptors

std::unordered_map<DescriptorId_t, RClusterGroupDescriptor> ROOT::Experimental::RNTupleDescriptor::fClusterGroupDescriptors
private

Definition at line 392 of file RNTupleDescriptor.hxx.

◆ fColumnDescriptors

std::unordered_map<DescriptorId_t, RColumnDescriptor> ROOT::Experimental::RNTupleDescriptor::fColumnDescriptors
private

Definition at line 391 of file RNTupleDescriptor.hxx.

◆ fDescription

std::string ROOT::Experimental::RNTupleDescriptor::fDescription
private

Free text from the user.

Definition at line 385 of file RNTupleDescriptor.hxx.

◆ fFieldDescriptors

std::unordered_map<DescriptorId_t, RFieldDescriptor> ROOT::Experimental::RNTupleDescriptor::fFieldDescriptors
private

Definition at line 390 of file RNTupleDescriptor.hxx.

◆ fName

std::string ROOT::Experimental::RNTupleDescriptor::fName
private

The ntuple name needs to be unique in a given storage location (file)

Definition at line 383 of file RNTupleDescriptor.hxx.

◆ fOnDiskFooterSize

std::uint64_t ROOT::Experimental::RNTupleDescriptor::fOnDiskFooterSize = 0
private

Like fOnDiskHeaderSize, contains both cluster summaries and page locations.

Definition at line 388 of file RNTupleDescriptor.hxx.

◆ fOnDiskHeaderSize

std::uint64_t ROOT::Experimental::RNTupleDescriptor::fOnDiskHeaderSize = 0
private

Set by the descriptor builder when deserialized.

Definition at line 387 of file RNTupleDescriptor.hxx.

Libraries for ROOT::Experimental::RNTupleDescriptor:
[legend]

The documentation for this class was generated from the following files: