summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-02-17 12:20:59 +0100
committerantirez <antirez@gmail.com>2011-02-17 12:21:22 +0100
commitc2571b314a5d6382247bf0587c04efead1831591 (patch)
treed4e2824547b384be6eafa6b152d6a05ae1ae314e /src
parent97aeda982886dad341fb81e63bc9e1db5a11ba3d (diff)
downloadredis-c2571b314a5d6382247bf0587c04efead1831591.tar.gz
CONFIG SET/GET for all the special encoding parameters of sets, lists, hashes
Diffstat (limited to 'src')
-rw-r--r--src/config.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 939ced880..932ed2545 100644
--- a/src/config.c
+++ b/src/config.c
@@ -431,6 +431,21 @@ void configSetCommand(redisClient *c) {
addReplyErrorFormat(c,"Changing directory: %s", strerror(errno));
return;
}
+ } else if (!strcasecmp(c->argv[2]->ptr,"hash-max-zipmap-entries")) {
+ if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
+ server.hash_max_zipmap_entries = ll;
+ } else if (!strcasecmp(c->argv[2]->ptr,"hash-max-zipmap-value")) {
+ if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
+ server.hash_max_zipmap_value = ll;
+ } else if (!strcasecmp(c->argv[2]->ptr,"list-max-ziplist-entries")) {
+ if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
+ server.list_max_ziplist_entries = ll;
+ } else if (!strcasecmp(c->argv[2]->ptr,"list-max-ziplist-value")) {
+ if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
+ server.list_max_ziplist_value = ll;
+ } else if (!strcasecmp(c->argv[2]->ptr,"set-max-intset-entries")) {
+ if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
+ server.set_max_intset_entries = ll;
} else {
addReplyErrorFormat(c,"Unsupported CONFIG parameter: %s",
(char*)c->argv[2]->ptr);
@@ -555,6 +570,31 @@ void configGetCommand(redisClient *c) {
addReplyBulkCString(c,server.repl_serve_stale_data ? "yes" : "no");
matches++;
}
+ if (stringmatch(pattern,"hash-max-zipmap-entries",0)) {
+ addReplyBulkCString(c,"hash-max-zipmap-entries");
+ addReplyBulkLongLong(c,server.hash_max_zipmap_entries);
+ matches++;
+ }
+ if (stringmatch(pattern,"hash-max-zipmap-value",0)) {
+ addReplyBulkCString(c,"hash-max-zipmap-value");
+ addReplyBulkLongLong(c,server.hash_max_zipmap_value);
+ matches++;
+ }
+ if (stringmatch(pattern,"list-max-ziplist-entries",0)) {
+ addReplyBulkCString(c,"list-max-ziplist-entries");
+ addReplyBulkLongLong(c,server.list_max_ziplist_entries);
+ matches++;
+ }
+ if (stringmatch(pattern,"list-max-ziplist-value",0)) {
+ addReplyBulkCString(c,"list-max-ziplist-value");
+ addReplyBulkLongLong(c,server.list_max_ziplist_value);
+ matches++;
+ }
+ if (stringmatch(pattern,"set-max-intset-entries",0)) {
+ addReplyBulkCString(c,"set-max-intset-entries");
+ addReplyBulkLongLong(c,server.set_max_intset_entries);
+ matches++;
+ }
setDeferredMultiBulkLength(c,replylen,matches*2);
}