xetorthio/jedis — pull request #637 by HeartSaVioR (2014-05-20 23:32:09+00:00)
Title: fix "cluster nodes" parse error when slot is in transition (fixes #635)

Though it's not documented, "cluster nodes" shows slot information being imported or migrated.

Below is src/cluster.c from latest Redis unstable branch.
````
/* Just for MYSELF node we also dump info about slots that
* we are migrating to other instances or importing from other
* instances. */
if (node->flags & REDIS_NODE_MYSELF) {
for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) {
if (server.cluster->migrating_slots_to[j]) {
ci = sdscatprintf(ci," [%d->-%.40s]",j,
server.cluster->migrating_slots_to[j]->name);
} else if (server.cluster->importing_slots_from[j]) {
ci = sdscatprintf(ci," [%d-<-%.40s]",j,
server.cluster->importing_slots_from[j]->name);
}
}
}
````

So Jedis should able to parse it.

Btw, module that parses cluster nodes information could be complicated, so I've refactored to move to another class.

* extract cluster nodes info. parser from JedisClusterConnectionHandler
** ClusterNodeInformation & ClusterNodeInformationParser
** user can use it with "cluster nodes" command result, not only JedisClusterConnectionHandler
* unit test for migrating slot included