diff options
author | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2018-12-20 16:04:13 +0300 |
---|---|---|
committer | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2018-12-22 16:31:51 +0300 |
commit | bb32e6f3a0e93b1de9235de2db496fb1bfc400d0 (patch) | |
tree | 32bea8aa6ba652927b18d810d8c0a08b86070498 /redis_array.h | |
parent | 3e7e1c833d08aac4e0eeb4e37dcc44768c8b117c (diff) |
Implement consistent hashing algorithm for RedisArray
Diffstat (limited to 'redis_array.h')
-rw-r--r-- | redis_array.h | 11 |
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; |