return hash % ptr->number_of_hosts;
case MEMCACHED_DISTRIBUTION_RANDOM:
return (uint32_t) random() % ptr->number_of_hosts;
return hash % ptr->number_of_hosts;
case MEMCACHED_DISTRIBUTION_RANDOM:
return (uint32_t) random() % ptr->number_of_hosts;
default:
WATCHPOINT_ASSERT(0); /* We have added a distribution without extending the logic */
return hash % ptr->number_of_hosts;
}
default:
WATCHPOINT_ASSERT(0); /* We have added a distribution without extending the logic */
return hash % ptr->number_of_hosts;
}
struct timeval now;
if (gettimeofday(&now, NULL) == 0 &&
now.tv_sec > ptr->next_distribution_rebuild)
struct timeval now;
if (gettimeofday(&now, NULL) == 0 &&
now.tv_sec > ptr->next_distribution_rebuild)