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
redis
Commits
744fe7f3
Commit
744fe7f3
authored
Sep 19, 2018
by
antirez
Browse files
Module cluster flags: initial vars / defines added.
parent
7cdf272d
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
744fe7f3
...
...
@@ -5438,6 +5438,10 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in
/* Set error code optimistically for the base case. */
if
(
error_code
)
*
error_code
=
CLUSTER_REDIR_NONE
;
/* Modules can turn off Redis Cluster redirection: this is useful
* when writing a module that implements a completely different
* distributed system. */
/* We handle all the cases as if they were EXEC commands, so we have
* a common code path for everything */
if
(
cmd
->
proc
==
execCommand
)
{
...
...
src/cluster.h
View file @
744fe7f3
...
...
@@ -100,6 +100,13 @@ typedef struct clusterLink {
#define CLUSTERMSG_TYPE_MODULE 9
/* Module cluster API message. */
#define CLUSTERMSG_TYPE_COUNT 10
/* Total number of message types. */
/* Flags that a module can set in order to prevent certain Redis Cluster
* features to be enabled. Useful when implementing a different distributed
* system on top of Redis Cluster message bus, using modules. */
#define MODULE_CLUSTER_FLAG_NONE 0
#define MODULE_CLUSTER_FLAG_NO_FAILOVER (1<<1)
#define MODULE_CLUSTER_FLAG_NO_REDIRECTION (1<<2)
/* This structure represent elements of node->fail_reports. */
typedef
struct
clusterNodeFailReport
{
struct
clusterNode
*
node
;
/* Node reporting the failure condition. */
...
...
src/redismodule.h
View file @
744fe7f3
...
...
@@ -117,6 +117,10 @@
#define REDISMODULE_NODE_FAIL (1<<4)
#define REDISMODULE_NODE_NOFAILOVER (1<<5)
#define REDISMODULE_CLUSTER_FLAG_NONE 0
#define REDISMODULE_CLUSTER_FLAG_NO_FAILOVER (1<<1)
#define REDISMODULE_CLUSTER_FLAG_NO_REDIRECTION (1<<2)
#define REDISMODULE_NOT_USED(V) ((void) V)
/* This type represents a timer handle, and is returned when a timer is
...
...
src/server.c
View file @
744fe7f3
...
...
@@ -1621,6 +1621,7 @@ void initServerConfig(void) {
server
.
cluster_announce_ip
=
CONFIG_DEFAULT_CLUSTER_ANNOUNCE_IP
;
server
.
cluster_announce_port
=
CONFIG_DEFAULT_CLUSTER_ANNOUNCE_PORT
;
server
.
cluster_announce_bus_port
=
CONFIG_DEFAULT_CLUSTER_ANNOUNCE_BUS_PORT
;
server
.
cluster_module_flags
=
MODULE_CLUSTER_FLAG_NONE
;
server
.
migrate_cached_sockets
=
dictCreate
(
&
migrateCacheDictType
,
NULL
);
server
.
next_client_id
=
1
;
/* Client IDs, start from 1 .*/
server
.
loading_process_events_interval_bytes
=
(
1024
*
1024
*
2
);
...
...
src/server.h
View file @
744fe7f3
...
...
@@ -1232,6 +1232,10 @@ struct redisServer {
char
*
cluster_announce_ip
;
/* IP address to announce on cluster bus. */
int
cluster_announce_port
;
/* base port to announce on cluster bus. */
int
cluster_announce_bus_port
;
/* bus port to announce on cluster bus. */
int
cluster_module_flags
;
/* Set of flags that Redis modules are able
to set in order to suppress certain
native Redis Cluster features. Check the
REDISMODULE_CLUSTER_FLAG_*. */
/* Scripting */
lua_State
*
lua
;
/* The Lua interpreter. We use just one for all clients */
client
*
lua_client
;
/* The "fake client" to query Redis from Lua */
...
...
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