Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2018-12-20 16:04:13 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2018-12-22 16:31:51 +0300
commitbb32e6f3a0e93b1de9235de2db496fb1bfc400d0 (patch)
tree32bea8aa6ba652927b18d810d8c0a08b86070498 /redis_array.h
parent3e7e1c833d08aac4e0eeb4e37dcc44768c8b117c (diff)
Implement consistent hashing algorithm for RedisArray
Diffstat (limited to 'redis_array.h')
-rw-r--r--redis_array.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/redis_array.h b/redis_array.h
index 458d814a..ba53fadc 100644
--- a/redis_array.h
+++ b/redis_array.h
@@ -37,6 +37,15 @@ PHP_METHOD(RedisArray, exec);
PHP_METHOD(RedisArray, discard);
PHP_METHOD(RedisArray, unwatch);
+typedef struct {
+ uint32_t value;
+ int index;
+} ContinuumPoint;
+
+typedef struct {
+ size_t nb_points;
+ ContinuumPoint *points;
+} Continuum;
typedef struct RedisArray_ {
@@ -52,7 +61,7 @@ typedef struct RedisArray_ {
HashTable *pure_cmds; /* hash table */
double connect_timeout; /* socket connect timeout */
double read_timeout; /* socket read timeout */
-
+ Continuum *continuum;
struct RedisArray_ *prev;
} RedisArray;