Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Internal::RPagePool Class Reference

A thread-safe cache of pages loaded from the page source.

The page pool is used as a cache for pages loaded from a page source. In this way, identical page needed at the same time, only need to be loaded once. Page sources also use the page pool to stage (preload) pages unsealed by IMT tasks.

Definition at line 45 of file RPagePool.hxx.

Classes

struct  RPageInfo
 

Public Member Functions

 RPagePool ()=default
 
 RPagePool (const RPagePool &)=delete
 
 ~RPagePool ()=default
 
RPageRef GetPage (ColumnId_t columnId, std::type_index inMemoryType, NTupleSize_t globalIndex)
 Tries to find the page corresponding to column and index in the cache.
 
RPageRef GetPage (ColumnId_t columnId, std::type_index inMemoryType, RClusterIndex clusterIndex)
 
RPagePooloperator= (const RPagePool &)=delete
 
void PreloadPage (RPage page, std::type_index inMemoryType)
 Like RegisterPage() but the reference counter is initialized to 0.
 
RPageRef RegisterPage (RPage page, std::type_index inMemoryType)
 Adds a new page to the pool.
 

Private Member Functions

void ReleasePage (const RPage &page)
 Give back a page to the pool and decrease the reference counter.
 

Private Attributes

std::mutex fLock
 
std::vector< RPageInfofPageInfos
 
std::vector< RPagefPages
 TODO(jblomer): should be an efficient index structure that allows.
 
std::vector< std::int32_t > fReferences
 

Friends

class RPageRef
 

#include <ROOT/RPagePool.hxx>

Constructor & Destructor Documentation

◆ RPagePool() [1/2]

ROOT::Experimental::Internal::RPagePool::RPagePool ( )
default

◆ RPagePool() [2/2]

ROOT::Experimental::Internal::RPagePool::RPagePool ( const RPagePool & )
delete

◆ ~RPagePool()

ROOT::Experimental::Internal::RPagePool::~RPagePool ( )
default

Member Function Documentation

◆ GetPage() [1/2]

ROOT::Experimental::Internal::RPageRef ROOT::Experimental::Internal::RPagePool::GetPage ( ColumnId_t columnId,
std::type_index inMemoryType,
NTupleSize_t globalIndex )

Tries to find the page corresponding to column and index in the cache.

If the page is found, its reference counter is increased

Definition at line 64 of file RPagePool.cxx.

◆ GetPage() [2/2]

ROOT::Experimental::Internal::RPageRef ROOT::Experimental::Internal::RPagePool::GetPage ( ColumnId_t columnId,
std::type_index inMemoryType,
RClusterIndex clusterIndex )

Definition at line 82 of file RPagePool.cxx.

◆ operator=()

RPagePool & ROOT::Experimental::Internal::RPagePool::operator= ( const RPagePool & )
delete

◆ PreloadPage()

void ROOT::Experimental::Internal::RPagePool::PreloadPage ( RPage page,
std::type_index inMemoryType )

Like RegisterPage() but the reference counter is initialized to 0.

Definition at line 34 of file RPagePool.cxx.

◆ RegisterPage()

ROOT::Experimental::Internal::RPageRef ROOT::Experimental::Internal::RPagePool::RegisterPage ( RPage page,
std::type_index inMemoryType )

Adds a new page to the pool.

Upon registration, the page pool takes ownership of the page's memory. The new page has its reference counter set to 1.

Definition at line 25 of file RPagePool.cxx.

◆ ReleasePage()

void ROOT::Experimental::Internal::RPagePool::ReleasePage ( const RPage & page)
private

Give back a page to the pool and decrease the reference counter.

There must not be any pointers anymore into this page. If the reference counter drops to zero, the page pool might decide to call the deleter given in during registration. Called by the RPageRef destructor.

Definition at line 42 of file RPagePool.cxx.

Friends And Related Symbol Documentation

◆ RPageRef

friend class RPageRef
friend

Definition at line 46 of file RPagePool.hxx.

Member Data Documentation

◆ fLock

std::mutex ROOT::Experimental::Internal::RPagePool::fLock
private

Definition at line 60 of file RPagePool.hxx.

◆ fPageInfos

std::vector<RPageInfo> ROOT::Experimental::Internal::RPagePool::fPageInfos
private

Definition at line 58 of file RPagePool.hxx.

◆ fPages

std::vector<RPage> ROOT::Experimental::Internal::RPagePool::fPages
private

TODO(jblomer): should be an efficient index structure that allows.

  • random insert
  • random delete
  • searching by page

Definition at line 57 of file RPagePool.hxx.

◆ fReferences

std::vector<std::int32_t> ROOT::Experimental::Internal::RPagePool::fReferences
private

Definition at line 59 of file RPagePool.hxx.

Libraries for ROOT::Experimental::Internal::RPagePool:

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