xetorthio/jedis — pull request #667 by HeartSaVioR (2014-07-01 21:53:13+00:00)
Title: Support CLUSTER SLOTS command

* CLUSTER SLOTS returns a Redis-formatted mapping from slot ranges to IP/Port pairs serving that slot range
* description link including output format
* https://github.com/antirez/redis/commit/e14829de3025ffb0d3294e5e5a1553afd9f10b60
* Unit test included

It's also documented to http://redis.io/topics/cluster-spec.
````
Clients usually need to fetch a complete list of slots and mapped node addresses in two different moments:

- At startup in order to populate the initial slots configuration.
- When a MOVED redirection is received.

Note that a client may handle the MOVED redirection updating just the moved slot in its table, however this is usually not efficient since often the configuration of multiple slots is modified at once (for example if a slave is promoted to master, all the slots served by the old master will be remapped). It is much simpler to react to a MOVED redirection fetching the full map of slots - nodes from scratch.
In order to retrieve the slots configuration Redis Cluster offers (starting with 3.0.0 beta-7) an alternative to the CLUSTER NODES command that does not require parsing, and only provides the information strictly needed to clients.
The new command is called CLUSTER SLOTS and provides an array of slots ranges, and the associated master and slave nodes serving the specified range.
````

Redis suggests clients to renew slot mapping information when a MOVED has occurred.
So I'm planning to reflect it based on this PR.

Please review and comment! Thanks.