mirror of
https://github.com/fluencelabs/redis
synced 2025-06-16 10:41:22 +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:
14
src/t_list.c
14
src/t_list.c
@ -181,10 +181,10 @@ void listTypeConvert(robj *subject, int enc) {
|
||||
redisAssertWithInfo(NULL,subject,subject->encoding==REDIS_ENCODING_ZIPLIST);
|
||||
|
||||
if (enc == REDIS_ENCODING_QUICKLIST) {
|
||||
size_t zlen = server.list_max_ziplist_entries;
|
||||
|
||||
size_t zlen = server.list_max_ziplist_size;
|
||||
int depth = server.list_compress_depth;
|
||||
subject->ptr = quicklistCreateFromZiplist(zlen, depth, subject->ptr);
|
||||
subject->encoding = REDIS_ENCODING_QUICKLIST;
|
||||
subject->ptr = quicklistCreateFromZiplist(zlen, 0 /*FIXME*/, subject->ptr);
|
||||
} else {
|
||||
redisPanic("Unsupported list conversion");
|
||||
}
|
||||
@ -207,8 +207,8 @@ void pushGenericCommand(redisClient *c, int where) {
|
||||
c->argv[j] = tryObjectEncoding(c->argv[j]);
|
||||
if (!lobj) {
|
||||
lobj = createQuicklistObject();
|
||||
quicklistSetFill(lobj->ptr, server.list_max_ziplist_entries);
|
||||
quicklistSetCompress(lobj->ptr, 0 /*FIXME*/);
|
||||
quicklistSetOptions(lobj->ptr, server.list_max_ziplist_size,
|
||||
server.list_compress_depth);
|
||||
dbAdd(c->db,c->argv[1],lobj);
|
||||
}
|
||||
listTypePush(lobj,c->argv[j],where);
|
||||
@ -537,8 +537,8 @@ void rpoplpushHandlePush(redisClient *c, robj *dstkey, robj *dstobj, robj *value
|
||||
/* Create the list if the key does not exist */
|
||||
if (!dstobj) {
|
||||
dstobj = createQuicklistObject();
|
||||
quicklistSetFill(dstobj->ptr, server.list_max_ziplist_entries);
|
||||
quicklistSetCompress(dstobj->ptr, 0 /*FIXME*/);
|
||||
quicklistSetOptions(dstobj->ptr, server.list_max_ziplist_size,
|
||||
server.list_compress_depth);
|
||||
dbAdd(c->db,dstkey,dstobj);
|
||||
}
|
||||
signalModifiedKey(c->db,dstkey);
|
||||
|
Reference in New Issue
Block a user