25 std::span<std::unique_ptr<RPageSource>>
sources)
53 auto physicalId =
c.IsAliasColumn() ? fColumnMap.GetVirtualId({
originIdx,
c.GetPhysicalId()}) : fNextId;
58 .BitsOnStorage(
c.GetBitsOnStorage())
59 .ValueRange(
c.GetValueRange())
62 .RepresentationIndex(
c.GetRepresentationIndex());
63 fBuilder.AddColumn(
columnBuilder.MakeDescriptor().Unwrap()).ThrowOnError();
64 fColumnMap.Insert({
originIdx,
c.GetLogicalId()}, fNextId);
71 fBuilder.SetNTuple(fNTupleName,
"");
75 for (std::size_t i = 0; i < fSources.size(); ++i) {
76 fSources[i]->Attach();
78 if (fSources[i]->GetNEntries() != fSources[0]->GetNEntries()) {
83 throw RException(
R__FAIL(
"mismatch in the number of entries of friend RNTuples"));
87 for (
unsigned j = 0;
j < i; ++
j) {
88 if (fSources[
j]->GetSharedDescriptorGuard()->GetName() ==
descriptorGuard->GetName()) {
102 fIdBiMap.Insert({i,
cg.GetId()}, fNextId);
108 clusterBuilder.ClusterId(fNextId).FirstEntryIndex(
c.GetFirstEntryIndex()).NEntries(
c.GetNEntries());
123 clusterBuilder.CommitSuppressedColumnRanges(fBuilder.GetDescriptor()).ThrowOnError();
125 fIdBiMap.Insert({i,
c.GetId()}, fNextId);
130 fBuilder.EnsureValidDescriptor();
131 return fBuilder.MoveDescriptor();
134std::unique_ptr<ROOT::Experimental::Internal::RPageSource>
139 for (
const auto &
f : fSources)
141 auto clone = std::make_unique<RPageSourceFriends>(fNTupleName,
cloneSources);
142 clone->fIdBiMap = fIdBiMap;
143 clone->fColumnMap = fColumnMap;
208std::vector<std::unique_ptr<ROOT::Experimental::Internal::RCluster>>
213 return std::vector<std::unique_ptr<ROOT::Experimental::Internal::RCluster>>(
clusterKeys.size());
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void ObserveMetrics(RNTupleMetrics &observee)
A helper class for piece-wise construction of an RClusterDescriptor.
static RClusterGroupDescriptorBuilder FromSummary(const RClusterGroupDescriptor &clusterGroupDesc)
A helper class for piece-wise construction of an RColumnDescriptor.
A column is a storage-backed array of a simple, fixed-size type, from which pages can be mapped into ...
A helper class for piece-wise construction of an RFieldDescriptor.
RResult< RFieldDescriptor > MakeDescriptor() const
Attempt to make a field descriptor.
RFieldDescriptorBuilder & FieldName(const std::string &fieldName)
RFieldDescriptorBuilder & FieldId(DescriptorId_t fieldId)
std::vector< std::unique_ptr< RCluster > > LoadClusters(std::span< RCluster::RKey > clusterKeys) final
Populates all the pages of the given cluster ids and columns; it is possible that some columns do not...
RPageSourceFriends(std::string_view ntupleName, std::span< std::unique_ptr< RPageSource > > sources)
void LoadSealedPage(DescriptorId_t physicalColumnId, RClusterIndex clusterIndex, RSealedPage &sealedPage) final
Read the packed and compressed bytes of a page into the memory buffer provided by sealedPage.
ColumnHandle_t AddColumn(DescriptorId_t fieldId, RColumn &column) final
Register a new column.
std::vector< std::unique_ptr< RPageSource > > fSources
RPageRef LoadPage(ColumnHandle_t columnHandle, NTupleSize_t globalIndex) final
Allocates and fills a page that contains the index-th element.
~RPageSourceFriends() final
RNTupleDescriptor AttachImpl() final
LoadStructureImpl() has been called before AttachImpl() is called
void DropColumn(ColumnHandle_t columnHandle) final
Unregisters a column.
std::unique_ptr< RPageSource > CloneImpl() const final
Returns a new, unattached page source for the same data set.
void AddVirtualField(const RNTupleDescriptor &originDesc, std::size_t originIdx, const RFieldDescriptor &originField, DescriptorId_t virtualParent, const std::string &virtualName)
Detail::RNTupleMetrics fMetrics
Abstract interface to read data from an ntuple.
ColumnHandle_t AddColumn(DescriptorId_t fieldId, RColumn &column) override
Register a new column.
void DropColumn(ColumnHandle_t columnHandle) override
Unregisters a column.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
Base class for all ROOT issued exceptions.
Meta-data stored for every field of an ntuple.
The on-storage meta-data of an ntuple.
Common user-tunable settings for reading ntuples.
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.
A sealed page contains the bytes of a page as written to storage (packed & compressed).