MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
mrs::ResponseCache Class Reference

#include <response_cache.h>

Public Member Functions

 ResponseCache (const std::string &config_key)
 
void configure (const std::string &options)
 
size_t max_cache_size () const
 

Private Member Functions

void push (std::shared_ptr< CacheEntry > entry)
 
void remove (std::shared_ptr< CacheEntry > entry)
 
void remove_nolock (std::shared_ptr< CacheEntry > entry)
 
int remove_all (EndpointResponseCache *cache)
 
void shrink_object_cache (size_t extra_size=0)
 

Private Attributes

std::string config_key_
 
std::shared_ptr< CacheEntrynewest_entry_
 
std::shared_ptr< CacheEntryoldest_entry_
 
std::mutex entries_mutex_
 
std::atomic< size_t > cache_size_ = 0
 
std::atomic< size_t > max_size_ = k_default_object_cache_size
 

Friends

class EndpointResponseCache
 
class ItemEndpointResponseCache
 
class FileEndpointResponseCache
 

Constructor & Destructor Documentation

◆ ResponseCache()

mrs::ResponseCache::ResponseCache ( const std::string &  config_key)
inlineexplicit

Member Function Documentation

◆ configure()

void mrs::ResponseCache::configure ( const std::string &  options)

◆ max_cache_size()

size_t mrs::ResponseCache::max_cache_size ( ) const
inline

◆ push()

void mrs::ResponseCache::push ( std::shared_ptr< CacheEntry entry)
private

◆ remove()

void mrs::ResponseCache::remove ( std::shared_ptr< CacheEntry entry)
private

◆ remove_all()

int mrs::ResponseCache::remove_all ( EndpointResponseCache cache)
private

◆ remove_nolock()

void mrs::ResponseCache::remove_nolock ( std::shared_ptr< CacheEntry entry)
private

◆ shrink_object_cache()

void mrs::ResponseCache::shrink_object_cache ( size_t  extra_size = 0)
private

Friends And Related Function Documentation

◆ EndpointResponseCache

friend class EndpointResponseCache
friend

◆ FileEndpointResponseCache

friend class FileEndpointResponseCache
friend

◆ ItemEndpointResponseCache

friend class ItemEndpointResponseCache
friend

Member Data Documentation

◆ cache_size_

std::atomic<size_t> mrs::ResponseCache::cache_size_ = 0
private

◆ config_key_

std::string mrs::ResponseCache::config_key_
private

◆ entries_mutex_

std::mutex mrs::ResponseCache::entries_mutex_
private

◆ max_size_

std::atomic<size_t> mrs::ResponseCache::max_size_ = k_default_object_cache_size
private

◆ newest_entry_

std::shared_ptr<CacheEntry> mrs::ResponseCache::newest_entry_
private

◆ oldest_entry_

std::shared_ptr<CacheEntry> mrs::ResponseCache::oldest_entry_
private

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