summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-sm.h
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2010-10-29 03:39:56 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-10-29 03:42:19 -0700
commit9c29312628af743f16badb4bc820cbd31f2a9488 (patch)
treebcf25aa7bdd7f60be49370f6555e2eaa61572965 /xlators/mgmt/glusterd/src/glusterd-sm.h
parentc1b80f0f590e2d7448b890b57e80f4a1b2e39a03 (diff)
cli,mgmt/glusterd: fsm log implementation
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1966 (Unnecessarily verbose logs at the default log level) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1966
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-sm.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.h b/xlators/mgmt/glusterd/src/glusterd-sm.h
index ebe6cb379c0..41ec2694317 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.h
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.h
@@ -68,6 +68,22 @@ typedef struct glusterd_peer_hostname_ {
struct list_head hostname_list;
}glusterd_peer_hostname_t;
+typedef struct glusterd_sm_transition_ {
+ int old_state;
+ int event;
+ int new_state;
+ time_t time;
+} glusterd_sm_transition_t;
+
+typedef struct glusterd_sm_tr_log_ {
+ glusterd_sm_transition_t *transitions;
+ size_t current;
+ size_t size;
+ size_t count;
+ char* (*state_name_get) (int);
+ char* (*event_name_get) (int);
+} glusterd_sm_tr_log_t;
+
struct glusterd_peerinfo_ {
uuid_t uuid;
char uuid_str[50];
@@ -80,6 +96,7 @@ struct glusterd_peerinfo_ {
struct rpc_clnt *rpc;
int connected;
glusterd_store_handle_t *shandle;
+ glusterd_sm_tr_log_t sm_log;
};
typedef struct glusterd_peerinfo_ glusterd_peerinfo_t;
@@ -178,7 +195,10 @@ void
glusterd_destroy_friend_req_ctx (glusterd_friend_req_ctx_t *ctx);
char*
-glusterd_friend_sm_state_name_get (glusterd_friend_sm_state_t state);
+glusterd_friend_sm_state_name_get (int state);
+
+char*
+glusterd_friend_sm_event_name_get (int event);
int
glusterd_broadcast_friend_delete (char *hostname, uuid_t uuid);