Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Internal::RWritePageMemoryManager Class Reference

Helper to maintain a memory budget for the write pages of a set of columns.

The memory manager keeps track of the sum of bytes used by the write pages of a set of columns. It will flush (and shrink) large pages of other columns on the attempt to expand a page.

Definition at line 212 of file RPageStorage.hxx.

Classes

struct  RColumnInfo
 

Public Member Functions

 RWritePageMemoryManager (std::size_t maxAllocatedBytes)
 
bool TryUpdate (RColumn &column, std::size_t newWritePageSize)
 Try to register the new write page size for the given column.
 

Private Member Functions

bool TryEvict (std::size_t targetAvailableSize, std::size_t pageSizeLimit)
 Flush columns in order of allocated write page size until the sum of all write page allocations leaves space for at least targetAvailableSize bytes.
 

Private Attributes

std::set< RColumnInfo, std::greater< RColumnInfo > > fColumnsSortedByPageSize
 All columns that called ReservePage() (hence TryUpdate()) at least once, sorted by their current write page size from large to small.
 
std::size_t fCurrentAllocatedBytes = 0
 Sum of all the write page sizes (their capacity) of the columns in fColumnsSortedByPageSize
 
std::size_t fMaxAllocatedBytes = 0
 Maximum allowed value for fCurrentAllocatedBytes, set from RNTupleWriteOptions::fPageBufferBudget.
 

#include <ROOT/RPageStorage.hxx>

Constructor & Destructor Documentation

◆ RWritePageMemoryManager()

ROOT::Experimental::Internal::RWritePageMemoryManager::RWritePageMemoryManager ( std::size_t  maxAllocatedBytes)
inlineexplicit

Definition at line 236 of file RPageStorage.hxx.

Member Function Documentation

◆ TryEvict()

bool ROOT::Experimental::Internal::RWritePageMemoryManager::TryEvict ( std::size_t  targetAvailableSize,
std::size_t  pageSizeLimit 
)
private

Flush columns in order of allocated write page size until the sum of all write page allocations leaves space for at least targetAvailableSize bytes.

Only use columns with a write page size larger than pageSizeLimit.

Definition at line 582 of file RPageStorage.cxx.

◆ TryUpdate()

bool ROOT::Experimental::Internal::RWritePageMemoryManager::TryUpdate ( RColumn column,
std::size_t  newWritePageSize 
)

Try to register the new write page size for the given column.

Flush large columns to make space, if necessary. If not enough space is available after all (sum of write pages would be larger than fMaxAllocatedBytes), return false.

Definition at line 616 of file RPageStorage.cxx.

Member Data Documentation

◆ fColumnsSortedByPageSize

std::set<RColumnInfo, std::greater<RColumnInfo> > ROOT::Experimental::Internal::RWritePageMemoryManager::fColumnsSortedByPageSize
private

All columns that called ReservePage() (hence TryUpdate()) at least once, sorted by their current write page size from large to small.

Definition at line 228 of file RPageStorage.hxx.

◆ fCurrentAllocatedBytes

std::size_t ROOT::Experimental::Internal::RWritePageMemoryManager::fCurrentAllocatedBytes = 0
private

Sum of all the write page sizes (their capacity) of the columns in fColumnsSortedByPageSize

Definition at line 223 of file RPageStorage.hxx.

◆ fMaxAllocatedBytes

std::size_t ROOT::Experimental::Internal::RWritePageMemoryManager::fMaxAllocatedBytes = 0
private

Maximum allowed value for fCurrentAllocatedBytes, set from RNTupleWriteOptions::fPageBufferBudget.

Definition at line 225 of file RPageStorage.hxx.

Libraries for ROOT::Experimental::Internal::RWritePageMemoryManager:

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