Revision 85b6ed25 include/RaftManager.h
include/RaftManager.h | ||
---|---|---|
21 | 21 |
#include "ReplicaManager.h" |
22 | 22 |
#include "ReplicaRequest.h" |
23 | 23 |
#include "Template.h" |
24 |
#include "RaftHook.h" |
|
24 | 25 |
|
25 | 26 |
extern "C" void * raft_manager_loop(void *arg); |
26 | 27 |
|
... | ... | |
43 | 44 |
/** |
44 | 45 |
* Raft manager constructor |
45 | 46 |
* @param server_id of this server |
47 |
* @param leader_hook_mad to be executed when follower->leader |
|
48 |
* @param follower_hook_mad to be executed when leader->follower |
|
46 | 49 |
* @param log_purge period to purge logDB records |
47 | 50 |
* @param bcast heartbeat broadcast timeout |
48 | 51 |
* @param election timeout |
49 | 52 |
* @param xmlrpc timeout for RAFT related xmlrpc API calls |
50 | 53 |
**/ |
51 |
RaftManager(int server_id, time_t log_purge, long long bcast, |
|
52 |
long long election, time_t xmlrpc); |
|
54 |
RaftManager(int server_id, const VectorAttribute * leader_hook_mad, |
|
55 |
const VectorAttribute * follower_hook_mad, time_t log_purge, |
|
56 |
long long bcast, long long election, time_t xmlrpc, |
|
57 |
const string& remotes_location); |
|
53 | 58 |
|
54 |
virtual ~RaftManager(){}; |
|
59 |
~RaftManager() |
|
60 |
{ |
|
61 |
if ( leader_hook != 0 ) |
|
62 |
{ |
|
63 |
delete(leader_hook); |
|
64 |
} |
|
65 |
|
|
66 |
if ( follower_hook != 0 ) |
|
67 |
{ |
|
68 |
delete(follower_hook); |
|
69 |
} |
|
70 |
}; |
|
55 | 71 |
|
56 | 72 |
// ------------------------------------------------------------------------- |
57 | 73 |
// Raft associated actions (synchronous) |
... | ... | |
366 | 382 |
std::map<int, std::string> servers; |
367 | 383 |
|
368 | 384 |
// ------------------------------------------------------------------------- |
385 |
// Hooks |
|
386 |
// ------------------------------------------------------------------------- |
|
387 |
|
|
388 |
RaftLeaderHook * leader_hook; |
|
389 |
RaftFollowerHook * follower_hook; |
|
390 |
|
|
391 |
// ------------------------------------------------------------------------- |
|
369 | 392 |
// Action Listener interface |
370 | 393 |
// ------------------------------------------------------------------------- |
371 | 394 |
/** |
Also available in: Unified diff