Documentation on storage by key commands.
* Fixed bug where key could be out of range of characters
* Added _by_key() methods to allow partitioning of values to particular
servers.
+ * MEMCACHED_DEFAILT_TIMEOUT is now set to 100 microseconds.
0.11 Mon Nov 26 01:05:52 PST 2007
* Added option to memcache_behavior_set() so that poll() can be timed out.
memslap.1\\r
memstat.1\\r
memcached_add.3\\r
+ memcached_add_by_key.3\\r
memcached_append.3\\r
+ memcached_append_by_key.3\\r
memcached_behavior_get.3\\r
memcached_behavior_set.3\\r
memcached_cas.3\\r
+ memcached_cas_by_key.3\\r
memcached_clone.3\\r
memcached_create.3\\r
memcached_decrement.3\\r
memcached_mget.3\\r
memcached_mget_by_key.3\\r
memcached_prepend.3\\r
+ memcached_prepend_by_key.3\\r
memcached_replace.3\\r
+ memcached_replace_by_key.3\\r
memcached_server_add.3\\r
memcached_server_count.3\\r
memcached_server_list.3\\r
memcached_server_push.3\\r
memcached_servers_parse.3\\r
memcached_set.3\\r
+ memcached_set_by_key.3\\r
memcached_stat.3\\r
memcached_stat_get_keys.3\\r
memcached_stat_get_value.3\\r
memcached_set.3: memcached_set.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_set.3\r
\r
+memcached_set_by_key.3: memcached_set.pod\r
+ pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_set_by_key.3\r
+\r
memcached_cas.3: memcached_set.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_cas.3\r
\r
+memcached_cas_by_key.3: memcached_set.pod\r
+ pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_cas_by_key.3\r
+\r
memcached_replace.3: memcached_set.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_replace.3\r
\r
+memcached_replace_by_key.3: memcached_set.pod\r
+ pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_replace_by_key.3\r
+\r
memcached_add.3: memcached_set.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_add.3\r
\r
+memcached_add_by_key.3: memcached_set.pod\r
+ pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_add_by_key.3\r
+\r
memcached_prepend.3: memcached_set.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_prepend.3\r
\r
+memcached_prepend_by_key.3: memcached_set.pod\r
+ pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_prepend_by_key.3\r
+\r
memcached_append.3: memcached_set.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_append.3\r
\r
+memcached_append_by_key.3: memcached_set.pod\r
+ pod2man -c "libmemcached" -r "" -s 3 memcached_set.pod > memcached_append_by_key.3\r
+\r
memcached_delete.3: memcached_delete.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_delete.pod > memcached_delete.3\r
\r
=item MEMCACHED_BEHAVIOR_DISTRIBUTION
Using this you can enable different means of distributing values to servers.
-The default method is MEMCACHED_DISTRIBUTION_MODULO. You can enable
+The default method is MEMCACHED_DISTRIBUTION_MODULA. You can enable
consistent hashing by setting MEMCACHED_DISTRIBUTION_CONSISTENT.
Consistent hashing delivers better distribution and allows servers to be
added to the cluster with minimal cache losses.
uint16_t flags,
uint64_t cas);
+ memcached_return
+ memcached_set_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ char *value, size_t value_length,
+ time_t expiration,
+ uint16_t flags);
+
+ memcached_return
+ memcached_add_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ char *value, size_t value_length,
+ time_t expiration,
+ uint16_t flags);
+
+ memcached_return
+ memcached_replace_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ char *value, size_t value_length,
+ time_t expiration,
+ uint16_t flags);
+
+ memcached_return
+ memcached_prepend_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ char *value, size_t value_length,
+ time_t expiration,
+ uint16_t flags);
+
+ memcached_return
+ memcached_append_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ char *value, size_t value_length,
+ time_t expiration,
+ uint16_t flags);
+
+ memcached_return
+ memcached_cas_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ char *value, size_t value_length,
+ time_t expiration,
+ uint16_t flags,
+ uint64_t cas);
+
=head1 DESCRIPTION
memcached_set(), memcached_add(), and memcached_replace() are all used to
for it in libmemcached(3) is optional. Please see memcached_set() for
information on how to do this.
+memcached_set_by_key(), memcached_add_by_key(), memcached_replace_by_key(),
+memcached_prepend_by_key(), memcached_append_by_key_by_key(),
+memcached_cas_by_key() methods all behave in a similar method as the non key
+methods. The difference is that they use their master_key parameter to map
+objects to particular servers.
+
If you are looking for performance, memcached_set() with non-blocking IO is
the fastest way to store data on the server.
#define MEMCACHED_MAX_HOST_LENGTH 64
#define MEMCACHED_WHEEL_SIZE 1024
#define MEMCACHED_STRIDE 4
-#define MEMCACHED_DEFAILT_TIMEOUT 100
+#define MEMCACHED_DEFAULT_TIMEOUT 100
typedef enum {
MEMCACHED_SUCCESS,
} memcached_return;
typedef enum {
- MEMCACHED_DISTRIBUTION_MODULO,
+ MEMCACHED_DISTRIBUTION_MODULA,
MEMCACHED_DISTRIBUTION_CONSISTENT,
} memcached_server_distribution;
}
string_ptr= memcached_string_create(ptr, &ptr->result_buffer, 0);
WATCHPOINT_ASSERT(string_ptr);
- ptr->poll_timeout= MEMCACHED_DEFAILT_TIMEOUT;
- ptr->distribution= MEMCACHED_DISTRIBUTION_MODULO;
+ ptr->poll_timeout= MEMCACHED_DEFAULT_TIMEOUT;
+ ptr->distribution= MEMCACHED_DISTRIBUTION_MODULA;
return ptr;
}
WATCHPOINT_ASSERT(hash);
- if (ptr->distribution == MEMCACHED_DISTRIBUTION_MODULO)
+ if (ptr->distribution == MEMCACHED_DISTRIBUTION_MODULA)
{
return hash % ptr->number_of_hosts;
}
void scheduler(memcached_server_st *servers, conclusions_st *conclusion)
{
unsigned int x;
- unsigned int actual_loaded;
+ unsigned int actual_loaded= 0; /* Fix warning */
memcached_st *memc;
struct timeval start_time, end_time;
%{_mandir}/man3/libmemcached.3.gz
%{_mandir}/man3/libmemcached_examples.3.gz
%{_mandir}/man3/memcached_add.3.gz
+%{_mandir}/man3/memcached_add_by_key.3.gz
%{_mandir}/man3/memcached_append.3.gz
+%{_mandir}/man3/memcached_append_by_key.3.gz
%{_mandir}/man3/memcached_behavior_get.3.gz
%{_mandir}/man3/memcached_behavior_set.3.gz
%{_mandir}/man3/memcached_cas.3.gz
+%{_mandir}/man3/memcached_cas_by_key.3.gz
%{_mandir}/man3/memcached_clone.3.gz
%{_mandir}/man3/memcached_create.3.gz
%{_mandir}/man3/memcached_decrement.3.gz
%{_mandir}/man3/memcached_mget.3.gz
%{_mandir}/man3/memcached_mget_by_key.3.gz
%{_mandir}/man3/memcached_prepend.3.gz
+%{_mandir}/man3/memcached_prepend_by_key.3.gz
%{_mandir}/man3/memcached_quit.3.gz
%{_mandir}/man3/memcached_replace.3.gz
%{_mandir}/man3/memcached_server_add.3.gz
%{_mandir}/man3/memcached_server_push.3.gz
%{_mandir}/man3/memcached_servers_parse.3.gz
%{_mandir}/man3/memcached_set.3.gz
+%{_mandir}/man3/memcached_set_by_key.3.gz
%{_mandir}/man3/memcached_stat.3.gz
%{_mandir}/man3/memcached_stat_get_keys.3.gz
%{_mandir}/man3/memcached_stat_get_value.3.gz
record-extended:
./testapp extended > output2.res
-test: testapp
+test: testapp library_test
+ echo "Tests completed"
+
+library_test:
./testapp > output.cmp
diff output.res output.cmp
+
+clients:
+ memcached -d -P /tmp/Xumemc.pid -p 12555
+ export MEMCACHED_SERVERS="localhost:12555"
sh t/memcat.test > r/memcat.cmp
diff r/memcat.res r/memcat.cmp
sh t/memcp.test > r/memcp.cmp
diff r/memslap.res r/memslap.cmp
sh t/memstat.test > r/memstat.cmp
diff r/memstat.res r/memstat.cmp
-
-test-extended: testapp
- ./testapp extended > output.cmp
- diff output2.res output.cmp
+ cat /tmp/Xumemc.pid | xargs kill
+ rm /tmp/Xumemc.pid
valgrind:
libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes testapp
$MEMSLAP --help
-$MEMSLAP --servers=localhost --initial-load=5000 --verbose --flush --concurrency=500 --execute-number=500 > /dev/null
+$MEMSLAP --initial-load=5000 --verbose --flush --concurrency=500 --execute-number=500 > /dev/null