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
20f52b5b
Commit
20f52b5b
authored
Feb 15, 2013
by
antirez
Browse files
Top comment for getNodeByQuery() improved.
parent
6b641f3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
20f52b5b
...
...
@@ -1901,16 +1901,16 @@ void askingCommand(redisClient *c) {
* Cluster functions related to serving / redirecting clients
* -------------------------------------------------------------------------- */
/* Return the pointer to the cluster node that is able to serve the query
* as all the keys belong to hash slots for which the node is in charge.
/* Return the pointer to the cluster node that is able to serve the command.
* For the function to succeed the command should only target a single
* key (or the same key multiple times).
*
* If the returned node should be used only for this request, the *ask
* integer is set to '1', otherwise to '0'. This is used in order to
* let the caller know if we should reply with -MOVED or with -ASK.
*
* If the request contains more than a single key NULL is returned,
* however a request with more then a key argument where the key is always
* the same is valid, like in: RPOPLPUSH mylist mylist.*/
* If the command contains multiple keys, and as a consequence it is not
* possible to handle the request in Redis Cluster, NULL is returned. */
clusterNode
*
getNodeByQuery
(
redisClient
*
c
,
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
hashslot
,
int
*
ask
)
{
clusterNode
*
n
=
NULL
;
robj
*
firstkey
=
NULL
;
...
...
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