libfoedus-core
FOEDUS Core Library
foedus::restart::RestartManager Class Referencefinal

Restart manager, which recovers the state of database by invoking log-gleaner at start-up. More...

Detailed Description

Restart manager, which recovers the state of database by invoking log-gleaner at start-up.

Simplistic Restart
A DBMS usually has a complex ('sophisticated') restart routine especially if they try to reduce start-up time. On the other hand, FOEDUS simply invokes the log gleaner just like a periodic snapshot. This is a huge saving in code complexity. As far as we optimize the log gleaner, the start-up time is not slower than typical replay-every-log-style traditional restart, either.

Definition at line 36 of file restart_manager.hpp.

#include <restart_manager.hpp>

Inheritance diagram for foedus::restart::RestartManager:
Collaboration diagram for foedus::restart::RestartManager:

Public Member Functions

 RestartManager (Engine *engine)
 
 ~RestartManager ()
 
 RestartManager ()=delete
 
 RestartManager (const RestartManager &)=delete
 
RestartManageroperator= (const RestartManager &)=delete
 
ErrorStack initialize () override
 Acquires resources in this object, usually called right after constructor. More...
 
bool is_initialized () const override
 Returns whether the object has been already initialized or not. More...
 
ErrorStack uninitialize () override
 An idempotent method to release all resources of this object, if any. More...
 
- Public Member Functions inherited from foedus::Initializable
virtual ~Initializable ()
 

Constructor & Destructor Documentation

foedus::restart::RestartManager::RestartManager ( Engine engine)
explicit

Definition at line 22 of file restart_manager.cpp.

22  : pimpl_(nullptr) {
23  pimpl_ = new RestartManagerPimpl(engine);
24 }
foedus::restart::RestartManager::~RestartManager ( )

Definition at line 25 of file restart_manager.cpp.

25  {
26  delete pimpl_;
27  pimpl_ = nullptr;
28 }
foedus::restart::RestartManager::RestartManager ( )
delete
foedus::restart::RestartManager::RestartManager ( const RestartManager )
delete

Member Function Documentation

ErrorStack foedus::restart::RestartManager::initialize ( )
overridevirtual

Acquires resources in this object, usually called right after constructor.

Precondition
is_initialized() == FALSE

If and only if the return value was not an error, is_initialized() will return TRUE. This method is usually not idempotent, but some implementation can choose to be. In that case, the implementation class should clarify that it's idempotent. This method is responsible for releasing all acquired resources when initialization fails. This method itself is NOT thread-safe. Do not call this in a racy situation.

Implements foedus::Initializable.

Definition at line 30 of file restart_manager.cpp.

References foedus::DefaultInitializable::initialize().

30 { return pimpl_->initialize(); }
ErrorStack initialize() override final
Typical implementation of Initializable::initialize() that provides initialize-once semantics...

Here is the call graph for this function:

bool foedus::restart::RestartManager::is_initialized ( ) const
overridevirtual

Returns whether the object has been already initialized or not.

Implements foedus::Initializable.

Definition at line 31 of file restart_manager.cpp.

References foedus::DefaultInitializable::is_initialized().

31 { return pimpl_->is_initialized(); }
bool is_initialized() const override final
Returns whether the object has been already initialized or not.

Here is the call graph for this function:

RestartManager& foedus::restart::RestartManager::operator= ( const RestartManager )
delete
ErrorStack foedus::restart::RestartManager::uninitialize ( )
overridevirtual

An idempotent method to release all resources of this object, if any.

After this method, is_initialized() will return FALSE. Whether this method encounters an error or not, the implementation should make the best effort to release as many resources as possible. In other words, Do not leak all resources because of one issue. This method itself is NOT thread-safe. Do not call this in a racy situation.

Attention
This method is NOT automatically called from the destructor. This is due to the fundamental limitation in C++. Explicitly call this method as soon as you are done, checking the returned value. You can also use UninitializeGuard to ameliorate the issue, but it's not perfect.
Returns
The error this method encounters, if any. In case there are multiple errors while uninitialization, the implementation should use ErrorStackBatch to produce a batched ErrorStack object.

Implements foedus::Initializable.

Definition at line 32 of file restart_manager.cpp.

References foedus::DefaultInitializable::uninitialize().

32 { return pimpl_->uninitialize(); }
ErrorStack uninitialize() override final
Typical implementation of Initializable::uninitialize() that provides uninitialize-once semantics...

Here is the call graph for this function:


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