26 std::lock_guard<std::mutex> lockGuard(
fLock);
27 fPages.emplace_back(std::move(page));
34 std::lock_guard<std::mutex> lockGuard(fLock);
35 fPages.emplace_back(std::move(page));
36 fReferences.emplace_back(0);
42 std::lock_guard<std::mutex> lockGuard(fLock);
44 unsigned int N = fPages.size();
45 for (
unsigned i = 0; i <
N; ++i) {
46 if (fPages[i] != page)
continue;
48 if (--fReferences[i] == 0) {
49 fPages[i] = std::move(fPages[
N - 1]);
50 fReferences[i] = fReferences[
N - 1];
52 fReferences.resize(
N - 1);
62 std::lock_guard<std::mutex> lockGuard(fLock);
63 unsigned int N = fPages.size();
64 for (
unsigned int i = 0; i <
N; ++i) {
65 if (fReferences[i] < 0)
continue;
66 if (fPages[i].GetColumnId() != columnId)
continue;
67 if (!fPages[i].Contains(globalIndex))
continue;
77 std::lock_guard<std::mutex> lockGuard(fLock);
78 unsigned int N = fPages.size();
79 for (
unsigned int i = 0; i <
N; ++i) {
80 if (fReferences[i] < 0)
continue;
81 if (fPages[i].GetColumnId() != columnId)
continue;
82 if (!fPages[i].Contains(clusterIndex))
continue;
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
std::vector< RPage > fPages
TODO(jblomer): should be an efficient index structure that allows.
RPageRef RegisterPage(RPage page)
Adds a new page to the pool.
RPageRef GetPage(ColumnId_t columnId, NTupleSize_t globalIndex)
Tries to find the page corresponding to column and index in the cache.
std::vector< std::int32_t > fReferences
void ReleasePage(const RPage &page)
Give back a page to the pool and decrease the reference counter.
void PreloadPage(RPage page)
Like RegisterPage() but the reference counter is initialized to 0.
A page is a slice of a column that is mapped into memory.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
std::int64_t ColumnId_t
Uniquely identifies a physical column within the scope of the current process, used to tag pages.