ROOT 6.18/05 Reference Guide |
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... | |
RPagePool & | operator= (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 | |
void * | fMemory |
std::size_t | fNPages |
std::vector< RPage > | fPages |
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>
ROOT::Experimental::Detail::RPagePool::RPagePool | ( | std::size_t | pageSize, |
std::size_t | nPages | ||
) |
Definition at line 23 of file RPagePool.cxx.
|
delete |
ROOT::Experimental::Detail::RPagePool::~RPagePool | ( | ) |
Definition at line 35 of file RPagePool.cxx.
Registers a page that has previously been acquired by ReservePage() and was meanwhile filled with content.
Definition at line 57 of file RPagePool.cxx.
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.
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.
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.
|
private |
Definition at line 48 of file RPagePool.hxx.
|
private |
Definition at line 50 of file RPagePool.hxx.
|
private |
TODO(jblomer): should be an efficient index structure that allows.
Definition at line 56 of file RPagePool.hxx.
|
private |
Definition at line 49 of file RPagePool.hxx.
|
private |
Definition at line 57 of file RPagePool.hxx.