Raft log append test

This commit is contained in:
Pavel Kirienko
2015-05-08 17:32:22 +03:00
parent dab32220e0
commit 1d7e83bd71
3 changed files with 28 additions and 2 deletions
@@ -611,6 +611,11 @@ public:
*/
int init(uint8_t cluster_size = ClusterManager::ClusterSizeUnknown);
/**
* This function is mostly needed for testing.
*/
Log::Index getCommitIndex() const { return commit_index_; }
/**
* Only the leader can call @ref appendLog().
*/
@@ -621,7 +626,7 @@ public:
* Failures are tolerble because all operations are idempotent.
* This method will trigger an assertion failure and return error if the current node is not the leader.
*/
int appendLog(const Entry& entry);
int appendLog(const Entry::FieldTypes::unique_id& unique_id, NodeID node_id);
/**
* This class is used to perform log searches.