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
03af999c
Commit
03af999c
authored
Mar 22, 2011
by
antirez
Browse files
command table altered for the new API to get position of keys arguments in commands
parent
612810af
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
03af999c
...
@@ -70,12 +70,12 @@ struct redisServer server; /* server global state */
...
@@ -70,12 +70,12 @@ struct redisServer server; /* server global state */
struct
redisCommand
*
commandTable
;
struct
redisCommand
*
commandTable
;
struct
redisCommand
redisCommandTable
[]
=
{
struct
redisCommand
redisCommandTable
[]
=
{
{
"get"
,
getCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"get"
,
getCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"set"
,
setCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"set"
,
setCommand
,
3
,
REDIS_CMD_DENYOOM
,
noPreloadGetKeys
,
1
,
1
,
1
,
0
,
0
},
{
"setnx"
,
setnxCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"setnx"
,
setnxCommand
,
3
,
REDIS_CMD_DENYOOM
,
noPreloadGetKeys
,
1
,
1
,
1
,
0
,
0
},
{
"setex"
,
setexCommand
,
4
,
REDIS_CMD_DENYOOM
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"setex"
,
setexCommand
,
4
,
REDIS_CMD_DENYOOM
,
noPreloadGetKeys
,
2
,
2
,
1
,
0
,
0
},
{
"append"
,
appendCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"append"
,
appendCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"strlen"
,
strlenCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"strlen"
,
strlenCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"del"
,
delCommand
,
-
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"del"
,
delCommand
,
-
2
,
0
,
noPreloadGetKeys
,
1
,
-
1
,
1
,
0
,
0
},
{
"exists"
,
existsCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"exists"
,
existsCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"setbit"
,
setbitCommand
,
4
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"setbit"
,
setbitCommand
,
4
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"getbit"
,
getbitCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"getbit"
,
getbitCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
...
@@ -94,7 +94,7 @@ struct redisCommand redisCommandTable[] = {
...
@@ -94,7 +94,7 @@ struct redisCommand redisCommandTable[] = {
{
"lpop"
,
lpopCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"lpop"
,
lpopCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"brpop"
,
brpopCommand
,
-
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"brpop"
,
brpopCommand
,
-
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"brpoplpush"
,
brpoplpushCommand
,
4
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
2
,
1
,
0
,
0
},
{
"brpoplpush"
,
brpoplpushCommand
,
4
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
2
,
1
,
0
,
0
},
{
"blpop"
,
blpopCommand
,
-
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"blpop"
,
blpopCommand
,
-
3
,
0
,
NULL
,
1
,
-
2
,
1
,
0
,
0
},
{
"llen"
,
llenCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"llen"
,
llenCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"lindex"
,
lindexCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"lindex"
,
lindexCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"lset"
,
lsetCommand
,
4
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"lset"
,
lsetCommand
,
4
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
,
0
,
0
},
...
@@ -121,8 +121,8 @@ struct redisCommand redisCommandTable[] = {
...
@@ -121,8 +121,8 @@ struct redisCommand redisCommandTable[] = {
{
"zrem"
,
zremCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zrem"
,
zremCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zremrangebyscore"
,
zremrangebyscoreCommand
,
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zremrangebyscore"
,
zremrangebyscoreCommand
,
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zremrangebyrank"
,
zremrangebyrankCommand
,
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zremrangebyrank"
,
zremrangebyrankCommand
,
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zunionstore"
,
zunionstoreCommand
,
-
4
,
REDIS_CMD_DENYOOM
,
zunionInter
BlockClientOnSwapped
Keys
,
0
,
0
,
0
,
0
,
0
},
{
"zunionstore"
,
zunionstoreCommand
,
-
4
,
REDIS_CMD_DENYOOM
,
zunionInter
Get
Keys
,
0
,
0
,
0
,
0
,
0
},
{
"zinterstore"
,
zinterstoreCommand
,
-
4
,
REDIS_CMD_DENYOOM
,
zunionInter
BlockClientOnSwapped
Keys
,
0
,
0
,
0
,
0
,
0
},
{
"zinterstore"
,
zinterstoreCommand
,
-
4
,
REDIS_CMD_DENYOOM
,
zunionInter
Get
Keys
,
0
,
0
,
0
,
0
,
0
},
{
"zrange"
,
zrangeCommand
,
-
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zrange"
,
zrangeCommand
,
-
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zrangebyscore"
,
zrangebyscoreCommand
,
-
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zrangebyscore"
,
zrangebyscoreCommand
,
-
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zrevrangebyscore"
,
zrevrangebyscoreCommand
,
-
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"zrevrangebyscore"
,
zrevrangebyscoreCommand
,
-
4
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
...
@@ -152,10 +152,10 @@ struct redisCommand redisCommandTable[] = {
...
@@ -152,10 +152,10 @@ struct redisCommand redisCommandTable[] = {
{
"randomkey"
,
randomkeyCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"randomkey"
,
randomkeyCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"select"
,
selectCommand
,
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"select"
,
selectCommand
,
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"move"
,
moveCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"move"
,
moveCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"rename"
,
renameCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"rename"
,
renameCommand
,
3
,
0
,
renameGetKeys
,
1
,
2
,
1
,
0
,
0
},
{
"renamenx"
,
renamenxCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"renamenx"
,
renamenxCommand
,
3
,
0
,
renameGetKeys
,
1
,
2
,
1
,
0
,
0
},
{
"expire"
,
expireCommand
,
3
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"expire"
,
expireCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"expireat"
,
expireatCommand
,
3
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"expireat"
,
expireatCommand
,
3
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"keys"
,
keysCommand
,
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"keys"
,
keysCommand
,
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"dbsize"
,
dbsizeCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"dbsize"
,
dbsizeCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"auth"
,
authCommand
,
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"auth"
,
authCommand
,
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
...
@@ -168,7 +168,7 @@ struct redisCommand redisCommandTable[] = {
...
@@ -168,7 +168,7 @@ struct redisCommand redisCommandTable[] = {
{
"lastsave"
,
lastsaveCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"lastsave"
,
lastsaveCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"type"
,
typeCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"type"
,
typeCommand
,
2
,
0
,
NULL
,
1
,
1
,
1
,
0
,
0
},
{
"multi"
,
multiCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"multi"
,
multiCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"exec"
,
execCommand
,
1
,
REDIS_CMD_DENYOOM
,
exec
BlockClientOnSwapped
Keys
,
0
,
0
,
0
,
0
,
0
},
{
"exec"
,
execCommand
,
1
,
REDIS_CMD_DENYOOM
,
exec
Get
Keys
,
0
,
0
,
0
,
0
,
0
},
{
"discard"
,
discardCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"discard"
,
discardCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"sync"
,
syncCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"sync"
,
syncCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"flushdb"
,
flushdbCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"flushdb"
,
flushdbCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
...
@@ -186,7 +186,7 @@ struct redisCommand redisCommandTable[] = {
...
@@ -186,7 +186,7 @@ struct redisCommand redisCommandTable[] = {
{
"psubscribe"
,
psubscribeCommand
,
-
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"psubscribe"
,
psubscribeCommand
,
-
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"punsubscribe"
,
punsubscribeCommand
,
-
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"punsubscribe"
,
punsubscribeCommand
,
-
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"publish"
,
publishCommand
,
3
,
REDIS_CMD_FORCE_REPLICATION
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"publish"
,
publishCommand
,
3
,
REDIS_CMD_FORCE_REPLICATION
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"watch"
,
watchCommand
,
-
2
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"watch"
,
watchCommand
,
-
2
,
0
,
noPreloadGetKeys
,
1
,
-
1
,
1
,
0
,
0
},
{
"unwatch"
,
unwatchCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
}
{
"unwatch"
,
unwatchCommand
,
1
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
}
};
};
...
...
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