48 clone.fFieldId = fFieldId;
49 clone.fFieldVersion = fFieldVersion;
50 clone.fTypeVersion = fTypeVersion;
51 clone.fFieldName = fFieldName;
52 clone.fFieldDescription = fFieldDescription;
54 clone.fTypeAlias = fTypeAlias;
55 clone.fNRepetitions = fNRepetitions;
56 clone.fStructure = fStructure;
57 clone.fParentId = fParentId;
58 clone.fLinkIds = fLinkIds;
62std::unique_ptr<ROOT::Experimental::Detail::RFieldBase>
68 std::vector<std::unique_ptr<Detail::RFieldBase>> memberFields;
69 for (
auto id : fLinkIds) {
71 memberFields.emplace_back(memberDesc.CreateField(ntplDesc));
73 auto recordField = std::make_unique<RRecordField>(
"_0", memberFields);
74 auto collectionField = std::make_unique<RVectorField>(GetFieldName(), std::move(recordField));
75 collectionField->SetOnDiskId(fFieldId);
76 return collectionField;
81 field->SetOnDiskId(fFieldId);
82 for (
auto &
f : *field)
83 f.SetOnDiskId(ntplDesc.
FindFieldId(
f.GetName(),
f.GetParent()->GetOnDiskId()));
102 clone.fLogicalColumnId = fLogicalColumnId;
103 clone.fPhysicalColumnId = fPhysicalColumnId;
104 clone.fModel = fModel;
105 clone.fFieldId = fFieldId;
106 clone.fIndex = fIndex;
107 clone.fFirstElementIndex = fFirstElementIndex;
120 decltype(idxInCluster) firstInPage = 0;
122 for (
const auto &pi : fPageInfos) {
123 if (firstInPage + pi.fNElements > idxInCluster) {
138 std::size_t pageSize)
142 const auto nElements = std::accumulate(fPageInfos.begin(), fPageInfos.end(), 0U,
143 [](std::size_t
n,
const auto &
PI) { return n + PI.fNElements; });
144 const auto nElementsRequired =
static_cast<std::uint64_t
>(columnRange.
fNElements);
146 if (nElementsRequired == nElements)
148 R__ASSERT((nElementsRequired > nElements) &&
"invalid attempt to shrink RPageRange");
150 std::vector<RPageInfo> pageInfos;
152 const std::uint64_t nElementsPerPage = pageSize / element.
GetSize();
154 for (
auto nRemainingElements = nElementsRequired - nElements; nRemainingElements > 0;) {
156 PI.
fNElements = std::min(nElementsPerPage, nRemainingElements);
159 pageInfos.emplace_back(
PI);
160 nRemainingElements -=
PI.fNElements;
163 pageInfos.insert(pageInfos.end(), std::make_move_iterator(fPageInfos.begin()),
164 std::make_move_iterator(fPageInfos.end()));
165 std::swap(fPageInfos, pageInfos);
166 return nElementsRequired - nElements;
179 EnsureHasPageLocations();
180 std::unordered_set<DescriptorId_t>
result;
181 for (
const auto &
x : fColumnRanges)
188 EnsureHasPageLocations();
189 return fColumnRanges.find(physicalId) != fColumnRanges.end();
195 EnsureHasPageLocations();
196 std::uint64_t nbytes = 0;
197 for (
const auto &pr : fPageRanges) {
198 for (
const auto &pi : pr.second.fPageInfos) {
199 nbytes += pi.fLocator.fBytesOnStorage;
207 if (!fHasPageLocations)
208 throw RException(
R__FAIL(
"invalid attempt to access page locations of summary-only cluster descriptor"));
214 clone.fClusterId = fClusterId;
215 clone.fFirstEntryIndex = fFirstEntryIndex;
216 clone.fNEntries = fNEntries;
217 clone.fHasPageLocations = fHasPageLocations;
218 clone.fColumnRanges = fColumnRanges;
219 for (
const auto &
d : fPageRanges)
220 clone.fPageRanges.emplace(
d.first,
d.second.Clone());
230 return fName == other.
fName &&
245 for (
const auto &cd : fClusterDescriptors) {
246 if (!cd.second.ContainsColumn(physicalColumnId))
248 auto columnRange = cd.second.GetColumnRange(physicalColumnId);
249 result = std::max(
result, columnRange.fFirstElementIndex + columnRange.fNElements);
258 std::string leafName(fieldName);
259 auto posDot = leafName.find_last_of(
'.');
260 if (posDot != std::string::npos) {
261 auto parentName = leafName.substr(0, posDot);
262 leafName = leafName.substr(posDot + 1);
263 parentId = FindFieldId(parentName, parentId);
265 for (
const auto &fd : fFieldDescriptors) {
266 if (fd.second.GetParentId() == parentId && fd.second.GetFieldName() == leafName)
267 return fd.second.GetId();
278 const auto &fieldDescriptor = fFieldDescriptors.at(fieldId);
279 auto prefix = GetQualifiedFieldName(fieldDescriptor.GetParentId());
281 return fieldDescriptor.GetFieldName();
282 return prefix +
"." + fieldDescriptor.GetFieldName();
296 return FindFieldId(fieldName, GetFieldZeroId());
302 for (
const auto &cd : fColumnDescriptors) {
303 if (cd.second.GetFieldId() == fieldId && cd.second.GetIndex() == columnIndex)
304 return cd.second.GetLogicalId();
312 auto logicalId = FindLogicalColumnId(fieldId, columnIndex);
315 return GetColumnDescriptor(logicalId).GetPhysicalId();
322 for (
const auto &cd : fClusterDescriptors) {
323 if (!cd.second.ContainsColumn(physicalColumnId))
325 auto columnRange = cd.second.GetColumnRange(physicalColumnId);
326 if (columnRange.Contains(
index))
327 return cd.second.GetId();
337 const auto &clusterDesc = GetClusterDescriptor(clusterId);
338 auto firstEntryInNextCluster = clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries();
340 for (
const auto &cd : fClusterDescriptors) {
341 if (cd.second.GetFirstEntryIndex() == firstEntryInNextCluster)
342 return cd.second.GetId();
352 const auto &clusterDesc = GetClusterDescriptor(clusterId);
354 for (
const auto &cd : fClusterDescriptors) {
355 if (cd.second.GetFirstEntryIndex() + cd.second.GetNEntries() == clusterDesc.GetFirstEntryIndex())
356 return cd.second.GetId();
361std::vector<ROOT::Experimental::DescriptorId_t>
366 std::vector<DescriptorId_t> fields;
369 fields.emplace_back(fieldId);
375 for (
unsigned int i = 0;
true; ++i) {
376 auto logicalId = fNTuple.FindLogicalColumnId(fieldId, i);
379 fColumns.emplace_back(logicalId);
396 while (!fieldIdQueue.empty()) {
397 auto currFieldId = fieldIdQueue.front();
398 fieldIdQueue.pop_front();
403 auto fieldId = field.GetId();
404 fieldIdQueue.push_back(fieldId);
414 return R__FAIL(
"invalid attempt to add cluster details without known cluster summary");
415 if (iter->second.HasPageLocations())
416 return R__FAIL(
"invalid attempt to re-populate page list");
417 if (!clusterDesc.HasPageLocations())
418 return R__FAIL(
"provided cluster descriptor does not contain page locations");
419 iter->second = std::move(clusterDesc);
427 return R__FAIL(
"invalid attempt to drop cluster details of unknown cluster");
428 if (!iter->second.HasPageLocations())
429 return R__FAIL(
"invalid attempt to drop details of cluster summary");
430 iter->second =
RClusterDescriptor(clusterId, iter->second.GetFirstEntryIndex(), iter->second.GetNEntries());
439 model->AddField(topDesc.CreateField(*
this));
446 auto clone = std::make_unique<RNTupleDescriptor>();
455 clone->fFieldDescriptors.emplace(
d.first,
d.second.Clone());
457 clone->fColumnDescriptors.emplace(
d.first,
d.second.Clone());
459 clone->fClusterGroupDescriptors.emplace(
d.first,
d.second.Clone());
461 clone->fClusterDescriptors.emplace(
d.first,
d.second.Clone());
484 clone.fClusterGroupId = fClusterGroupId;
485 clone.fClusterIds = fClusterIds;
486 clone.fPageListLocator = fPageListLocator;
487 clone.fPageListLength = fPageListLength;
495 std::uint64_t firstElementIndex,
496 std::uint32_t compressionSettings,
500 return R__FAIL(
"column ID mismatch");
501 if (fCluster.fPageRanges.count(physicalId) > 0)
502 return R__FAIL(
"column ID conflict");
504 columnRange.fCompressionSettings = compressionSettings;
506 columnRange.fNElements += pi.fNElements;
508 fCluster.fPageRanges[physicalId] = pageRange.
Clone();
509 fCluster.fColumnRanges[physicalId] = columnRange;
519 auto fnTraverseSubtree = [&](
DescriptorId_t rootFieldId, std::uint64_t nRepetitionsAtThisLevel,
520 const auto &visitField,
const auto &enterSubtree) ->
void {
521 visitField(rootFieldId, nRepetitionsAtThisLevel);
523 const std::uint64_t nRepetitions = std::max(
f.GetNRepetitions(), std::uint64_t{1U}) * nRepetitionsAtThisLevel;
524 enterSubtree(
f.GetId(), nRepetitions, visitField, enterSubtree);
534 for (
const auto &topLevelFieldId : xHeader->GetTopLevelFields(desc)) {
538 for (const auto &c : desc.GetColumnIterable(fieldId)) {
539 const DescriptorId_t physicalId = c.GetPhysicalId();
540 auto &columnRange = fCluster.fColumnRanges[physicalId];
541 auto &pageRange = fCluster.fPageRanges[physicalId];
543 if (columnRange.fPhysicalColumnId == kInvalidDescriptorId) {
544 columnRange.fPhysicalColumnId = physicalId;
545 pageRange.fPhysicalColumnId = physicalId;
553 if (c.IsDeferredColumn()) {
554 columnRange.fFirstElementIndex = fCluster.GetFirstEntryIndex() * nRepetitions;
555 columnRange.fNElements = fCluster.GetNEntries() * nRepetitions;
556 const auto element = Detail::RColumnElementBase::Generate<void>(c.GetModel().GetType());
557 pageRange.ExtendToFitColumnRange(columnRange, *element, Detail::RPage::kPageZeroSize);
570 return R__FAIL(
"unset cluster ID");
571 if (fCluster.fNEntries == 0)
572 return R__FAIL(
"empty cluster");
573 for (
const auto &pr : fCluster.fPageRanges) {
574 if (fCluster.fColumnRanges.count(pr.first) == 0) {
575 return R__FAIL(
"missing column range");
578 fCluster.fHasPageLocations =
true;
580 std::swap(
result, fCluster);
584std::vector<ROOT::Experimental::RClusterDescriptorBuilder>
589 std::vector<RClusterDescriptorBuilder>
result;
590 for (
auto clusterId : clusterGroupDesc.fClusterIds) {
603 return R__FAIL(
"unset cluster group ID");
605 std::swap(
result, fClusterGroup);
615 return R__FAIL(
"unset column group ID");
617 std::swap(
result, fColumnGroup);
625 if (fDescriptor.fFieldDescriptors.count(fieldId) == 0)
626 return R__FAIL(
"field with id '" + std::to_string(fieldId) +
"' doesn't exist");
638 for (
const auto& key_val: fDescriptor.fFieldDescriptors) {
639 const auto&
id = key_val.first;
640 const auto& desc = key_val.second;
643 return R__FAIL(
"field with id '" + std::to_string(
id) +
"' has an invalid parent id");
652 std::swap(
result, fDescriptor);
657 const std::string_view description)
659 fDescriptor.fName = std::string(
name);
660 fDescriptor.fDescription = std::string(description);
667 return R__FAIL(
"invalid logical column id");
669 return R__FAIL(
"invalid physical column id");
671 return R__FAIL(
"invalid column model");
673 return R__FAIL(
"invalid field id, dangling column");
674 return fColumn.Clone();
701 return R__FAIL(
"invalid field id");
704 return R__FAIL(
"invalid field structure");
713 return fField.Clone();
717 fDescriptor.fFieldDescriptors.emplace(fieldDesc.
GetId(), fieldDesc.
Clone());
718 if (fDescriptor.fHeaderExtension)
719 fDescriptor.fHeaderExtension->AddFieldId(fieldDesc.
GetId());
726 if (!(fieldExists = EnsureFieldExists(fieldId)))
728 if (!(fieldExists = EnsureFieldExists(linkId)))
729 return R__FAIL(
"child field with id '" + std::to_string(linkId) +
"' doesn't exist in NTuple");
731 if (linkId == fDescriptor.GetFieldZeroId()) {
732 return R__FAIL(
"cannot make FieldZero a child field");
735 auto parentId = fDescriptor.fFieldDescriptors.at(linkId).GetParentId();
737 return R__FAIL(
"field '" + std::to_string(linkId) +
"' already has a parent ('" +
738 std::to_string(parentId) +
")");
740 if (fieldId == linkId) {
741 return R__FAIL(
"cannot make field '" + std::to_string(fieldId) +
"' a child of itself");
743 fDescriptor.fFieldDescriptors.at(linkId).fParentId = fieldId;
744 fDescriptor.fFieldDescriptors.at(fieldId).fLinkIds.push_back(linkId);
750 std::uint32_t
index, std::uint64_t firstElementIdx)
754 c.fPhysicalColumnId = physicalId;
755 c.fFieldId = fieldId;
758 c.fFirstElementIndex = firstElementIdx;
759 if (!
c.IsAliasColumn())
760 fDescriptor.fNPhysicalColumns++;
761 if (fDescriptor.fHeaderExtension)
762 fDescriptor.fHeaderExtension->AddColumn(
c.IsAliasColumn());
763 fDescriptor.fColumnDescriptors.emplace(logicalId, std::move(
c));
770 const auto fieldId = columnDesc.GetFieldId();
771 const auto index = columnDesc.GetIndex();
773 auto fieldExists = EnsureFieldExists(fieldId);
777 return R__FAIL(
"column index clash");
781 return R__FAIL(
"out of bounds column index");
783 if (columnDesc.IsAliasColumn()) {
784 if (columnDesc.GetModel() != fDescriptor.GetColumnDescriptor(columnDesc.GetPhysicalId()).GetModel())
785 return R__FAIL(
"alias column type mismatch");
788 auto logicalId = columnDesc.GetLogicalId();
789 if (!columnDesc.IsAliasColumn())
790 fDescriptor.fNPhysicalColumns++;
791 fDescriptor.fColumnDescriptors.emplace(logicalId, std::move(columnDesc));
792 if (fDescriptor.fHeaderExtension)
793 fDescriptor.fHeaderExtension->AddColumn(columnDesc.IsAliasColumn());
800 std::uint64_t nEntries)
802 if (fDescriptor.fClusterDescriptors.count(clusterId) > 0)
803 return R__FAIL(
"cluster id clash while adding cluster summary");
804 fDescriptor.fNEntries = std::max(fDescriptor.fNEntries, firstEntry + nEntries);
805 fDescriptor.fClusterDescriptors.emplace(clusterId,
RClusterDescriptor(clusterId, firstEntry, nEntries));
811 auto id = clusterGroup.GetId();
812 fDescriptor.fClusterGroupDescriptors.emplace(
id, clusterGroup.MoveDescriptor().Unwrap());
817 fDescriptor.fName =
"";
818 fDescriptor.fDescription =
"";
819 fDescriptor.fFieldDescriptors.clear();
820 fDescriptor.fColumnDescriptors.clear();
821 fDescriptor.fClusterDescriptors.clear();
822 fDescriptor.fClusterGroupDescriptors.clear();
823 fDescriptor.fHeaderExtension.reset();
828 if (!fDescriptor.fHeaderExtension)
829 fDescriptor.fHeaderExtension = std::make_unique<RNTupleDescriptor::RHeaderExtension>();
835 auto clusterId = clusterDesc.GetId();
836 if (fDescriptor.fClusterDescriptors.count(clusterId) > 0)
837 return R__FAIL(
"cluster id clash");
838 fDescriptor.fNEntries =
839 std::max(fDescriptor.fNEntries, clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries());
840 fDescriptor.fClusterDescriptors.emplace(clusterId, std::move(clusterDesc));
#define R__FORWARD_ERROR(res)
Short-hand to return an RResult<T> in an error state (i.e. after checking)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
TObject * clone(const char *newname) const override
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
A column element encapsulates the translation between basic C++ types and their column representation...
std::size_t GetPackedSize(std::size_t nElements=1U) const
std::size_t GetSize() const
A field translates read and write calls from/to underlying columns to/from tree values.
virtual std::uint32_t GetFieldVersion() const
Indicates an evolution of the mapping scheme from C++ type to columns.
std::string GetDescription() const
Get the field's description.
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &canonicalType, const std::string &typeAlias)
Factory method to resurrect a field from the stored on-disk type information.
std::string GetTypeAlias() const
std::string GetName() const
std::size_t GetNRepetitions() const
virtual std::uint32_t GetTypeVersion() const
Indicates an evolution of the C++ type itself.
std::string GetType() const
static RResult< void > EnsureValidFieldName(std::string_view fieldName)
Check whether a given string is a valid field name.
ENTupleStructure GetStructure() const
A helper class for piece-wise construction of an RClusterDescriptor.
RClusterDescriptorBuilder & AddDeferredColumnRanges(const RNTupleDescriptor &desc)
Add column and page ranges for deferred columns missing in this cluster.
RResult< void > CommitColumnRange(DescriptorId_t physicalId, std::uint64_t firstElementIndex, std::uint32_t compressionSettings, const RClusterDescriptor::RPageRange &pageRange)
RResult< RClusterDescriptor > MoveDescriptor()
Move out the full cluster descriptor including page locations.
Meta-data for a set of ntuple clusters.
std::unordered_map< DescriptorId_t, RPageRange > fPageRanges
bool ContainsColumn(DescriptorId_t physicalId) const
NTupleSize_t fFirstEntryIndex
Clusters can be swapped by adjusting the entry offsets.
DescriptorId_t fClusterId
std::unordered_set< DescriptorId_t > GetColumnIds() const
RClusterDescriptor Clone() const
std::unordered_map< DescriptorId_t, RColumnRange > fColumnRanges
bool operator==(const RClusterDescriptor &other) const
std::uint64_t GetBytesOnStorage() const
void EnsureHasPageLocations() const
A helper class for piece-wise construction of an RClusterGroupDescriptor.
RResult< RClusterGroupDescriptor > MoveDescriptor()
static std::vector< RClusterDescriptorBuilder > GetClusterSummaries(const RNTupleDescriptor &ntplDesc, DescriptorId_t clusterGroupId)
Used to prepare the cluster descriptor builders when loading the page locations for a certain cluster...
Clusters are stored in cluster groups.
RClusterGroupDescriptor Clone() const
DescriptorId_t fClusterGroupId
bool operator==(const RClusterGroupDescriptor &other) const
std::vector< DescriptorId_t > fClusterIds
RResult< RColumnDescriptor > MakeDescriptor() const
Attempt to make a column descriptor.
Meta-data stored for every column of an ntuple.
DescriptorId_t fPhysicalColumnId
Usually identical to the logical column ID, except for alias columns where it references the shadowed...
DescriptorId_t fLogicalColumnId
The actual column identifier, which is the link to the corresponding field.
RColumnDescriptor Clone() const
Get a copy of the descriptor.
DescriptorId_t fFieldId
Every column belongs to one and only one field.
RColumnModel fModel
Contains the column type and whether it is sorted.
std::uint32_t fIndex
A field can be serialized into several columns, which are numbered from zero to $n$.
bool operator==(const RColumnDescriptor &other) const
RResult< RColumnGroupDescriptor > MoveDescriptor()
Meta-data for a sets of columns; non-trivial column groups are used for sharded clusters.
std::unordered_set< DescriptorId_t > fPhysicalColumnIds
bool operator==(const RColumnGroupDescriptor &other) const
DescriptorId_t fColumnGroupId
Holds the static meta-data of an RNTuple column.
Base class for all ROOT issued exceptions.
A helper class for piece-wise construction of an RFieldDescriptor.
RFieldDescriptorBuilder & FieldName(const std::string &fieldName)
RFieldDescriptorBuilder & NRepetitions(std::uint64_t nRepetitions)
static RFieldDescriptorBuilder FromField(const Detail::RFieldBase &field)
Make a new RFieldDescriptorBuilder based off a live NTuple field.
RFieldDescriptorBuilder & Structure(const ENTupleStructure &structure)
RResult< RFieldDescriptor > MakeDescriptor() const
Attempt to make a field descriptor.
RFieldDescriptorBuilder & TypeName(const std::string &typeName)
RFieldDescriptorBuilder & TypeVersion(std::uint32_t typeVersion)
RFieldDescriptorBuilder & FieldDescription(const std::string &fieldDescription)
RFieldDescriptorBuilder & FieldVersion(std::uint32_t fieldVersion)
RFieldDescriptorBuilder()=default
Make an empty dangling field descriptor.
RFieldDescriptorBuilder & TypeAlias(const std::string &typeAlias)
Meta-data stored for every field of an ntuple.
std::vector< DescriptorId_t > fLinkIds
The pointers in the other direction from parent to children.
DescriptorId_t GetParentId() const
std::uint32_t fTypeVersion
The version of the C++ type itself.
std::unique_ptr< Detail::RFieldBase > CreateField(const RNTupleDescriptor &ntplDesc) const
In general, we create a field simply from the C++ type name.
std::string fFieldDescription
Free text set by the user.
std::string fFieldName
The leaf name, not including parent fields.
std::uint32_t fFieldVersion
The version of the C++-type-to-column translation mechanics.
DescriptorId_t GetId() const
DescriptorId_t fParentId
Establishes sub field relationships, such as classes and collections.
std::uint64_t GetNRepetitions() const
RFieldDescriptor Clone() const
Get a copy of the descriptor.
bool operator==(const RFieldDescriptor &other) const
std::string fTypeAlias
A typedef or using directive that resolved to the type name during field creation.
ENTupleStructure fStructure
The structural information carried by this field in the data model tree.
std::string fTypeName
The C++ type that was used when writing the field.
std::uint64_t fNRepetitions
The number of elements per entry for fixed-size arrays.
RNTupleDescriptor MoveDescriptor()
RResult< void > EnsureValidDescriptor() const
Checks whether invariants hold:
RResult< void > AddClusterSummary(DescriptorId_t clusterId, std::uint64_t firstEntry, std::uint64_t nEntries)
RResult< void > EnsureFieldExists(DescriptorId_t fieldId) const
void AddColumn(DescriptorId_t logicalId, DescriptorId_t physicalId, DescriptorId_t fieldId, const RColumnModel &model, std::uint32_t index, std::uint64_t firstElementIdx=0U)
RResult< void > AddFieldLink(DescriptorId_t fieldId, DescriptorId_t linkId)
void SetNTuple(const std::string_view name, const std::string_view description)
void Reset()
Clears so-far stored clusters, fields, and columns and return to a pristine ntuple descriptor.
void AddClusterGroup(RClusterGroupDescriptorBuilder &&clusterGroup)
RResult< void > AddClusterWithDetails(RClusterDescriptor &&clusterDesc)
Used during writing.
void BeginHeaderExtension()
Mark the beginning of the header extension; any fields and columns added after a call to this functio...
void AddField(const RFieldDescriptor &fieldDesc)
RColumnDescriptorIterable(const RNTupleDescriptor &ntuple, const RFieldDescriptor &field)
void CollectColumnIds(DescriptorId_t fieldId)
The on-storage meta-data of an ntuple.
std::uint64_t fNPhysicalColumns
Updated by the descriptor builder when columns are added.
std::unordered_map< DescriptorId_t, RClusterDescriptor > fClusterDescriptors
May contain only a subset of all the available clusters, e.g.
std::uint64_t fGeneration
Once constructed by an RNTupleDescriptorBuilder, the descriptor is mostly immutable except for set of...
std::uint64_t fOnDiskFooterSize
Like fOnDiskHeaderSize, contains both cluster summaries and page locations.
std::uint64_t fNEntries
Updated by the descriptor builder when the cluster summaries are added.
DescriptorId_t FindPhysicalColumnId(DescriptorId_t fieldId, std::uint32_t columnIndex) const
NTupleSize_t GetNElements(DescriptorId_t physicalColumnId) const
std::unique_ptr< RNTupleModel > GenerateModel() const
Re-create the C++ model from the stored meta-data.
DescriptorId_t FindLogicalColumnId(DescriptorId_t fieldId, std::uint32_t columnIndex) const
std::unordered_map< DescriptorId_t, RClusterGroupDescriptor > fClusterGroupDescriptors
DescriptorId_t FindNextClusterId(DescriptorId_t clusterId) const
DescriptorId_t FindPrevClusterId(DescriptorId_t clusterId) const
RResult< void > DropClusterDetails(DescriptorId_t clusterId)
DescriptorId_t GetFieldZeroId() const
Returns the logical parent of all top-level NTuple data fields.
std::unordered_map< DescriptorId_t, RColumnDescriptor > fColumnDescriptors
std::unique_ptr< RNTupleDescriptor > Clone() const
DescriptorId_t FindClusterId(DescriptorId_t physicalColumnId, NTupleSize_t index) const
std::string fName
The ntuple name needs to be unique in a given storage location (file)
RFieldDescriptorIterable GetTopLevelFields() const
const RClusterDescriptor & GetClusterDescriptor(DescriptorId_t clusterId) const
std::unordered_map< DescriptorId_t, RFieldDescriptor > fFieldDescriptors
RFieldDescriptorIterable GetFieldIterable(const RFieldDescriptor &fieldDesc) const
bool operator==(const RNTupleDescriptor &other) 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 ...
DescriptorId_t FindFieldId(std::string_view fieldName, DescriptorId_t parentId) const
RResult< void > AddClusterDetails(RClusterDescriptor &&clusterDesc)
Methods to load and drop cluster details.
const RFieldDescriptor & GetFieldDescriptor(DescriptorId_t fieldId) const
std::unique_ptr< RHeaderExtension > fHeaderExtension
const RClusterGroupDescriptor & GetClusterGroupDescriptor(DescriptorId_t clusterGroupId) const
std::string fDescription
Free text from the user.
const RHeaderExtension * GetHeaderExtension() const
Return header extension information; if the descriptor does not have a header extension,...
std::uint64_t fOnDiskHeaderSize
Set by the descriptor builder when deserialized.
static std::unique_ptr< RNTupleModel > Create()
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr DescriptorId_t kInvalidDescriptorId
The window of element indexes of a particular column in a particular cluster.
ClusterSize_t fNElements
The number of column elements in the cluster.
DescriptorId_t fPhysicalColumnId
Wrap the integer in a struct in order to avoid template specialization clash with std::uint32_t.