Cluster: hash slots tracking using a radix tree.

This commit is contained in:
antirez
2017-03-27 15:26:56 +02:00
parent 94751543b0
commit 1409c545da
9 changed files with 2114 additions and 64 deletions

View File

@ -476,8 +476,10 @@ void clusterInit(void) {
}
}
/* The slots -> keys map is a sorted set. Init it. */
server.cluster->slots_to_keys = zslCreate();
/* The slots -> keys map is a radix tree. Initialize it here. */
server.cluster->slots_to_keys = raxNew();
memset(server.cluster->slots_keys_count,0,
sizeof(server.cluster->slots_keys_count));
/* Set myself->port / cport to my listening ports, we'll just need to
* discover the IP address via MEET messages. */