Logo ROOT   6.18/05
Reference Guide
List of all members | Public Member Functions | Private Attributes | List of all members
ROOT::Experimental::Detail::RPagePool Class Reference

A thread-safe cache of column pages.

The page pool encapsulated memory management for data written into a tree or read from a tree. Adding and removing pages is thread-safe. All pages have the same size, which means different pages do not necessarily contain the same number of elements. Multiple page caches can coexist.

TODO(jblomer): it should be possible to register pages and to find them by column and index; this would facilitate pre-filling a cache, e.g. by read-ahead.

Definition at line 46 of file RPagePool.hxx.

Public Member Functions

 RPagePool (const RPagePool &)=delete
 
 RPagePool (std::size_t pageSize, std::size_t nPages)
 
 ~RPagePool ()
 
void CommitPage (const RPage &page)
 Registers a page that has previously been acquired by ReservePage() and was meanwhile filled with content. More...
 
RPage GetPage (RColumn *column, NTupleSize_t index)
 Tries to find the page corresponding to column and index in the cache. More...
 
RPagePooloperator= (const RPagePool &)=delete
 
void ReleasePage (const RPage &page)
 Give back a page to the pool. There must not be any pointers anymore into this page. More...
 
RPage ReservePage (RColumn *column)
 Get a new, empty page from the cache. Return a "null Page" if there is no more free space. More...
 

Private Attributes

voidfMemory
 
std::size_t fNPages
 
std::vector< RPagefPages
 TODO(jblomer): should be an efficient index structure that allows. More...
 
std::size_t fPageSize
 
std::vector< std::uint32_t > fReferences
 

#include <ROOT/RPagePool.hxx>

Constructor & Destructor Documentation

◆ RPagePool() [1/2]

ROOT::Experimental::Detail::RPagePool::RPagePool ( std::size_t  pageSize,
std::size_t  nPages 
)

Definition at line 23 of file RPagePool.cxx.

◆ RPagePool() [2/2]

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

◆ ~RPagePool()

ROOT::Experimental::Detail::RPagePool::~RPagePool ( )

Definition at line 35 of file RPagePool.cxx.

Member Function Documentation

◆ CommitPage()

void ROOT::Experimental::Detail::RPagePool::CommitPage ( const RPage page)

Registers a page that has previously been acquired by ReservePage() and was meanwhile filled with content.

Definition at line 57 of file RPagePool.cxx.

◆ GetPage()

ROOT::Experimental::Detail::RPage ROOT::Experimental::Detail::RPagePool::GetPage ( RColumn column,
NTupleSize_t  index 
)

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

On cache miss, load the page from the PageSource attached to the column and put it in the cache.

Definition at line 82 of file RPagePool.cxx.

◆ operator=()

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

◆ ReleasePage()

void ROOT::Experimental::Detail::RPagePool::ReleasePage ( const RPage page)

Give back a page to the pool. There must not be any pointers anymore into this page.

Definition at line 68 of file RPagePool.cxx.

◆ ReservePage()

ROOT::Experimental::Detail::RPage ROOT::Experimental::Detail::RPagePool::ReservePage ( RColumn column)

Get a new, empty page from the cache. Return a "null Page" if there is no more free space.

Definition at line 41 of file RPagePool.cxx.

Member Data Documentation

◆ fMemory

void* ROOT::Experimental::Detail::RPagePool::fMemory
private

Definition at line 48 of file RPagePool.hxx.

◆ fNPages

std::size_t ROOT::Experimental::Detail::RPagePool::fNPages
private

Definition at line 50 of file RPagePool.hxx.

◆ fPages

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

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

  • random insert
  • random delete
  • searching by page
  • searching by tree index

Definition at line 56 of file RPagePool.hxx.

◆ fPageSize

std::size_t ROOT::Experimental::Detail::RPagePool::fPageSize
private

Definition at line 49 of file RPagePool.hxx.

◆ fReferences

std::vector<std::uint32_t> ROOT::Experimental::Detail::RPagePool::fReferences
private

Definition at line 57 of file RPagePool.hxx.


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