Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Detail::RPageSource Class Referenceabstract

Abstract interface to read data from an ntuple.

The page source is initialized with the columns of interest. Pages from those columns can then be mapped into memory. The page source also gives access to the ntuple's meta-data.

Definition at line 193 of file RPageStorage.hxx.

Public Types

using ColumnSet_t = std::unordered_set< DescriptorId_t >
 Derived from the model (fields) that are actually being requested at a given point in time.
 
- Public Types inherited from ROOT::Experimental::Detail::RPageStorage
using ColumnHandle_t = RColumnHandle
 The column handle identifies a column with the current open page storage.
 

Public Member Functions

 RPageSource (const RPageSource &)=delete
 
 RPageSource (RPageSource &&)=default
 
 RPageSource (std::string_view ntupleName, const RNTupleReadOptions &fOptions)
 
virtual ~RPageSource ()
 
ColumnHandle_t AddColumn (DescriptorId_t fieldId, const RColumn &column) final
 Register a new column.
 
void Attach ()
 Open the physical storage container for the tree.
 
virtual std::unique_ptr< RPageSourceClone () const =0
 Open the same storage multiple time, e.g. for reading in multiple threads.
 
void DropColumn (ColumnHandle_t columnHandle) final
 Unregisters a column.
 
ColumnId_t GetColumnId (ColumnHandle_t columnHandle)
 
const RNTupleDescriptorGetDescriptor () const
 
NTupleSize_t GetNElements (ColumnHandle_t columnHandle)
 
NTupleSize_t GetNEntries ()
 
EPageStorageType GetType () final
 Whether the concrete implementation is a sink or a source.
 
virtual std::unique_ptr< RClusterLoadCluster (DescriptorId_t clusterId, const ColumnSet_t &columns)=0
 Populates all the pages of the given cluster id and columns; it is possible that some columns do not contain any pages.
 
RPageSourceoperator= (const RPageSource &)=delete
 
RPageSourceoperator= (RPageSource &&)=default
 
virtual RPage PopulatePage (ColumnHandle_t columnHandle, const RClusterIndex &clusterIndex)=0
 Another version of PopulatePage that allows to specify cluster-relative indexes.
 
virtual RPage PopulatePage (ColumnHandle_t columnHandle, NTupleSize_t globalIndex)=0
 Allocates and fills a page that contains the index-th element.
 
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 ()
 
virtual RNTupleMetricsGetMetrics ()
 Returns an empty metrics. Page storage implementations usually have their own metrics.
 
RPageStorageoperator= (const RPageStorage &other)=delete
 
RPageStorageoperator= (RPageStorage &&other)=default
 
virtual void ReleasePage (RPage &page)=0
 Every page store needs to be able to free pages it handed out.
 
void SetTaskScheduler (RTaskScheduler *taskScheduler)
 

Static Public Member Functions

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 Member Functions

virtual RNTupleDescriptor AttachImpl ()=0
 
virtual void UnzipClusterImpl (RCluster *)
 

Protected Attributes

ColumnSet_t fActiveColumns
 The active columns are implicitly defined by the model fields or views.
 
RNTupleDescriptor fDescriptor
 
RNTupleReadOptions fOptions
 
- Protected Attributes inherited from ROOT::Experimental::Detail::RPageStorage
std::string fNTupleName
 
RTaskSchedulerfTaskScheduler = nullptr
 

#include <ROOT/RPageStorage.hxx>

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

Member Typedef Documentation

◆ ColumnSet_t

Derived from the model (fields) that are actually being requested at a given point in time.

Definition at line 196 of file RPageStorage.hxx.

Constructor & Destructor Documentation

◆ RPageSource() [1/3]

ROOT::Experimental::Detail::RPageSource::RPageSource ( std::string_view  ntupleName,
const RNTupleReadOptions fOptions 
)

Definition at line 52 of file RPageStorage.cxx.

◆ RPageSource() [2/3]

ROOT::Experimental::Detail::RPageSource::RPageSource ( const RPageSource )
delete

◆ RPageSource() [3/3]

ROOT::Experimental::Detail::RPageSource::RPageSource ( RPageSource &&  )
default

◆ ~RPageSource()

ROOT::Experimental::Detail::RPageSource::~RPageSource ( )
virtual

Definition at line 57 of file RPageStorage.cxx.

Member Function Documentation

◆ AddColumn()

ROOT::Experimental::Detail::RPageStorage::ColumnHandle_t ROOT::Experimental::Detail::RPageSource::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.

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

Definition at line 68 of file RPageStorage.cxx.

◆ Attach()

void ROOT::Experimental::Detail::RPageSource::Attach ( )
inline

Open the physical storage container for the tree.

Definition at line 228 of file RPageStorage.hxx.

◆ AttachImpl()

virtual RNTupleDescriptor ROOT::Experimental::Detail::RPageSource::AttachImpl ( )
protectedpure virtual

◆ Clone()

virtual std::unique_ptr< RPageSource > ROOT::Experimental::Detail::RPageSource::Clone ( ) const
pure virtual

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

Implemented in ROOT::Experimental::Detail::RPageSourceFile.

◆ Create()

std::unique_ptr< ROOT::Experimental::Detail::RPageSource > ROOT::Experimental::Detail::RPageSource::Create ( std::string_view  ntupleName,
std::string_view  location,
const RNTupleReadOptions options = RNTupleReadOptions() 
)
static

Guess the concrete derived page source from the file name (location)

Definition at line 61 of file RPageStorage.cxx.

◆ DropColumn()

void ROOT::Experimental::Detail::RPageSource::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.

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

Definition at line 77 of file RPageStorage.cxx.

◆ GetColumnId()

ROOT::Experimental::ColumnId_t ROOT::Experimental::Detail::RPageSource::GetColumnId ( ColumnHandle_t  columnHandle)

Definition at line 92 of file RPageStorage.cxx.

◆ GetDescriptor()

const RNTupleDescriptor & ROOT::Experimental::Detail::RPageSource::GetDescriptor ( ) const
inline

Definition at line 223 of file RPageStorage.hxx.

◆ GetNElements()

ROOT::Experimental::NTupleSize_t ROOT::Experimental::Detail::RPageSource::GetNElements ( ColumnHandle_t  columnHandle)

Definition at line 87 of file RPageStorage.cxx.

◆ GetNEntries()

ROOT::Experimental::NTupleSize_t ROOT::Experimental::Detail::RPageSource::GetNEntries ( )

Definition at line 82 of file RPageStorage.cxx.

◆ GetType()

EPageStorageType ROOT::Experimental::Detail::RPageSource::GetType ( )
inlinefinalvirtual

Whether the concrete implementation is a sink or a source.

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

Definition at line 222 of file RPageStorage.hxx.

◆ LoadCluster()

virtual std::unique_ptr< RCluster > ROOT::Experimental::Detail::RPageSource::LoadCluster ( DescriptorId_t  clusterId,
const ColumnSet_t columns 
)
pure virtual

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

The pages source may load more columns than the minimal necessary set from columns. To indicate which columns have been loaded, LoadCluster() 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. LoadCluster() 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.

Implemented in ROOT::Experimental::Detail::RPageSourceFile.

◆ operator=() [1/2]

RPageSource & ROOT::Experimental::Detail::RPageSource::operator= ( const RPageSource )
delete

◆ operator=() [2/2]

RPageSource & ROOT::Experimental::Detail::RPageSource::operator= ( RPageSource &&  )
default

◆ PopulatePage() [1/2]

virtual RPage ROOT::Experimental::Detail::RPageSource::PopulatePage ( ColumnHandle_t  columnHandle,
const RClusterIndex clusterIndex 
)
pure virtual

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

Implemented in ROOT::Experimental::Detail::RPageSourceFile.

◆ PopulatePage() [2/2]

virtual RPage ROOT::Experimental::Detail::RPageSource::PopulatePage ( ColumnHandle_t  columnHandle,
NTupleSize_t  globalIndex 
)
pure virtual

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

Implemented in ROOT::Experimental::Detail::RPageSourceFile.

◆ UnzipCluster()

void ROOT::Experimental::Detail::RPageSource::UnzipCluster ( RCluster cluster)

Parallel decompression and unpacking of the pages in the given cluster.

The unzipped pages are supposed to be preloaded in a page pool attached to the source. The method is triggered by the cluster pool's unzip thread. It is an optional optimization, the method can safely do nothing. In particular, the actual implementation will only run if a task scheduler is set. In practice, a task scheduler is set if implicit multi-threading is turned on.

Definition at line 98 of file RPageStorage.cxx.

◆ UnzipClusterImpl()

virtual void ROOT::Experimental::Detail::RPageSource::UnzipClusterImpl ( RCluster )
inlineprotectedvirtual

Reimplemented in ROOT::Experimental::Detail::RPageSourceFile.

Definition at line 206 of file RPageStorage.hxx.

Member Data Documentation

◆ fActiveColumns

ColumnSet_t ROOT::Experimental::Detail::RPageSource::fActiveColumns
protected

The active columns are implicitly defined by the model fields or views.

Definition at line 202 of file RPageStorage.hxx.

◆ fDescriptor

RNTupleDescriptor ROOT::Experimental::Detail::RPageSource::fDescriptor
protected

Definition at line 200 of file RPageStorage.hxx.

◆ fOptions

RNTupleReadOptions ROOT::Experimental::Detail::RPageSource::fOptions
protected

Definition at line 199 of file RPageStorage.hxx.

Libraries for ROOT::Experimental::Detail::RPageSource:

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