clients/execute.cc
/*
  Execute a memcached_get() on a set of pairs.
  Return the number of rows retrieved.
*/
Execute a memcached_get() on a set of pairs.
Return the number of rows retrieved.
Execute a memcached_get () on a set of pairs . Return the number of rows retrieved .
unsigned int execute_get(memcached_st *memc, pairs_st *pairs, unsigned int number_of)
{
  memcached_return_t rc;
  unsigned int x;
  unsigned int retrieved;
  for (retrieved= 0,x= 0; x < number_of; x++)
  {
    char *value;
    size_t value_length;
    uint32_t flags;
    unsigned int fetch_key;
    fetch_key= (unsigned int)((unsigned int)random() % number_of);
    value= memcached_get(memc, pairs[fetch_key].key, pairs[fetch_key].key_length,
                         &value_length, &flags, &rc);
    if (rc != MEMCACHED_SUCCESS)
      fprintf(stderr, "Failured on read of %.*s\n",
              (unsigned int)pairs[fetch_key].key_length, pairs[fetch_key].key);
    else
      retrieved++;
    free(value);
  }
  return retrieved;
}
unsigned int execute_get ( memcached_st * memc , pairs_st * pairs , unsigned int number_of ) { memcached_return_t rc ; unsigned int x ; unsigned int retrieved ; for ( retrieved = 0 , x = 0 ; x < number_of ; x ++ ) { char * value ; size_t value_length ; uint32_t flags ; unsigned int fetch_key ; fetch_key = ( unsigned int ) ( ( unsigned int ) random ( ) % number_of ) ; value = memcached_get ( memc , pairs [ fetch_key ] . key , pairs [ fetch_key ] . key_length , & value_length , & flags , & rc ) ; if ( rc != MEMCACHED_SUCCESS ) fprintf ( stderr , " \n " , ( unsigned int ) pairs [ fetch_key ] . key_length , pairs [ fetch_key ] . key ) ; else retrieved ++ ; free ( value ) ; } return retrieved ; }
Execute a memcached_get() on a set of pairs.
Execute a memcached_get () on a set of pairs .