{
(void)memcached_behavior_set_key_hash(ptr, MEMCACHED_HASH_MD5);
(void)memcached_behavior_set_distribution_hash(ptr, MEMCACHED_HASH_MD5);
- ptr->flags.ketama_weighted= set_flag(data);
+ ptr->ketama.weighted= set_flag(data);
/**
@note We try to keep the same distribution going. This should be deprecated and rewritten.
*/
case MEMCACHED_BEHAVIOR_VERIFY_KEY:
return ptr->flags.verify_key;
case MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED:
- return ptr->flags.ketama_weighted;
+ return ptr->ketama.weighted;
case MEMCACHED_BEHAVIOR_DISTRIBUTION:
return ptr->distribution;
case MEMCACHED_BEHAVIOR_KETAMA:
{
if (type < MEMCACHED_DISTRIBUTION_CONSISTENT_MAX)
{
+ if (MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED)
+ {
+ ptr->ketama.weighted= true;
+ }
+ else
+ {
+ ptr->ketama.weighted= false;
+ }
ptr->distribution= type;
run_distribution(ptr);
return MEMCACHED_SUCCESS;
case MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA: return "MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA";
case MEMCACHED_DISTRIBUTION_RANDOM: return "MEMCACHED_DISTRIBUTION_RANDOM";
case MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY: return "MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY";
+ case MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED: return "MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED";
default:
case MEMCACHED_DISTRIBUTION_CONSISTENT_MAX: return "INVALID memcached_server_distribution_t";
}