Permalink
Browse files

Use libvbucket correctly ;-)

Change-Id: I9346b4a660a0ebcb46c6c451c04e3a3e9cfc49ac
Reviewed-on: http://review.northscale.com:8080/244
Reviewed-by: Dustin Sallings <dustin@spy.net>
Tested-by: Sean Lynch <seanl@literati.org>
Reviewed-by: Sean Lynch <seanl@literati.org>
  • Loading branch information...
1 parent 3b137b6 commit 938ef9e85a467b406c908ea794f97b25bd72eac6 @trondn trondn committed with seanlynch May 29, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/vbucketmigrator.cc
View
@@ -212,12 +212,13 @@ int main(int argc, char **argv)
for (vector<uint16_t>::iterator iter = buckets.begin();
iter != buckets.end();
++iter) {
- const char *location = vbucket_config_get_server(vbucket, *iter);
- if (location == NULL) {
+
+ int idx = vbucket_get_master(vbucket, *iter);
+ if (idx == -1) {
cerr << "Failed to resolve bucket: " << *iter << endl;
return EX_CONFIG;
}
- Socket *sock = new Socket(location);
+ Socket *sock = new Socket(vbucket_config_get_server(vbucket, idx));
try {
sock->connect();
sock->setNonBlocking();

0 comments on commit 938ef9e

Please sign in to comment.