Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c2571b31
Commit
c2571b31
authored
Feb 17, 2011
by
antirez
Browse files
CONFIG SET/GET for all the special encoding parameters of sets, lists, hashes
parent
97aeda98
Changes
1
Show whitespace changes
Inline
Side-by-side
src/config.c
View file @
c2571b31
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment