userver: cache Namespace Reference
Loading...
Searching...
No Matches
cache Namespace Reference

Detailed Description

Utilities for caching.

Classes

class  CacheUpdateTrait
 Base class for periodically updated caches. More...
 
struct  Config
 
class  ConfigError
 
struct  ConfigPatch
 
class  DataError
 
class  EmptyCacheError
 
class  EmptyDataError
 
class  ExpirableLruCache
 Class for expirable LRU cache. Use cache::LruMap for not expirable LRU Cache. More...
 
class  LruCacheComponent
 Base class for LRU-cache components. More...
 
struct  LruCacheConfig
 
struct  LruCacheConfigStatic
 
class  LruCacheWrapper
 
class  LruMap
 
class  LruSet
 
class  NWayLRU
 
class  UpdateStatisticsScope
 Allows a specific cache to fill cache statistics during an Update. More...
 
class  UpdateStatisticsScopeMock
 Allows to test helper functions of CacheUpdateTrait::Update that use UpdateStatisticsScope. More...
 

Enumerations

enum class  FirstUpdateMode {
  kRequired ,
  kBestEffort ,
  kSkip
}
 
enum class  FirstUpdateType {
  kFull ,
  kIncremental ,
  kIncrementalThenAsyncFull
}
 
enum class  BackgroundUpdateMode {
  kEnabled ,
  kDisabled
}
 
enum class  UpdateType {
  kFull ,
  kIncremental
}
 Type of CachingComponentBase update. More...
 
enum class  AllowedUpdateTypes {
  kFullAndIncremental ,
  kOnlyFull ,
  kOnlyIncremental
}
 Update types allowed for a CachingComponentBase instance by static config. More...
 

Functions

FirstUpdateMode Parse (const yaml_config::YamlConfig &config, formats::parse::To< FirstUpdateMode >)
 
std::string_view ToString (FirstUpdateMode)
 
FirstUpdateType Parse (const yaml_config::YamlConfig &config, formats::parse::To< FirstUpdateType >)
 
std::string_view ToString (FirstUpdateType)
 
ConfigPatch Parse (const formats::json::Value &value, formats::parse::To< ConfigPatch >)
 
template<typename Key , typename Value , typename Hash , typename Equal >
void DumpMetric (utils::statistics::Writer &writer, const ExpirableLruCache< Key, Value, Hash, Equal > &cache)
 
LruCacheConfig Parse (const formats::json::Value &value, formats::parse::To< LruCacheConfig >)
 
std::optional< LruCacheConfigGetLruConfig (const dynamic_config::Snapshot &config, const std::string &cache_name)
 
UpdateType Parse (const formats::json::Value &value, formats::parse::To< UpdateType >)
 
std::string_view ToString (UpdateType update_type)
 
AllowedUpdateTypes Parse (const yaml_config::YamlConfig &value, formats::parse::To< AllowedUpdateTypes >)
 
std::string_view ToString (AllowedUpdateTypes allowed_update_types)
 

Variables

const dynamic_config::Key< std::unordered_map< std::string, ConfigPatch > > kCacheConfigSet
 
const dynamic_config::Key< std::unordered_map< std::string, LruCacheConfig > > kLruCacheConfigSet
 

Enumeration Type Documentation

◆ AllowedUpdateTypes

enum class cache::AllowedUpdateTypes
strong

Update types allowed for a CachingComponentBase instance by static config.

Definition at line 27 of file update_type.hpp.

◆ BackgroundUpdateMode

enum class cache::BackgroundUpdateMode
strong

Definition at line 17 of file lru_cache_config.hpp.

◆ FirstUpdateMode

enum class cache::FirstUpdateMode
strong

Definition at line 27 of file cache_config.hpp.

◆ FirstUpdateType

enum class cache::FirstUpdateType
strong

Definition at line 38 of file cache_config.hpp.

◆ UpdateType

enum class cache::UpdateType
strong

Type of CachingComponentBase update.

Enumerator
kFull 

requests all the items, starting from scratch

kIncremental 

requests only newly updated items

Definition at line 16 of file update_type.hpp.

Function Documentation

◆ DumpMetric()

template<typename Key , typename Value , typename Hash , typename Equal >
void cache::DumpMetric ( utils::statistics::Writer & writer,
const ExpirableLruCache< Key, Value, Hash, Equal > & cache )

Definition at line 441 of file expirable_lru_cache.hpp.