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) |
RPagePool & | operator= (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< RPageInfo > | fPageInfos |
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, |
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.
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.
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.
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.
|
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.
Definition at line 46 of file RPagePool.hxx.
|
private |
Definition at line 60 of file RPagePool.hxx.
|
private |
Definition at line 58 of file RPagePool.hxx.
|
private |
TODO(jblomer): should be an efficient index structure that allows.
Definition at line 57 of file RPagePool.hxx.
|
private |
Definition at line 59 of file RPagePool.hxx.