Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Detail::RPageSourceFriends Class Referencefinal

Virtual storage that combines several other sources horizontally.

Definition at line 39 of file RPageSourceFriends.hxx.

Classes

struct  RIdBiMap
 A bi-directional map of descriptor IDs that translates from physical to virtual column, field, and cluster IDs and vice versa. More...
 
struct  ROriginId
 

Public Member Functions

 RPageSourceFriends (std::string_view ntupleName, std::span< std::unique_ptr< RPageSource > > sources)
 
 ~RPageSourceFriends () final
 
ColumnHandle_t AddColumn (DescriptorId_t fieldId, const RColumn &column) final
 Register a new column.
 
std::unique_ptr< RPageSourceClone () const final
 Open the same storage multiple time, e.g. for reading in multiple threads.
 
void DropColumn (ColumnHandle_t columnHandle) final
 Unregisters a column.
 
RNTupleMetricsGetMetrics () final
 Returns the default metrics object. Subclasses might alternatively override the method and provide their own metrics object.
 
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 contain any pages.
 
void LoadSealedPage (DescriptorId_t columnId, const RClusterIndex &clusterIndex, RSealedPage &sealedPage) final
 Read the packed and compressed bytes of a page into the memory buffer provided by selaedPage.
 
RPage PopulatePage (ColumnHandle_t columnHandle, const RClusterIndex &clusterIndex) final
 Another version of PopulatePage that allows to specify cluster-relative indexes.
 
RPage PopulatePage (ColumnHandle_t columnHandle, NTupleSize_t globalIndex) final
 Allocates and fills a page that contains the index-th element.
 
void ReleasePage (RPage &page) final
 Every page store needs to be able to free pages it handed out.
 
- Public Member Functions inherited from ROOT::Experimental::Detail::RPageSource
 RPageSource (const RPageSource &)=delete
 
 RPageSource (RPageSource &&)=default
 
 RPageSource (std::string_view ntupleName, const RNTupleReadOptions &fOptions)
 
virtual ~RPageSource ()
 
void Attach ()
 Open the physical storage container for the tree.
 
ColumnId_t GetColumnId (ColumnHandle_t columnHandle)
 
const RNTupleDescriptorGetDescriptor () const
 
NTupleSize_t GetNElements (ColumnHandle_t columnHandle)
 
NTupleSize_t GetNEntries ()
 
const RNTupleReadOptionsGetReadOptions () const
 
EPageStorageType GetType () final
 Whether the concrete implementation is a sink or a source.
 
RPageSourceoperator= (const RPageSource &)=delete
 
RPageSourceoperator= (RPageSource &&)=default
 
void UnzipCluster (RCluster *cluster)
 Parallel decompression and unpacking of the pages in the given cluster.
 
- Public Member Functions inherited from ROOT::Experimental::Detail::RPageStorage
 RPageStorage (const RPageStorage &other)=delete
 
 RPageStorage (RPageStorage &&other)=default
 
 RPageStorage (std::string_view name)
 
virtual ~RPageStorage ()
 
const std::string & GetNTupleName () const
 Returns the NTuple name.
 
RPageStorageoperator= (const RPageStorage &other)=delete
 
RPageStorageoperator= (RPageStorage &&other)=default
 
void SetTaskScheduler (RTaskScheduler *taskScheduler)
 

Protected Member Functions

RNTupleDescriptor AttachImpl () final
 
- Protected Member Functions inherited from ROOT::Experimental::Detail::RPageSource
void EnableDefaultMetrics (const std::string &prefix)
 Enables the default set of metrics provided by RPageSource.
 
std::unique_ptr< unsigned char[]> UnsealPage (const RSealedPage &sealedPage, const RColumnElementBase &element)
 Helper for unstreaming a page.
 
virtual void UnzipClusterImpl (RCluster *)
 

Private Member Functions

void AddVirtualField (std::size_t originIdx, const RFieldDescriptor &originField, DescriptorId_t virtualParent, const std::string &virtualName)
 

Private Attributes

RNTupleDescriptorBuilder fBuilder
 
RIdBiMap fIdBiMap
 
RNTupleMetrics fMetrics
 
DescriptorId_t fNextId = 1
 0 is reserved for the friend zero field
 
std::vector< std::unique_ptr< RPageSource > > fSources
 

Additional Inherited Members

- Public Types inherited from ROOT::Experimental::Detail::RPageStorage
using ColumnHandle_t = RColumnHandle
 The column handle identifies a column with the current open page storage.
 
- Static Public Member Functions inherited from ROOT::Experimental::Detail::RPageSource
static std::unique_ptr< RPageSourceCreate (std::string_view ntupleName, std::string_view location, const RNTupleReadOptions &options=RNTupleReadOptions())
 Guess the concrete derived page source from the file name (location)
 
- Protected Attributes inherited from ROOT::Experimental::Detail::RPageSource
RCluster::ColumnSet_t fActiveColumns
 The active columns are implicitly defined by the model fields or views.
 
std::unique_ptr< RCountersfCounters
 
std::unique_ptr< RNTupleDecompressorfDecompressor
 Helper to unzip pages and header/footer; comprises a 16MB (kMAXZIPBUF) unzip buffer.
 
RNTupleDescriptor fDescriptor
 
RNTupleMetrics fMetrics
 Wraps the I/O counters and is observed by the RNTupleReader metrics.
 
RNTupleReadOptions fOptions
 
- Protected Attributes inherited from ROOT::Experimental::Detail::RPageStorage
std::string fNTupleName
 
RTaskSchedulerfTaskScheduler = nullptr
 

#include <ROOT/RPageSourceFriends.hxx>

Inheritance diagram for ROOT::Experimental::Detail::RPageSourceFriends:
[legend]

Constructor & Destructor Documentation

◆ RPageSourceFriends()

ROOT::Experimental::Detail::RPageSourceFriends::RPageSourceFriends ( std::string_view  ntupleName,
std::span< std::unique_ptr< RPageSource > >  sources 
)

Definition at line 24 of file RPageSourceFriends.cxx.

◆ ~RPageSourceFriends()

ROOT::Experimental::Detail::RPageSourceFriends::~RPageSourceFriends ( )
finaldefault

Member Function Documentation

◆ AddColumn()

ROOT::Experimental::Detail::RPageStorage::ColumnHandle_t ROOT::Experimental::Detail::RPageSourceFriends::AddColumn ( DescriptorId_t  fieldId,
const RColumn column 
)
finalvirtual

Register a new column.

When reading, the column must exist in the ntuple on disk corresponding to the meta-data. When writing, every column can only be attached once.

Reimplemented from ROOT::Experimental::Detail::RPageSource.

Definition at line 128 of file RPageSourceFriends.cxx.

◆ AddVirtualField()

void ROOT::Experimental::Detail::RPageSourceFriends::AddVirtualField ( std::size_t  originIdx,
const RFieldDescriptor originField,
DescriptorId_t  virtualParent,
const std::string &  virtualName 
)
private

Definition at line 38 of file RPageSourceFriends.cxx.

◆ AttachImpl()

ROOT::Experimental::RNTupleDescriptor ROOT::Experimental::Detail::RPageSourceFriends::AttachImpl ( )
finalprotectedvirtual

Implements ROOT::Experimental::Detail::RPageSource.

Definition at line 65 of file RPageSourceFriends.cxx.

◆ Clone()

std::unique_ptr< ROOT::Experimental::Detail::RPageSource > ROOT::Experimental::Detail::RPageSourceFriends::Clone ( ) const
finalvirtual

Open the same storage multiple time, e.g. for reading in multiple threads.

Implements ROOT::Experimental::Detail::RPageSource.

Definition at line 118 of file RPageSourceFriends.cxx.

◆ DropColumn()

void ROOT::Experimental::Detail::RPageSourceFriends::DropColumn ( ColumnHandle_t  columnHandle)
finalvirtual

Unregisters a column.

A page source decreases the reference counter for the corresponding active column. For a page sink, dropping columns is currently a no-op.

Reimplemented from ROOT::Experimental::Detail::RPageSource.

Definition at line 135 of file RPageSourceFriends.cxx.

◆ GetMetrics()

RNTupleMetrics & ROOT::Experimental::Detail::RPageSourceFriends::GetMetrics ( )
inlinefinalvirtual

Returns the default metrics object. Subclasses might alternatively override the method and provide their own metrics object.

Reimplemented from ROOT::Experimental::Detail::RPageSource.

Definition at line 108 of file RPageSourceFriends.hxx.

◆ LoadClusters()

std::vector< std::unique_ptr< ROOT::Experimental::Detail::RCluster > > ROOT::Experimental::Detail::RPageSourceFriends::LoadClusters ( std::span< RCluster::RKey clusterKeys)
finalvirtual

Populates all the pages of the given cluster ids and columns; it is possible that some columns do not contain any pages.

The page source may load more columns than the minimal necessary set from columns. To indicate which columns have been loaded, LoadClusters() must mark them with SetColumnAvailable(). That includes the ones from the columns that don't have pages; otherwise subsequent requests for the cluster would assume an incomplete cluster and trigger loading again. LoadClusters() is typically called from the I/O thread of a cluster pool, i.e. the method runs concurrently to other methods of the page source.

Implements ROOT::Experimental::Detail::RPageSource.

Definition at line 201 of file RPageSourceFriends.cxx.

◆ LoadSealedPage()

void ROOT::Experimental::Detail::RPageSourceFriends::LoadSealedPage ( DescriptorId_t  columnId,
const RClusterIndex clusterIndex,
RSealedPage sealedPage 
)
finalvirtual

Read the packed and compressed bytes of a page into the memory buffer provided by selaedPage.

The sealed page can be used subsequently in a call to RPageSink::CommitSealedPage. The fSize and fNElements member of the sealedPage parameters are always set. If sealedPage.fBuffer is nullptr, no data will be copied but the returned size information can be used by the caller to allocate a large enough buffer and call LoadSealedPage again.

Implements ROOT::Experimental::Detail::RPageSource.

Definition at line 179 of file RPageSourceFriends.cxx.

◆ PopulatePage() [1/2]

ROOT::Experimental::Detail::RPage ROOT::Experimental::Detail::RPageSourceFriends::PopulatePage ( ColumnHandle_t  columnHandle,
const RClusterIndex clusterIndex 
)
finalvirtual

Another version of PopulatePage that allows to specify cluster-relative indexes.

Implements ROOT::Experimental::Detail::RPageSource.

Definition at line 162 of file RPageSourceFriends.cxx.

◆ PopulatePage() [2/2]

ROOT::Experimental::Detail::RPage ROOT::Experimental::Detail::RPageSourceFriends::PopulatePage ( ColumnHandle_t  columnHandle,
NTupleSize_t  globalIndex 
)
finalvirtual

Allocates and fills a page that contains the index-th element.

Implements ROOT::Experimental::Detail::RPageSource.

Definition at line 145 of file RPageSourceFriends.cxx.

◆ ReleasePage()

void ROOT::Experimental::Detail::RPageSourceFriends::ReleasePage ( RPage page)
finalvirtual

Every page store needs to be able to free pages it handed out.

But Sinks and sources have different means of allocating pages.

Implements ROOT::Experimental::Detail::RPageStorage.

Definition at line 191 of file RPageSourceFriends.cxx.

Member Data Documentation

◆ fBuilder

RNTupleDescriptorBuilder ROOT::Experimental::Detail::RPageSourceFriends::fBuilder
private

Definition at line 80 of file RPageSourceFriends.hxx.

◆ fIdBiMap

RIdBiMap ROOT::Experimental::Detail::RPageSourceFriends::fIdBiMap
private

Definition at line 78 of file RPageSourceFriends.hxx.

◆ fMetrics

RNTupleMetrics ROOT::Experimental::Detail::RPageSourceFriends::fMetrics
private

Definition at line 76 of file RPageSourceFriends.hxx.

◆ fNextId

DescriptorId_t ROOT::Experimental::Detail::RPageSourceFriends::fNextId = 1
private

0 is reserved for the friend zero field

Definition at line 81 of file RPageSourceFriends.hxx.

◆ fSources

std::vector<std::unique_ptr<RPageSource> > ROOT::Experimental::Detail::RPageSourceFriends::fSources
private

Definition at line 77 of file RPageSourceFriends.hxx.

Libraries for ROOT::Experimental::Detail::RPageSourceFriends:

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