+
+memcached_return run_distribution(memcached_st *ptr)
+{
+ switch (ptr->distribution)
+ {
+ case MEMCACHED_DISTRIBUTION_CONSISTENT:
+ case MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA:
+ return update_continuum(ptr);
+ case MEMCACHED_DISTRIBUTION_CONSISTENT_WHEEL:
+ rebalance_wheel(ptr);
+ break;
+ case MEMCACHED_DISTRIBUTION_MODULA:
+ if (ptr->flags & MEM_USE_SORT_HOSTS)
+ sort_hosts(ptr);
+ break;
+ default:
+ WATCHPOINT_ASSERT(0); /* We have added a distribution without extending the logic */
+ }
+
+ return MEMCACHED_SUCCESS;
+}
+