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 279 of file RNTupleDescriptor.hxx.
Classes | |
class | RColumnDescriptorRange |
Used to loop over a field's associated columns. More... | |
class | RFieldDescriptorRange |
Used to loop over a field's child fields. More... | |
Public Member Functions | |
RNTupleDescriptor ()=default | |
RNTupleDescriptor (const RNTupleDescriptor &other)=delete | |
RNTupleDescriptor (RNTupleDescriptor &&other)=default | |
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. | |
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< RNTupleModel > | GenerateModel () const |
Re-create the C++ model from the stored meta-data. | |
std::string | GetAuthor () const |
const RClusterDescriptor & | GetClusterDescriptor (DescriptorId_t clusterId) const |
const RColumnDescriptor & | GetColumnDescriptor (DescriptorId_t columnId) const |
RColumnDescriptorRange | GetColumnRange (const RFieldDescriptor &fieldDesc) const |
RColumnDescriptorRange | GetColumnRange (DescriptorId_t fieldId) const |
std::string | GetCustodian () const |
std::string | GetDescription () const |
const RFieldDescriptor & | GetFieldDescriptor (DescriptorId_t fieldId) const |
RFieldDescriptorRange | GetFieldRange (const RFieldDescriptor &fieldDesc) const |
RFieldDescriptorRange | GetFieldRange (const RFieldDescriptor &fieldDesc, const std::function< bool(DescriptorId_t, DescriptorId_t)> &comparator) const |
RFieldDescriptorRange | GetFieldRange (DescriptorId_t fieldId) const |
RFieldDescriptorRange | GetFieldRange (DescriptorId_t fieldId, const std::function< bool(DescriptorId_t, DescriptorId_t)> &comparator) const |
DescriptorId_t | GetFieldZeroId () const |
Returns the logical parent of all top-level NTuple data fields. | |
std::uint32_t | GetFooterSize () const |
RNTupleUuid | GetGroupUuid () const |
std::uint32_t | GetHeaderSize () const |
std::string | GetName () 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 |
RNTupleUuid | GetOwnUuid () 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. | |
std::chrono::system_clock::time_point | GetTimeStampData () const |
std::chrono::system_clock::time_point | GetTimeStampWritten () const |
RFieldDescriptorRange | GetTopLevelFields () const |
RFieldDescriptorRange | GetTopLevelFields (const std::function< bool(DescriptorId_t, DescriptorId_t)> &comparator) const |
RNTupleVersion | GetVersion () const |
RNTupleDescriptor & | operator= (const RNTupleDescriptor &other)=delete |
RNTupleDescriptor & | operator= (RNTupleDescriptor &&other)=default |
bool | operator== (const RNTupleDescriptor &other) const |
void | PrintInfo (std::ostream &output) const |
std::uint32_t | SerializeFooter (void *buffer) const |
Serializes cluster meta data. Returns the number of bytes and fills buffer if it is not nullptr. | |
std::uint32_t | SerializeHeader (void *buffer) const |
We deliberately do not use ROOT's built-in serialization in order to allow for use of RNTuple's without libCore Serializes the global ntuple information as well as the column and field schemata Returns the number of bytes and fills buffer if it is not nullptr. | |
Static Public Member Functions | |
static void | LocateMetadata (const void *postscript, std::uint32_t &szHeader, std::uint32_t &szFooter) |
Given kNBytesPostscript bytes, extract the header and footer lengths in bytes. | |
Static Public Attributes | |
static constexpr std::uint16_t | kFrameVersionCurrent = 0 |
In order to handle changes to the serialization routine in future ntuple versions. | |
static constexpr std::uint16_t | kFrameVersionMin = 0 |
static constexpr unsigned int | kNBytesPostscript = 16 |
The last few bytes after the footer store the length of footer and header. | |
static constexpr unsigned int | kNBytesPreamble = 8 |
The preamble is sufficient to get the length of the header. | |
Private Attributes | |
std::string | fAuthor |
The origin of the data. | |
std::unordered_map< DescriptorId_t, RClusterDescriptor > | fClusterDescriptors |
May contain only a subset of all the available clusters, e.g. | |
std::unordered_map< DescriptorId_t, RColumnDescriptor > | fColumnDescriptors |
std::string | fCustodian |
The current responsible for storing the data. | |
std::string | fDescription |
Free text from the user. | |
std::unordered_map< DescriptorId_t, RFieldDescriptor > | fFieldDescriptors |
RNTupleUuid | fGroupUuid |
Column sets that are created as derived sets from existing NTuples share the same group id. | |
std::string | fName |
The ntuple name needs to be unique in a given storage location (file) | |
RNTupleUuid | fOwnUuid |
Every NTuple gets a unique identifier. | |
std::chrono::system_clock::time_point | fTimeStampData |
The time stamp of the ntuple data (immutable) | |
std::chrono::system_clock::time_point | fTimeStampWritten |
The time stamp of writing the data to storage, which gets updated when re-written. | |
RNTupleVersion | fVersion |
The version evolves with the ntuple summary meta-data. | |
Friends | |
class | RNTupleDescriptorBuilder |
#include <ROOT/RNTupleDescriptor.hxx>
|
default |
|
delete |
|
default |
ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindClusterId | ( | DescriptorId_t | columnId, |
NTupleSize_t | index | ||
) | const |
Definition at line 724 of file RNTupleDescriptor.cxx.
ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindColumnId | ( | DescriptorId_t | fieldId, |
std::uint32_t | columnIndex | ||
) | const |
Definition at line 713 of file RNTupleDescriptor.cxx.
ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindFieldId | ( | std::string_view | fieldName | ) | const |
Searches for a top-level field.
Definition at line 706 of file RNTupleDescriptor.cxx.
ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindFieldId | ( | std::string_view | fieldName, |
DescriptorId_t | parentId | ||
) | const |
Definition at line 668 of file RNTupleDescriptor.cxx.
ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindNextClusterId | ( | DescriptorId_t | clusterId | ) | const |
Definition at line 737 of file RNTupleDescriptor.cxx.
ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::FindPrevClusterId | ( | DescriptorId_t | clusterId | ) | const |
Definition at line 751 of file RNTupleDescriptor.cxx.
std::unique_ptr< ROOT::Experimental::RNTupleModel > ROOT::Experimental::RNTupleDescriptor::GenerateModel | ( | ) | const |
Re-create the C++ model from the stored meta-data.
Definition at line 763 of file RNTupleDescriptor.cxx.
|
inline |
Definition at line 499 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 459 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 456 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 488 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 492 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 500 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 498 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 453 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 463 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 466 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 471 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 474 of file RNTupleDescriptor.hxx.
ROOT::Experimental::DescriptorId_t ROOT::Experimental::RNTupleDescriptor::GetFieldZeroId | ( | ) | const |
Returns the logical parent of all top-level NTuple data fields.
Definition at line 699 of file RNTupleDescriptor.cxx.
|
inline |
Definition at line 449 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 505 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 446 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 497 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 509 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 508 of file RNTupleDescriptor.hxx.
ROOT::Experimental::NTupleSize_t ROOT::Experimental::RNTupleDescriptor::GetNElements | ( | DescriptorId_t | columnId | ) | const |
Definition at line 656 of file RNTupleDescriptor.cxx.
ROOT::Experimental::NTupleSize_t ROOT::Experimental::RNTupleDescriptor::GetNEntries | ( | ) | const |
Definition at line 647 of file RNTupleDescriptor.cxx.
|
inline |
Definition at line 507 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 504 of file RNTupleDescriptor.hxx.
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 685 of file RNTupleDescriptor.cxx.
|
inline |
Definition at line 501 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 502 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 479 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 482 of file RNTupleDescriptor.hxx.
|
inline |
Definition at line 503 of file RNTupleDescriptor.hxx.
|
static |
Given kNBytesPostscript bytes, extract the header and footer lengths in bytes.
Definition at line 635 of file RNTupleDescriptor.cxx.
|
delete |
|
default |
bool ROOT::Experimental::RNTupleDescriptor::operator== | ( | const RNTupleDescriptor & | other | ) | const |
Definition at line 535 of file RNTupleDescriptor.cxx.
void ROOT::Experimental::RNTupleDescriptor::PrintInfo | ( | std::ostream & | output | ) | const |
Definition at line 98 of file RNTupleDescriptorFmt.cxx.
std::uint32_t ROOT::Experimental::RNTupleDescriptor::SerializeFooter | ( | void * | buffer | ) | const |
Serializes cluster meta data. Returns the number of bytes and fills buffer if it is not nullptr.
Definition at line 587 of file RNTupleDescriptor.cxx.
std::uint32_t ROOT::Experimental::RNTupleDescriptor::SerializeHeader | ( | void * | buffer | ) | const |
We deliberately do not use ROOT's built-in serialization in order to allow for use of RNTuple's without libCore Serializes the global ntuple information as well as the column and field schemata Returns the number of bytes and fills buffer if it is not nullptr.
TODO(jblomer): instead of runtime testing for nullptr, there should be a template for the case where only the size of the buffer is required.
Definition at line 551 of file RNTupleDescriptor.cxx.
|
friend |
Definition at line 280 of file RNTupleDescriptor.hxx.
|
private |
The origin of the data.
Definition at line 288 of file RNTupleDescriptor.hxx.
|
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 307 of file RNTupleDescriptor.hxx.
|
private |
Definition at line 304 of file RNTupleDescriptor.hxx.
|
private |
The current responsible for storing the data.
Definition at line 290 of file RNTupleDescriptor.hxx.
|
private |
Free text from the user.
Definition at line 286 of file RNTupleDescriptor.hxx.
|
private |
Definition at line 303 of file RNTupleDescriptor.hxx.
|
private |
Column sets that are created as derived sets from existing NTuples share the same group id.
NTuples in the same group have the same number of entries and are supposed to contain associated data.
Definition at line 301 of file RNTupleDescriptor.hxx.
|
private |
The ntuple name needs to be unique in a given storage location (file)
Definition at line 284 of file RNTupleDescriptor.hxx.
|
private |
Every NTuple gets a unique identifier.
Definition at line 298 of file RNTupleDescriptor.hxx.
|
private |
The time stamp of the ntuple data (immutable)
Definition at line 292 of file RNTupleDescriptor.hxx.
|
private |
The time stamp of writing the data to storage, which gets updated when re-written.
Definition at line 294 of file RNTupleDescriptor.hxx.
|
private |
The version evolves with the ntuple summary meta-data.
Definition at line 296 of file RNTupleDescriptor.hxx.
|
staticconstexpr |
In order to handle changes to the serialization routine in future ntuple versions.
Definition at line 420 of file RNTupleDescriptor.hxx.
|
staticconstexpr |
Definition at line 421 of file RNTupleDescriptor.hxx.
|
staticconstexpr |
The last few bytes after the footer store the length of footer and header.
Definition at line 425 of file RNTupleDescriptor.hxx.
|
staticconstexpr |
The preamble is sufficient to get the length of the header.
Definition at line 423 of file RNTupleDescriptor.hxx.