Removed dead code.
[awesomized/libmemcached] / libmemcached / memcached_hosts.c
index 2678a7c1ae131a9ada0d451dd868fb02528ba534..d75da5d2d6114410ffaf1519e0469cef2b113821 100644 (file)
@@ -6,49 +6,6 @@ static memcached_return server_add(memcached_st *ptr, char *hostname,
                                    memcached_connection type);
 memcached_return update_continuum(memcached_st *ptr);
 
-#define MEMCACHED_WHEEL_SIZE 1024
-#define MEMCACHED_STRIDE 4
-static memcached_return rebalance_wheel(memcached_st *ptr)
-{
-  unsigned int x;
-  unsigned int y;
-  unsigned int latch;
-
-  if (ptr->number_of_hosts > ptr->wheel_count)
-  {
-    uint32_t *new_ptr;
-
-    if (ptr->call_realloc)
-      new_ptr= (uint32_t *)ptr->call_realloc(ptr, ptr->wheel, sizeof(uint32_t) * (ptr->number_of_hosts + MEMCACHED_CONTINUUM_ADDITION) * MEMCACHED_STRIDE);
-    else
-      new_ptr= (uint32_t *)realloc(ptr->wheel, sizeof(uint32_t) * (ptr->number_of_hosts + MEMCACHED_CONTINUUM_ADDITION) * MEMCACHED_STRIDE);
-
-    if (new_ptr == 0)
-      return MEMCACHED_MEMORY_ALLOCATION_FAILURE;
-
-    ptr->wheel= new_ptr;
-    ptr->wheel_count= ptr->number_of_hosts + MEMCACHED_CONTINUUM_ADDITION;
-  }
-
-  /* Seed the Wheel */
-  memset(ptr->wheel, 0, sizeof(uint32_t) * MEMCACHED_STRIDE * ptr->wheel_count);
-
-  for (latch= y= x= 0; x < MEMCACHED_STRIDE * ptr->wheel_count; x++, latch++)
-  {
-    if (latch == MEMCACHED_STRIDE)
-    {
-      y++;
-      if (y == ptr->number_of_hosts)
-        y= 0;
-      latch= 0;
-    }
-
-    ptr->wheel[x]= y;
-  }
-
-  return MEMCACHED_SUCCESS;
-}
-
 static int compare_servers(const void *p1, const void *p2)
 {
   int return_value;
@@ -82,9 +39,6 @@ memcached_return run_distribution(memcached_st *ptr)
   case MEMCACHED_DISTRIBUTION_CONSISTENT:
   case MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA:
     return update_continuum(ptr);
-  case MEMCACHED_DISTRIBUTION_CONSISTENT_WHEEL:
-    return rebalance_wheel(ptr);
-    break;
   case MEMCACHED_DISTRIBUTION_MODULA:
     if (ptr->flags & MEM_USE_SORT_HOSTS)
       sort_hosts(ptr);