{
uint8_t x;
uint32_t counter= 0; /* Prime the value for the assert in server_display_function */
+ uint32_t bigger= 0; /* Prime the value for the assert in server_display_function */
memcached_return rc;
memcached_server_function callbacks[1];
memcached_st *local_memc;
callbacks[0]= server_display_unsort_function;
memcached_server_cursor(local_memc, callbacks, (void *)&counter, 1);
+ /* Now we sort old data! */
+ memcached_behavior_set(local_memc, MEMCACHED_BEHAVIOR_SORT_HOSTS, 1);
+ callbacks[0]= server_display_function;
+ memcached_server_cursor(local_memc, callbacks, (void *)&bigger, 1);
+
memcached_free(local_memc);
assert(rc == MEMCACHED_SUCCESS);
assert(string_length == strlen(READ_THROUGH_VALUE));
assert(!strcmp(READ_THROUGH_VALUE, string));
+ free(string);
string= memcached_get(memc, key, strlen(key),
&string_length, &flags, &rc);
assert(rc == MEMCACHED_SUCCESS);
assert(string_length == strlen(READ_THROUGH_VALUE));
assert(!strcmp(READ_THROUGH_VALUE, string));
+ free(string);
return 0;
}
&string_length, &flags, &rc);
assert(rc == MEMCACHED_SUCCESS);
- if (current_length > 0)
- assert(string);
assert(string_length == current_length);
assert(!memcmp(string, value, string_length));
return MEMCACHED_SUCCESS;
}
+memcached_return enable_wheel(memcached_st *memc)
+{
+ memcached_server_distribution value= MEMCACHED_DISTRIBUTION_CONSISTENT_WHEEL;
+ memcached_hash hash;
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, value);
+ pre_hsieh(memc);
+
+ value= (memcached_server_distribution)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION);
+ assert(value == MEMCACHED_DISTRIBUTION_CONSISTENT_WHEEL);
+
+ hash= (memcached_hash)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH);
+ assert(hash == MEMCACHED_HASH_HSIEH);
+
+
+ return MEMCACHED_SUCCESS;
+}
+
memcached_return enable_consistent(memcached_st *memc)
{
memcached_server_distribution value= MEMCACHED_DISTRIBUTION_CONSISTENT;
{"poll_timeout", poll_timeout, 0, tests},
{"gets", enable_cas, 0, tests},
{"consistent", enable_consistent, 0, tests},
+ {"wheel", enable_wheel, 0, tests},
{"memory_allocators", set_memory_alloc, 0, tests},
// {"udp", pre_udp, 0, tests},
{"version_1_2_3", check_for_1_2_3, 0, version_1_2_3},