Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
547e6175
Commit
547e6175
authored
May 13, 2016
by
Willem Thiart
Browse files
Refactor: clean up raft.h comments
parent
7e2eba5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/raft.h
View file @
547e6175
...
...
@@ -186,7 +186,8 @@ typedef int (
* This triggers only when there are no pending configuration changes.
* @param[in] raft The Raft server making this callback
* @param[in] user_data User data that is passed from Raft server
* @param[in] node The node */
* @param[in] node The node
* @return 0 does not want to be notified again; otherwise -1 */
typedef
void
(
*
func_node_has_sufficient_logs_f
)
(
...
...
@@ -361,7 +362,7 @@ void raft_set_callbacks(raft_server_t* me, raft_cbs_t* funcs, void* user_data);
* @param[in] id The integer ID of this node
* This is used for identifying clients across sessions.
* @param[in] is_self Set to 1 if this "node" is this server
* @return
0
on success; otherwise
-1
*/
* @return
node
on success; otherwise
NULL
*/
raft_node_t
*
raft_add_node
(
raft_server_t
*
me
,
void
*
user_data
,
int
id
,
int
is_self
);
#define raft_add_peer raft_add_node
...
...
@@ -402,7 +403,7 @@ int raft_periodic(raft_server_t* me, int msec_elapsed);
* memory permanent (ie. via malloc) OR re-assign the memory within the
* log_offer callback.
*
* @param[in] node
Index of t
he node who sent us this message
* @param[in] node
T
he node who sent us this message
* @param[in] ae The appendentries message
* @param[out] r The resulting response
* @return 0 on success */
...
...
@@ -412,7 +413,7 @@ int raft_recv_appendentries(raft_server_t* me,
msg_appendentries_response_t
*
r
);
/** Receive a response from an appendentries message we sent.
* @param[in] node
Index of t
he node who sent us this message
* @param[in] node
T
he node who sent us this message
* @param[in] r The appendentries response message
* @return 0 on success */
int
raft_recv_appendentries_response
(
raft_server_t
*
me
,
...
...
@@ -420,7 +421,7 @@ int raft_recv_appendentries_response(raft_server_t* me,
msg_appendentries_response_t
*
r
);
/** Receive a requestvote message.
* @param[in] node
Index of t
he node who sent us this message
* @param[in] node
T
he node who sent us this message
* @param[in] vr The requestvote message
* @param[out] r The resulting response
* @return 0 on success */
...
...
@@ -457,7 +458,7 @@ int raft_recv_requestvote_response(raft_server_t* me,
* <li>if the server is not the leader
* </ul>
*
* @param[in] node
Index of t
he node who sent us this message
* @param[in] node
T
he node who sent us this message
* @param[in] ety The entry message
* @param[out] r The resulting response
* @return
...
...
@@ -471,7 +472,7 @@ int raft_recv_entry(raft_server_t* me,
msg_entry_response_t
*
r
);
/**
* @return
the
server's node ID */
* @return server's node ID
; -1 if it doesn't know what it is
*/
int
raft_get_nodeid
(
raft_server_t
*
me
);
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment