Persistent storage implementation and tests

This commit is contained in:
Pavel Kirienko
2015-05-04 16:44:04 +03:00
parent 6a8135fedf
commit 1994260a2c
3 changed files with 266 additions and 13 deletions
@@ -152,7 +152,12 @@ public:
{ }
/**
* This method invokes storage IO.
* Initialization is performed as follows (every step may fail and return an error):
* 1. Log is restored or initialized.
* 2. Current term is restored. If there was no current term stored and the log is empty, it will be initialized
* with zero.
* 3. VotedFor value is restored. If there was no VotedFor value stored, the log is empty, and the current term is
* zero, the value will be initialized with zero.
*/
int init();