libfoedus-core
FOEDUS Core Library
foedus::cache::CacheManager Class Reference

Snapshot cache manager. More...

Detailed Description

Snapshot cache manager.

A snapshot cache manager exists in each SOC engine, maintaining their SOC-local snapshot cache. Everything is SOC-local, so actually a master engine does nothing here.

Definition at line 37 of file cache_manager.hpp.

#include <cache_manager.hpp>

Inheritance diagram for foedus::cache::CacheManager:
Collaboration diagram for foedus::cache::CacheManager:

Public Member Functions

 CacheManager ()=delete
 
 CacheManager (Engine *engine)
 
 ~CacheManager ()
 
ErrorStack initialize_once () override
 
ErrorStack uninitialize_once () override
 
const CacheOptionsget_options () const
 
std::string describe () const
 kind of to_string(). More...
 
ErrorStack stop_cleaner ()
 Stops internal eviction thread even before uninitialize() of this object is called. More...
 
- Public Member Functions inherited from foedus::DefaultInitializable
 DefaultInitializable ()
 
virtual ~DefaultInitializable ()
 
 DefaultInitializable (const DefaultInitializable &)=delete
 
DefaultInitializableoperator= (const DefaultInitializable &)=delete
 
ErrorStack initialize () override final
 Typical implementation of Initializable::initialize() that provides initialize-once semantics. More...
 
ErrorStack uninitialize () override final
 Typical implementation of Initializable::uninitialize() that provides uninitialize-once semantics. More...
 
bool is_initialized () const override final
 Returns whether the object has been already initialized or not. More...
 
- Public Member Functions inherited from foedus::Initializable
virtual ~Initializable ()
 

Constructor & Destructor Documentation

foedus::cache::CacheManager::CacheManager ( )
delete
foedus::cache::CacheManager::CacheManager ( Engine engine)
explicit

Definition at line 27 of file cache_manager.cpp.

27  : pimpl_(nullptr) {
28  pimpl_ = new CacheManagerPimpl(engine);
29 }
foedus::cache::CacheManager::~CacheManager ( )

Definition at line 30 of file cache_manager.cpp.

30  {
31  delete pimpl_;
32  pimpl_ = nullptr;
33 }

Member Function Documentation

std::string foedus::cache::CacheManager::describe ( ) const

kind of to_string().

this might be slow, so do not call too often

Definition at line 37 of file cache_manager.cpp.

References foedus::cache::CacheManagerPimpl::describe().

37 { return pimpl_->describe(); }

Here is the call graph for this function:

const CacheOptions& foedus::cache::CacheManager::get_options ( ) const
ErrorStack foedus::cache::CacheManager::initialize_once ( )
overridevirtual

Implements foedus::DefaultInitializable.

Definition at line 35 of file cache_manager.cpp.

References foedus::cache::CacheManagerPimpl::initialize_once().

35 { return pimpl_->initialize_once(); }

Here is the call graph for this function:

ErrorStack foedus::cache::CacheManager::stop_cleaner ( )

Stops internal eviction thread even before uninitialize() of this object is called.

It is also automatically called from uninitialize(). Currently, this is used to avoid the race condition between XctManager's uninitialize() and this object's uninitialize(). Here is why: The cache cleaner depends on XctManager because the eviction is based on epochs. However, XctManager will be uninitialized before cache manager. If XctManager gets uninitialized while cleaner is processing, we'll get a trouble. To avoid that, XctManager's uninitialize() invokes stop_cleaner() once it finishes all transaction threads, meaning there will be no more new entries.

Definition at line 38 of file cache_manager.cpp.

References foedus::cache::CacheManagerPimpl::stop_cleaner().

Referenced by foedus::xct::XctManagerPimpl::uninitialize_once().

38 { return pimpl_->stop_cleaner(); }

Here is the call graph for this function:

Here is the caller graph for this function:

ErrorStack foedus::cache::CacheManager::uninitialize_once ( )
overridevirtual

Implements foedus::DefaultInitializable.

Definition at line 36 of file cache_manager.cpp.

References foedus::cache::CacheManagerPimpl::uninitialize_once().

36 { return pimpl_->uninitialize_once(); }

Here is the call graph for this function:


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