libfoedus-core
FOEDUS Core Library
|
Pimpl object of Engine. More...
Pimpl object of Engine.
A private pimpl object for Engine. Do not include this header from a client program unless you know what you are doing.
Definition at line 52 of file engine_pimpl.hpp.
#include <engine_pimpl.hpp>
Classes | |
struct | ModulePtr |
pair of module pointer and its type. More... | |
Public Member Functions | |
EnginePimpl ()=delete | |
EnginePimpl (Engine *engine, const EngineOptions &options) | |
EnginePimpl (Engine *engine, EngineType type, soc::Upid master_upid, Eid master_eid, soc::SocId soc_id) | |
bool | is_master () const |
ErrorStack | initialize_once () override |
ErrorStack | initialize_modules () |
ErrorStack | uninitialize_once () override |
ErrorStack | check_valid_options () |
void | on_module_initialized (ModuleType module) |
Called whenever each module has completed its initialization. More... | |
void | on_module_uninitialized (ModuleType module) |
Called whenever each module has completed its uninitialization. More... | |
std::vector< ModulePtr > | get_modules () |
Returns in initialization order. More... | |
std::string | describe_short () const |
![]() | |
DefaultInitializable () | |
virtual | ~DefaultInitializable () |
DefaultInitializable (const DefaultInitializable &)=delete | |
DefaultInitializable & | operator= (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... | |
![]() | |
virtual | ~Initializable () |
Public Attributes | |
EngineOptions | options_ |
Options given at boot time. More... | |
Engine *const | engine_ |
Pointer to the enclosing object. More... | |
const EngineType | type_ |
const soc::Upid | master_upid_ |
const Eid | master_eid_ |
const soc::SocId | soc_id_ |
soc::SocManager | soc_manager_ |
SOC manager. More... | |
debugging::DebuggingSupports | debug_ |
Debugging supports. More... | |
proc::ProcManager | proc_manager_ |
memory::EngineMemory | memory_manager_ |
savepoint::SavepointManager | savepoint_manager_ |
thread::ThreadPool | thread_pool_ |
log::LogManager | log_manager_ |
snapshot::SnapshotManager | snapshot_manager_ |
cache::CacheManager | cache_manager_ |
storage::StorageManager | storage_manager_ |
xct::XctManager | xct_manager_ |
restart::RestartManager | restart_manager_ |
|
delete |
foedus::EnginePimpl::EnginePimpl | ( | Engine * | engine, |
const EngineOptions & | options | ||
) |
Definition at line 40 of file engine_pimpl.cpp.
foedus::EnginePimpl::EnginePimpl | ( | Engine * | engine, |
EngineType | type, | ||
soc::Upid | master_upid, | ||
Eid | master_eid, | ||
soc::SocId | soc_id | ||
) |
Definition at line 63 of file engine_pimpl.cpp.
ErrorStack foedus::EnginePimpl::check_valid_options | ( | ) |
Definition at line 213 of file engine_pimpl.cpp.
References CHECK_ERROR, foedus::kRetOk, options_, and foedus::EngineOptions::prescreen().
Referenced by initialize_once().
std::string foedus::EnginePimpl::describe_short | ( | ) | const |
Definition at line 88 of file engine_pimpl.cpp.
References foedus::kMaster, soc_id_, and type_.
Referenced by foedus::Engine::describe_short(), initialize_once(), and uninitialize_once().
|
inline |
Returns in initialization order.
Definition at line 127 of file engine_pimpl.hpp.
References foedus::kCache, foedus::kDebug, foedus::kLog, foedus::kMemory, foedus::kProc, foedus::kRestart, foedus::kSavepoint, foedus::kSnapshot, foedus::kStorage, foedus::kThread, and foedus::kXct.
Referenced by initialize_modules(), and uninitialize_once().
ErrorStack foedus::EnginePimpl::initialize_modules | ( | ) |
Definition at line 162 of file engine_pimpl.cpp.
References ASSERT_ND, CHECK_ERROR, get_modules(), foedus::soc::SocManager::is_initialized(), is_master(), foedus::kRetOk, on_module_initialized(), soc_manager_, foedus::soc::SocManager::wait_for_children_module(), and foedus::soc::SocManager::wait_for_master_module().
Referenced by initialize_once().
|
overridevirtual |
Implements foedus::DefaultInitializable.
Definition at line 96 of file engine_pimpl.cpp.
References foedus::soc::SharedMemoryRepo::change_master_status(), CHECK_ERROR, check_valid_options(), foedus::soc::NodeMemoryAnchors::child_status_memory_, describe_short(), engine_, ERROR_STACK, foedus::soc::SharedMemoryRepo::get_node_memory_anchors(), foedus::Engine::get_options(), foedus::soc::SocManager::get_shared_memory_repo(), foedus::thread::ThreadOptions::group_count_, foedus::soc::SocManager::initialize(), initialize_modules(), foedus::ErrorStack::is_error(), is_master(), foedus::kErrorCodeSocChildInitFailed, foedus::soc::ChildEngineStatus::kFatalError, foedus::kRetOk, foedus::soc::MasterEngineStatus::kRunning, foedus::soc::ChildEngineStatus::kRunning, foedus::kSoc, foedus::assorted::memory_fence_acq_rel(), on_module_initialized(), foedus::soc::SocManager::report_engine_fatal_error(), soc_manager_, foedus::fs::status(), foedus::soc::ChildEngineStatus::status_code_, and foedus::EngineOptions::thread_.
|
inline |
Definition at line 71 of file engine_pimpl.hpp.
References foedus::kMaster, and type_.
Referenced by initialize_modules(), initialize_once(), on_module_initialized(), on_module_uninitialized(), and uninitialize_once().
void foedus::EnginePimpl::on_module_initialized | ( | ModuleType | module | ) |
Called whenever each module has completed its initialization.
Definition at line 261 of file engine_pimpl.cpp.
References foedus::soc::MasterEngineStatus::change_init_atomic(), foedus::soc::ChildEngineStatus::change_init_atomic(), foedus::soc::NodeMemoryAnchors::child_status_memory_, foedus::soc::SharedMemoryRepo::get_global_memory_anchors(), foedus::soc::SharedMemoryRepo::get_node_memory_anchors(), foedus::soc::SocManager::get_shared_memory_repo(), is_master(), foedus::soc::GlobalMemoryAnchors::master_status_memory_, soc_id_, and soc_manager_.
Referenced by initialize_modules(), and initialize_once().
void foedus::EnginePimpl::on_module_uninitialized | ( | ModuleType | module | ) |
Called whenever each module has completed its uninitialization.
Definition at line 270 of file engine_pimpl.cpp.
References foedus::soc::MasterEngineStatus::change_uninit_atomic(), foedus::soc::ChildEngineStatus::change_uninit_atomic(), foedus::soc::NodeMemoryAnchors::child_status_memory_, foedus::soc::SharedMemoryRepo::get_global_memory_anchors(), foedus::soc::SharedMemoryRepo::get_node_memory_anchors(), foedus::soc::SocManager::get_shared_memory_repo(), is_master(), foedus::soc::GlobalMemoryAnchors::master_status_memory_, soc_id_, and soc_manager_.
Referenced by uninitialize_once().
|
overridevirtual |
Implements foedus::DefaultInitializable.
Definition at line 178 of file engine_pimpl.cpp.
References foedus::soc::SharedMemoryRepo::change_master_status(), describe_short(), foedus::ErrorStackBatch::emprace_back(), get_modules(), foedus::soc::SocManager::get_shared_memory_repo(), foedus::soc::SocManager::is_initialized(), is_master(), foedus::soc::MasterEngineStatus::kWaitingForChildTerminate, on_module_uninitialized(), soc_manager_, SUMMARIZE_ERROR_BATCH, foedus::soc::SocManager::uninitialize(), foedus::soc::SocManager::wait_for_children_module(), and foedus::soc::SocManager::wait_for_master_module().
cache::CacheManager foedus::EnginePimpl::cache_manager_ |
Definition at line 121 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_cache_manager().
debugging::DebuggingSupports foedus::EnginePimpl::debug_ |
Debugging supports.
Definition at line 114 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_debug().
Engine* const foedus::EnginePimpl::engine_ |
Pointer to the enclosing object.
Few places would need it, but hold it in case.
Definition at line 86 of file engine_pimpl.hpp.
Referenced by initialize_once().
log::LogManager foedus::EnginePimpl::log_manager_ |
Definition at line 119 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_durable_global_epoch(), and foedus::Engine::get_log_manager().
const Eid foedus::EnginePimpl::master_eid_ |
Definition at line 90 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_master_eid().
const soc::Upid foedus::EnginePimpl::master_upid_ |
Definition at line 89 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_master_upid().
memory::EngineMemory foedus::EnginePimpl::memory_manager_ |
Definition at line 116 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_memory_manager().
EngineOptions foedus::EnginePimpl::options_ |
Options given at boot time.
Immutable once launched
Definition at line 83 of file engine_pimpl.hpp.
Referenced by check_valid_options(), foedus::Engine::get_nonconst_options(), foedus::Engine::get_options(), and foedus::Engine::get_soc_count().
proc::ProcManager foedus::EnginePimpl::proc_manager_ |
Definition at line 115 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_proc_manager().
restart::RestartManager foedus::EnginePimpl::restart_manager_ |
Definition at line 124 of file engine_pimpl.hpp.
savepoint::SavepointManager foedus::EnginePimpl::savepoint_manager_ |
Definition at line 117 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_earliest_epoch(), and foedus::Engine::get_savepoint_manager().
snapshot::SnapshotManager foedus::EnginePimpl::snapshot_manager_ |
Definition at line 120 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_snapshot_manager().
const soc::SocId foedus::EnginePimpl::soc_id_ |
Definition at line 91 of file engine_pimpl.hpp.
Referenced by describe_short(), foedus::Engine::get_soc_id(), on_module_initialized(), and on_module_uninitialized().
soc::SocManager foedus::EnginePimpl::soc_manager_ |
SOC manager.
This is a quite special module that launches child SOC engines. We have to initialize this module before everything else, even before debug_ (glog 0.3.3 has an issue across fork(), see https://code.google.com/p/google-glog/issues/detail?id=101 https://code.google.com/p/google-glog/issues/detail?id=82 ).
Definition at line 105 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_soc_manager(), initialize_modules(), initialize_once(), on_module_initialized(), on_module_uninitialized(), and uninitialize_once().
storage::StorageManager foedus::EnginePimpl::storage_manager_ |
Definition at line 122 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_storage_manager().
thread::ThreadPool foedus::EnginePimpl::thread_pool_ |
Definition at line 118 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_thread_pool().
const EngineType foedus::EnginePimpl::type_ |
Definition at line 88 of file engine_pimpl.hpp.
Referenced by describe_short(), foedus::Engine::get_type(), foedus::Engine::is_emulated_child(), foedus::Engine::is_forked_child(), foedus::Engine::is_local_spawned_child(), is_master(), foedus::Engine::is_master(), and foedus::Engine::is_remote_spawned_child().
xct::XctManager foedus::EnginePimpl::xct_manager_ |
Definition at line 123 of file engine_pimpl.hpp.
Referenced by foedus::Engine::get_current_global_epoch(), foedus::Engine::get_current_grace_epoch(), and foedus::Engine::get_xct_manager().