From: Brian Aker Date: Mon, 4 Apr 2011 20:19:33 +0000 (-0700) Subject: Merge in changes to allow for weights on hosts. X-Git-Tag: 0.51~18^2~6 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a68b22348553017dffa5e7b35b11d1464e7ca3c7;p=awesomized%2Flibmemcached Merge in changes to allow for weights on hosts. --- a68b22348553017dffa5e7b35b11d1464e7ca3c7 diff --cc .bzrignore index 06c56d69,06c56d69..6d1eabf5 --- a/.bzrignore +++ b/.bzrignore @@@ -172,6 -172,6 +172,7 @@@ memflush.po memrm.pop memslap.pop memstat.pop ++out patch patch2 stamp-h1 @@@ -181,6 -181,6 +182,7 @@@ support/libmemcached-fc.spe support/libmemcached.pc support/libmemcached.spec tests/atomsmasher ++tests/hash_plus tests/hashplus tests/memplus tests/output.cmp diff --cc ChangeLog index 9c0bea9c,b2ca1f74..828dae77 --- a/ChangeLog +++ b/ChangeLog @@@ -2,6 -2,9 +2,8 @@@ * Fix calls to auto methods so that if value is not passed in nothing bad happens. * New parser calls for generating memcached_st objects. * New error system. - + * A behavior change has been now made that if you specify a weight for any + server, we enable the weight flag and do weight balancing. 0.48 Tue Mar 15 23:05:18 PDT 2011 * Fix memory leak in server parse. diff --cc libmemcached/hosts.c index d1fe29b8,eafbb1b5..65a4cd41 --- a/libmemcached/hosts.c +++ b/libmemcached/hosts.c @@@ -233,9 -225,9 +225,9 @@@ static memcached_return_t update_contin { for (uint32_t x= 0; x < pointer_per_hash; x++) { - value= ketama_server_hash(sort_host, (size_t)sort_host_length, x); - ptr->ketama.continuum[continuum_index].index= host_index; - ptr->ketama.continuum[continuum_index++].value= value; + uint32_t value= ketama_server_hash(sort_host, (size_t)sort_host_length, x); - ptr->ketama.continuum[continuum_index].index= host_index; - ptr->ketama.continuum[continuum_index++].value= value; ++ ptr->ketama.continuum[continuum_index].index= host_index; ++ ptr->ketama.continuum[continuum_index++].value= value; } } else @@@ -282,9 -274,9 +274,9 @@@ { for (uint32_t x = 0; x < pointer_per_hash; x++) { - value= ketama_server_hash(sort_host, (size_t)sort_host_length, x); - uint32_t value= ketama_server_hash(sort_host, (size_t)sort_host_length, x); -- ptr->ketama.continuum[continuum_index].index= host_index; -- ptr->ketama.continuum[continuum_index++].value= value; ++ uint32_t value= ketama_server_hash(sort_host, (size_t)sort_host_length, x); ++ ptr->ketama.continuum[continuum_index].index= host_index; ++ ptr->ketama.continuum[continuum_index++].value= value; } } else diff --cc libmemcached/options/parser.am index 00000000,7bfd21c7..e69de29b mode 000000,100644..100644 --- a/libmemcached/options/parser.am +++ b/libmemcached/options/parser.am