MySQL 9.0.0
Source Code Documentation
Btree_multi::Bulk_extent_allocator::Extent_cache Struct Reference

Public Member Functions

void init (size_t max_range)
 Initialize cache. More...
 
bool is_empty () const
 
bool is_full () const
 
bool check (size_t &num_alloc, size_t &num_free) const
 Check for number of extents to be allocated and cached. More...
 
bool get_range (Page_range_t &range, bool &alloc_trigger)
 Get one page range from the cache. More...
 
void set_range (size_t index, Page_range_t &range)
 Set allocated range(extent) in cache. More...
 

Public Attributes

std::array< Page_range_t, S_MAX_RANGESm_ranges
 Cached page ranges already allocated to the segment. More...
 
size_t m_max_range = S_MAX_RANGES
 Maximum number of ranges to pre-allocate. More...
 
std::atomic< size_t > m_num_allocated {0}
 Total number of ranges allocated. More...
 
std::atomic< size_t > m_num_consumed {0}
 Total number of ranges allocated. More...
 

Member Function Documentation

◆ check()

bool Btree_multi::Bulk_extent_allocator::Extent_cache::check ( size_t &  num_alloc,
size_t &  num_free 
) const

Check for number of extents to be allocated and cached.

Parameters
[out]num_allocnumber of extents to allocate
[out]num_freenumber of free extents
Returns
true if succesful.

◆ get_range()

bool Btree_multi::Bulk_extent_allocator::Extent_cache::get_range ( Page_range_t range,
bool &  alloc_trigger 
)

Get one page range from the cache.

Parameters
[out]rangethe allocated page range
[out]alloc_triggertrue, if need to trigger allocator
Returns
true if extent is successfully returned from cache.

◆ init()

void Btree_multi::Bulk_extent_allocator::Extent_cache::init ( size_t  max_range)

Initialize cache.

Parameters
[in]max_rangemaximum number of extents to cache.

◆ is_empty()

bool Btree_multi::Bulk_extent_allocator::Extent_cache::is_empty ( void  ) const
inline
Returns
true if no available extent to consume.

◆ is_full()

bool Btree_multi::Bulk_extent_allocator::Extent_cache::is_full ( ) const
inline
Returns
true if cache is full and no more extents can be added.

◆ set_range()

void Btree_multi::Bulk_extent_allocator::Extent_cache::set_range ( size_t  index,
Page_range_t range 
)

Set allocated range(extent) in cache.

Parameters
[in]indexposition of the range
[in]rangepage range to be set

Member Data Documentation

◆ m_max_range

size_t Btree_multi::Bulk_extent_allocator::Extent_cache::m_max_range = S_MAX_RANGES

Maximum number of ranges to pre-allocate.

◆ m_num_allocated

std::atomic<size_t> Btree_multi::Bulk_extent_allocator::Extent_cache::m_num_allocated {0}

Total number of ranges allocated.

◆ m_num_consumed

std::atomic<size_t> Btree_multi::Bulk_extent_allocator::Extent_cache::m_num_consumed {0}

Total number of ranges allocated.

◆ m_ranges

std::array<Page_range_t, S_MAX_RANGES> Btree_multi::Bulk_extent_allocator::Extent_cache::m_ranges

Cached page ranges already allocated to the segment.


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