summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-03-30 13:16:55 +0200
committerantirez <antirez@gmail.com>2018-03-30 13:16:55 +0200
commit83ec35770e035a09a7cdc56924935f8ac722c84a (patch)
tree6495d93d4092334759ae1e53bb20cbe0c61e1977
parenta97df1a6e104e9e578c246eb3cf4b263370d8b05 (diff)
downloadredis-83ec35770e035a09a7cdc56924935f8ac722c84a.tar.gz
Modules Cluster API: node information struct and flags.
-rw-r--r--src/module.c7
-rw-r--r--src/redismodule.h6
2 files changed, 13 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index 9098281d8..9b7ec15a5 100644
--- a/src/module.c
+++ b/src/module.c
@@ -3825,6 +3825,13 @@ typedef struct moduleClusterReceiver {
struct moduleClusterReceiver *next;
} moduleClusterReceiver;
+typedef struct moduleClusterNodeInfo {
+ int flags;
+ char ip[NET_IP_STR_LEN];
+ int port;
+ char master_id[40]; /* Only if flags & REDISMODULE_NODE_MASTER is true. */
+} mdouleClusterNodeInfo;
+
/* We have an array of message types: each bucket is a linked list of
* configured receivers. */
static moduleClusterReceiver *clusterReceivers[UINT8_MAX];
diff --git a/src/redismodule.h b/src/redismodule.h
index 590900ce7..d81f18277 100644
--- a/src/redismodule.h
+++ b/src/redismodule.h
@@ -106,6 +106,12 @@
/* Cluster API defines. */
#define REDISMODULE_NODE_ID_LEN 40
+#define REDISMODULE_NODE_MYSELF (1<<0)
+#define REDISMODULE_NODE_MASTER (1<<1)
+#define REDISMODULE_NODE_SLAVE (1<<2)
+#define REDISMODULE_NODE_PFAIL (1<<3)
+#define REDISMODULE_NODE_FAIL (1<<4)
+#define REDISMODULE_NODE_NOFAILOVER (1<<5)
#define REDISMODULE_NOT_USED(V) ((void) V)