Inspect a given RNTuple.
Example usage:
Definition at line 62 of file RNTupleInspector.hxx.
Classes | |
class | RColumnInfo |
Holds column-level storage information. More... | |
class | RFieldTreeInfo |
Holds field-level storage information. Includes storage information of the sub-fields. More... | |
Public Member Functions | |
RNTupleInspector (const RNTupleInspector &other)=delete | |
RNTupleInspector (RNTupleInspector &&other)=delete | |
~RNTupleInspector ()=default | |
size_t | GetColumnCountByType (EColumnType colType) const |
Get the number of columns of a given type present in the RNTuple. | |
const RColumnInfo & | GetColumnInfo (DescriptorId_t physicalColumnId) const |
const std::vector< DescriptorId_t > | GetColumnsByType (EColumnType) |
Get the IDs of all columns with the given type. | |
std::uint64_t | GetCompressedSize () const |
Get the compressed, on-disk size of the RNTuple being inspected, in bytes. | |
float | GetCompressionFactor () const |
Get the compression factor of the RNTuple being inspected. | |
int | GetCompressionSettings () const |
Get the compression settings of the RNTuple being inspected. | |
RNTupleDescriptor * | GetDescriptor () const |
Get the descriptor for the RNTuple being inspected. | |
size_t | GetFieldCountByType (const std::regex &typeNamePattern, bool searchInSubFields=true) const |
Get the number of fields of a given type or class present in the RNTuple. | |
size_t | GetFieldCountByType (std::string_view typeNamePattern, bool searchInSubFields=true) const |
const std::vector< DescriptorId_t > | GetFieldsByName (const std::regex &fieldNamePattern, bool searchInSubFields=true) const |
Get the IDs of (sub-)fields whose name matches the given string. | |
const std::vector< DescriptorId_t > | GetFieldsByName (std::string_view fieldNamePattern, bool searchInSubFields=true) |
const RFieldTreeInfo & | GetFieldTreeInfo (DescriptorId_t fieldId) const |
const RFieldTreeInfo & | GetFieldTreeInfo (std::string_view fieldName) const |
std::uint64_t | GetUncompressedSize () const |
Get the uncompressed total size of the RNTuple being inspected, in bytes. | |
RNTupleInspector & | operator= (const RNTupleInspector &other)=delete |
RNTupleInspector & | operator= (RNTupleInspector &&other)=delete |
void | PrintColumnTypeInfo (ENTupleInspectorPrintFormat format=ENTupleInspectorPrintFormat::kTable, std::ostream &output=std::cout) |
Print the per-column type information, either as a table or in CSV format. | |
Static Public Member Functions | |
static std::unique_ptr< RNTupleInspector > | Create (RNTuple *sourceNTuple) |
static std::unique_ptr< RNTupleInspector > | Create (std::string_view ntupleName, std::string_view storage) |
static std::unique_ptr< RNTupleInspector > | Create (std::unique_ptr< Detail::RPageSource > pageSource) |
Create a new inspector for a given RNTuple. | |
Private Member Functions | |
RNTupleInspector (std::unique_ptr< Detail::RPageSource > pageSource) | |
void | CollectColumnInfo () |
Gather column-level, as well as RNTuple-level information. | |
RFieldTreeInfo | CollectFieldTreeInfo (DescriptorId_t fieldId) |
Recursively gather field-level information and store it in fFieldTreeInfo . | |
std::vector< DescriptorId_t > | GetColumnsByFieldId (DescriptorId_t fieldId) const |
Get the IDs of the columns that make up the given field, including its sub-fields. | |
Private Attributes | |
std::map< int, RColumnInfo > | fColumnInfo |
std::uint64_t | fCompressedSize = 0 |
int | fCompressionSettings = -1 |
std::unique_ptr< RNTupleDescriptor > | fDescriptor |
std::map< int, RFieldTreeInfo > | fFieldTreeInfo |
std::unique_ptr< Detail::RPageSource > | fPageSource |
std::unique_ptr< TFile > | fSourceFile |
std::uint64_t | fUncompressedSize = 0 |
#include <ROOT/RNTupleInspector.hxx>
|
private |
Definition at line 31 of file RNTupleInspector.cxx.
|
delete |
|
delete |
|
default |
|
private |
Gather column-level, as well as RNTuple-level information.
The column-level information will be stored in fColumnInfo
, and the RNTuple-level information in fCompressionSettings
, fCompressedSize
and fUncompressedSize
.
This method is called when the RNTupleInspector
is initially created. This means that anything unexpected about the RNTuple itself (e.g. inconsistent compression settings across clusters) will be detected here. Therefore, any related exceptions will be thrown on creation of the inspector.
Definition at line 40 of file RNTupleInspector.cxx.
|
private |
Recursively gather field-level information and store it in fFieldTreeInfo
.
This method is called when the RNTupleInspector
is initially created.
Definition at line 88 of file RNTupleInspector.cxx.
|
static |
Definition at line 151 of file RNTupleInspector.cxx.
|
static |
Definition at line 163 of file RNTupleInspector.cxx.
|
static |
Create a new inspector for a given RNTuple.
When this factory method is called, all required static information is collected from the RNTuple's fields and underlying columns are collected at ones. This means that when any inconsistencies are encountered (e.g. inconsistent compression across clusters), it will throw an error here.
Definition at line 140 of file RNTupleInspector.cxx.
size_t ROOT::Experimental::RNTupleInspector::GetColumnCountByType | ( | EColumnType | colType | ) | const |
Get the number of columns of a given type present in the RNTuple.
Definition at line 197 of file RNTupleInspector.cxx.
const ROOT::Experimental::RNTupleInspector::RColumnInfo & ROOT::Experimental::RNTupleInspector::GetColumnInfo | ( | DescriptorId_t | physicalColumnId | ) | const |
Definition at line 188 of file RNTupleInspector.cxx.
|
private |
Get the IDs of the columns that make up the given field, including its sub-fields.
Definition at line 114 of file RNTupleInspector.cxx.
const std::vector< ROOT::Experimental::DescriptorId_t > ROOT::Experimental::RNTupleInspector::GetColumnsByType | ( | EColumnType | ) |
Get the IDs of all columns with the given type.
Definition at line 211 of file RNTupleInspector.cxx.
|
inline |
Get the compressed, on-disk size of the RNTuple being inspected, in bytes.
Does not include the size of the header and footer.
Definition at line 157 of file RNTupleInspector.hxx.
|
inline |
Get the compression factor of the RNTuple being inspected.
Definition at line 164 of file RNTupleInspector.hxx.
|
inline |
Get the compression settings of the RNTuple being inspected.
Here, we assume that the compression settings are consistent across all clusters and columns. If this is not the case, an exception will be thrown upon RNTupleInspector::Create
.
Definition at line 153 of file RNTupleInspector.hxx.
|
inline |
Get the descriptor for the RNTuple being inspected.
Definition at line 148 of file RNTupleInspector.hxx.
size_t ROOT::Experimental::RNTupleInspector::GetFieldCountByType | ( | const std::regex & | typeNamePattern, |
bool | searchInSubFields = true |
||
) | const |
Get the number of fields of a given type or class present in the RNTuple.
The type name may contain regular expression patterns in order to be able to group multiple kinds of types or classes.
Definition at line 289 of file RNTupleInspector.cxx.
|
inline |
Definition at line 220 of file RNTupleInspector.hxx.
const std::vector< ROOT::Experimental::DescriptorId_t > ROOT::Experimental::RNTupleInspector::GetFieldsByName | ( | const std::regex & | fieldNamePattern, |
bool | searchInSubFields = true |
||
) | const |
Get the IDs of (sub-)fields whose name matches the given string.
Because field names are unique by design, providing a single field name will return a vector containing just the ID of that field. However, regular expression patterns are supported in order to get the IDs of all fields whose name follow a certain structure.
Definition at line 308 of file RNTupleInspector.cxx.
|
inline |
Definition at line 230 of file RNTupleInspector.hxx.
const ROOT::Experimental::RNTupleInspector::RFieldTreeInfo & ROOT::Experimental::RNTupleInspector::GetFieldTreeInfo | ( | DescriptorId_t | fieldId | ) | const |
Definition at line 268 of file RNTupleInspector.cxx.
const ROOT::Experimental::RNTupleInspector::RFieldTreeInfo & ROOT::Experimental::RNTupleInspector::GetFieldTreeInfo | ( | std::string_view | fieldName | ) | const |
Definition at line 278 of file RNTupleInspector.cxx.
|
inline |
Get the uncompressed total size of the RNTuple being inspected, in bytes.
Does not include the size of the header and footer.
Definition at line 161 of file RNTupleInspector.hxx.
|
delete |
|
delete |
void ROOT::Experimental::RNTupleInspector::PrintColumnTypeInfo | ( | ENTupleInspectorPrintFormat | format = ENTupleInspectorPrintFormat::kTable , |
std::ostream & | output = std::cout |
||
) |
Print the per-column type information, either as a table or in CSV format.
The output includes the column type, its count, the total number of elements, the compressed size and the uncompressed size.
Example: printing the column type information of an RNTuple as a table
Ouput:
Example: printing the column type information of an RNTuple in CSV format
Ouput:
Definition at line 223 of file RNTupleInspector.cxx.
|
private |
Definition at line 111 of file RNTupleInspector.hxx.
|
private |
Definition at line 108 of file RNTupleInspector.hxx.
|
private |
Definition at line 107 of file RNTupleInspector.hxx.
|
private |
Definition at line 106 of file RNTupleInspector.hxx.
|
private |
Definition at line 112 of file RNTupleInspector.hxx.
|
private |
Definition at line 105 of file RNTupleInspector.hxx.
|
private |
Definition at line 104 of file RNTupleInspector.hxx.
|
private |
Definition at line 109 of file RNTupleInspector.hxx.