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
4a1f1cc0
Commit
4a1f1cc0
authored
Oct 28, 2013
by
antirez
Browse files
SSCAN implemented.
parent
dfeaa84d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
4a1f1cc0
...
...
@@ -165,6 +165,7 @@ struct redisCommand redisCommandTable[] = {
{"sdiff",sdiffCommand,-2,"rS",0,NULL,1,-1,1,0,0},
{"sdiffstore",sdiffstoreCommand,-3,"wm",0,NULL,1,-1,1,0,0},
{"smembers",sinterCommand,2,"rS",0,NULL,1,1,1,0,0},
{"sscan",sscanCommand,-3,"rR",0,NULL,1,1,1,0,0},
{"zadd",zaddCommand,-4,"wm",0,NULL,1,1,1,0,0},
{"zincrby",zincrbyCommand,4,"wm",0,NULL,1,1,1,0,0},
{"zrem",zremCommand,-3,"w",0,NULL,1,1,1,0,0},
...
...
@@ -1227,6 +1228,7 @@ void createSharedObjects(void) {
shared.emptymultibulk = createObject(REDIS_STRING,sdsnew("*0\r\n"));
shared.pong = createObject(REDIS_STRING,sdsnew("+PONG\r\n"));
shared.queued = createObject(REDIS_STRING,sdsnew("+QUEUED\r\n"));
shared.emptyscan = createObject(REDIS_STRING,sdsnew("*2\r\n$1\r\n0\r\n*0\r\n"));
shared.wrongtypeerr = createObject(REDIS_STRING,sdsnew(
"-WRONGTYPE Operation against a key holding the wrong kind of value\r\n"));
shared.nokeyerr = createObject(REDIS_STRING,sdsnew(
...
...
src/redis.h
View file @
4a1f1cc0
...
...
@@ -504,7 +504,7 @@ struct sharedObjectsStruct {
*
masterdownerr
,
*
roslaveerr
,
*
execaborterr
,
*
noautherr
,
*
noreplicaserr
,
*
oomerr
,
*
plus
,
*
messagebulk
,
*
pmessagebulk
,
*
subscribebulk
,
*
unsubscribebulk
,
*
psubscribebulk
,
*
punsubscribebulk
,
*
del
,
*
rpop
,
*
lpop
,
*
lpush
,
*
lpush
,
*
emptyscan
,
*
select
[
REDIS_SHARED_SELECT_CMDS
],
*
integers
[
REDIS_SHARED_INTEGERS
],
*
mbulkhdr
[
REDIS_SHARED_BULKHDR_LEN
],
/* "*<value>\r\n" */
...
...
@@ -1194,6 +1194,7 @@ void signalFlushedDb(int dbid);
unsigned
int
getKeysInSlot
(
unsigned
int
hashslot
,
robj
**
keys
,
unsigned
int
count
);
unsigned
int
countKeysInSlot
(
unsigned
int
hashslot
);
int
verifyClusterConfigWithData
(
void
);
void
scanGenericCommand
(
redisClient
*
c
,
robj
*
o
);
/* API to get key arguments from commands */
#define REDIS_GETKEYS_ALL 0
...
...
@@ -1286,6 +1287,7 @@ void sunionCommand(redisClient *c);
void
sunionstoreCommand
(
redisClient
*
c
);
void
sdiffCommand
(
redisClient
*
c
);
void
sdiffstoreCommand
(
redisClient
*
c
);
void
sscanCommand
(
redisClient
*
c
);
void
syncCommand
(
redisClient
*
c
);
void
flushdbCommand
(
redisClient
*
c
);
void
flushallCommand
(
redisClient
*
c
);
...
...
src/t_set.c
View file @
4a1f1cc0
...
...
@@ -906,3 +906,11 @@ void sdiffCommand(redisClient *c) {
void
sdiffstoreCommand
(
redisClient
*
c
)
{
sunionDiffGenericCommand
(
c
,
c
->
argv
+
2
,
c
->
argc
-
2
,
c
->
argv
[
1
],
REDIS_OP_DIFF
);
}
void
sscanCommand
(
redisClient
*
c
)
{
robj
*
set
;
if
((
set
=
lookupKeyReadOrReply
(
c
,
c
->
argv
[
1
],
shared
.
emptyscan
))
==
NULL
||
checkType
(
c
,
set
,
REDIS_SET
))
return
;
scanGenericCommand
(
c
,
set
);
}
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