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
ebd666db
Commit
ebd666db
authored
Feb 14, 2013
by
antirez
Browse files
Cluster: from 4096 to 16384 hash slots.
parent
072c91fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
ebd666db
...
@@ -299,10 +299,10 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
...
@@ -299,10 +299,10 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
* Key space handling
* Key space handling
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
/* We have
4096
hash slots. The hash slot of a given key is obtained
/* We have
16384
hash slots. The hash slot of a given key is obtained
* as the least significant 1
2
bits of the crc16 of the key. */
* as the least significant 1
4
bits of the crc16 of the key. */
unsigned
int
keyHashSlot
(
char
*
key
,
int
keylen
)
{
unsigned
int
keyHashSlot
(
char
*
key
,
int
keylen
)
{
return
crc16
(
key
,
keylen
)
&
0x
0
FFF
;
return
crc16
(
key
,
keylen
)
&
0x
3
FFF
;
}
}
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
...
...
src/redis.h
View file @
ebd666db
...
@@ -514,7 +514,7 @@ typedef struct redisOpArray {
...
@@ -514,7 +514,7 @@ typedef struct redisOpArray {
* Redis cluster data structures
* Redis cluster data structures
*----------------------------------------------------------------------------*/
*----------------------------------------------------------------------------*/
#define REDIS_CLUSTER_SLOTS
4096
#define REDIS_CLUSTER_SLOTS
16384
#define REDIS_CLUSTER_OK 0
/* Everything looks ok */
#define REDIS_CLUSTER_OK 0
/* Everything looks ok */
#define REDIS_CLUSTER_FAIL 1
/* The cluster can't work */
#define REDIS_CLUSTER_FAIL 1
/* The cluster can't work */
#define REDIS_CLUSTER_NEEDHELP 2
/* The cluster works, but needs some help */
#define REDIS_CLUSTER_NEEDHELP 2
/* The cluster works, but needs some help */
...
...
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