case MEMCACHED_BEHAVIOR_DISTRIBUTION:
return memcached_behavior_set_distribution(ptr, (memcached_server_distribution_t)data);
case MEMCACHED_BEHAVIOR_KETAMA:
case MEMCACHED_BEHAVIOR_DISTRIBUTION:
return memcached_behavior_set_distribution(ptr, (memcached_server_distribution_t)data);
case MEMCACHED_BEHAVIOR_KETAMA:
}
case MEMCACHED_BEHAVIOR_HASH:
return memcached_behavior_set_key_hash(ptr, (memcached_hash_t)(data));
}
case MEMCACHED_BEHAVIOR_HASH:
return memcached_behavior_set_key_hash(ptr, (memcached_hash_t)(data));
case MEMCACHED_BEHAVIOR_USER_DATA:
return MEMCACHED_FAILURE;
case MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY:
case MEMCACHED_BEHAVIOR_USER_DATA:
return MEMCACHED_FAILURE;
case MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY:
uint64_t memcached_behavior_get(memcached_st *ptr,
const memcached_behavior_t flag)
{
uint64_t memcached_behavior_get(memcached_st *ptr,
const memcached_behavior_t flag)
{
case MEMCACHED_BEHAVIOR_KETAMA:
return (ptr->distribution == MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA) ? (uint64_t) 1 : 0;
case MEMCACHED_BEHAVIOR_HASH:
case MEMCACHED_BEHAVIOR_KETAMA:
return (ptr->distribution == MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA) ? (uint64_t) 1 : 0;
case MEMCACHED_BEHAVIOR_HASH:
case MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT:
return ptr->server_failure_limit;
case MEMCACHED_BEHAVIOR_SORT_HOSTS:
case MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT:
return ptr->server_failure_limit;
case MEMCACHED_BEHAVIOR_SORT_HOSTS:
return (uint64_t)ptr->snd_timeout;
case MEMCACHED_BEHAVIOR_RCV_TIMEOUT:
return (uint64_t)ptr->rcv_timeout;
return (uint64_t)ptr->snd_timeout;
case MEMCACHED_BEHAVIOR_RCV_TIMEOUT:
return (uint64_t)ptr->rcv_timeout;
if (ptr->send_size != -1) // If value is -1 then we are using the default
return (uint64_t) ptr->send_size;
if (ptr->send_size != -1) // If value is -1 then we are using the default
return (uint64_t) ptr->send_size;
if (ptr->recv_size != -1) // If value is -1 then we are using the default
return (uint64_t) ptr->recv_size;
instance= memcached_server_instance_fetch(ptr, 0);
if (ptr->recv_size != -1) // If value is -1 then we are using the default
return (uint64_t) ptr->recv_size;
instance= memcached_server_instance_fetch(ptr, 0);
return rc == HASHKIT_SUCCESS ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
}
memcached_hash_t memcached_behavior_get_key_hash(memcached_st *ptr)
{
return rc == HASHKIT_SUCCESS ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
}
memcached_hash_t memcached_behavior_get_key_hash(memcached_st *ptr)
{
return rc == HASHKIT_SUCCESS ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
}
memcached_hash_t memcached_behavior_get_distribution_hash(memcached_st *ptr)
{
return rc == HASHKIT_SUCCESS ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
}
memcached_hash_t memcached_behavior_get_distribution_hash(memcached_st *ptr)
{