summaryrefslogtreecommitdiff
path: root/src/t_list.c
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-12-16 00:49:14 -0500
committerMatt Stancliff <matt@genges.com>2015-01-02 11:16:10 -0500
commit02bb515a094c081fcbc3e33c60a5dbff440eb447 (patch)
treed9c803b0998f16fb4c87feab072eb47353fe100d /src/t_list.c
parentbbbbfb14422ee84e4b79330f299ddacf9be23d88 (diff)
downloadredis-02bb515a094c081fcbc3e33c60a5dbff440eb447.tar.gz
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.
Diffstat (limited to 'src/t_list.c')
-rw-r--r--src/t_list.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/t_list.c b/src/t_list.c
index 61fdf2ad8..232cb5c52 100644
--- a/src/t_list.c
+++ b/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);