mirror of
https://github.com/fluencelabs/redis
synced 2025-06-14 09:41:21 +00:00
Config: Add quicklist, remove old list options
This removes: - list-max-ziplist-entries - list-max-ziplist-value This adds: - list-max-ziplist-size - list-compress-depth Also updates config file with new sections and updates tests to use quicklist settings instead of old list settings.
This commit is contained in:
@ -835,15 +835,15 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
|
||||
if ((len = rdbLoadLen(rdb,NULL)) == REDIS_RDB_LENERR) return NULL;
|
||||
|
||||
o = createQuicklistObject();
|
||||
quicklistSetFill(o->ptr, server.list_max_ziplist_entries);
|
||||
quicklistSetCompress(o->ptr, 0 /*FIXME*/);
|
||||
quicklistSetOptions(o->ptr, server.list_max_ziplist_size,
|
||||
server.list_compress_depth);
|
||||
|
||||
/* Load every single element of the list */
|
||||
while(len--) {
|
||||
if ((ele = rdbLoadEncodedStringObject(rdb)) == NULL) return NULL;
|
||||
dec = getDecodedObject(ele);
|
||||
size_t len = sdslen(dec->ptr);
|
||||
o->ptr = quicklistPushTail(o->ptr, dec->ptr, len);
|
||||
quicklistPushTail(o->ptr, dec->ptr, len);
|
||||
decrRefCount(dec);
|
||||
decrRefCount(ele);
|
||||
}
|
||||
@ -985,6 +985,8 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
|
||||
} else if (rdbtype == REDIS_RDB_TYPE_LIST_QUICKLIST) {
|
||||
if ((len = rdbLoadLen(rdb,NULL)) == REDIS_RDB_LENERR) return NULL;
|
||||
o = createQuicklistObject();
|
||||
quicklistSetOptions(o->ptr, server.list_max_ziplist_size,
|
||||
server.list_compress_depth);
|
||||
|
||||
while (len--) {
|
||||
if ((ele = rdbLoadStringObject(rdb)) == NULL) return NULL;
|
||||
|
Reference in New Issue
Block a user