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 43 of file RPagePool.hxx.
Public Member Functions | |
RPagePool ()=default | |
RPagePool (const RPagePool &)=delete | |
~RPagePool ()=default | |
RPageRef | GetPage (ColumnId_t columnId, NTupleSize_t globalIndex) |
Tries to find the page corresponding to column and index in the cache. | |
RPageRef | GetPage (ColumnId_t columnId, RClusterIndex clusterIndex) |
RPagePool & | operator= (const RPagePool &)=delete |
void | PreloadPage (RPage page) |
Like RegisterPage() but the reference counter is initialized to 0. | |
RPageRef | RegisterPage (RPage page) |
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< RPage > | fPages |
TODO(jblomer): should be an efficient index structure that allows. | |
std::vector< std::int32_t > | fReferences |
Friends | |
class | RPageRef |
#include <ROOT/RPagePool.hxx>
|
default |
|
delete |
|
default |
ROOT::Experimental::Internal::RPageRef ROOT::Experimental::Internal::RPagePool::GetPage | ( | ColumnId_t | columnId, |
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 60 of file RPagePool.cxx.
ROOT::Experimental::Internal::RPageRef ROOT::Experimental::Internal::RPagePool::GetPage | ( | ColumnId_t | columnId, |
RClusterIndex | clusterIndex | ||
) |
Definition at line 75 of file RPagePool.cxx.
void ROOT::Experimental::Internal::RPagePool::PreloadPage | ( | RPage | page | ) |
Like RegisterPage() but the reference counter is initialized to 0.
Definition at line 32 of file RPagePool.cxx.
ROOT::Experimental::Internal::RPageRef ROOT::Experimental::Internal::RPagePool::RegisterPage | ( | RPage | page | ) |
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 24 of file RPagePool.cxx.
|
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 39 of file RPagePool.cxx.
|
friend |
Definition at line 44 of file RPagePool.hxx.
|
private |
Definition at line 52 of file RPagePool.hxx.
|
private |
TODO(jblomer): should be an efficient index structure that allows.
Definition at line 50 of file RPagePool.hxx.
|
private |
Definition at line 51 of file RPagePool.hxx.