Update testings/docs via merge from build trunk.
authorBrian Aker <brian@tangent.org>
Sun, 12 Feb 2012 12:03:05 +0000 (04:03 -0800)
committerBrian Aker <brian@tangent.org>
Sun, 12 Feb 2012 12:03:05 +0000 (04:03 -0800)
13 files changed:
clients/memexist.cc
docs/bin/memexist.rst [new file with mode: 0644]
docs/bin/memparse.rst [new file with mode: 0644]
docs/bin/memping.rst [new file with mode: 0644]
docs/bin/memtouch.rst [new file with mode: 0644]
docs/conf.py.in
docs/index.rst
docs/memcached_servers.rst
tests/libmemcached-1.0/all_tests.cc
tests/libmemcached-1.0/generate.cc
tests/libmemcached-1.0/include.am
tests/libmemcached-1.0/mem_functions.cc
tests/libmemcached-1.0/servers_to_create.h [deleted file]

index 20ad48505c596bd0b39e480b124730fd3aba9beb..c3871dea9deefd9181ea91d7a0aee949b41bba41 100644 (file)
@@ -28,7 +28,7 @@ static char *opt_username;
 static char *opt_passwd;
 
 #define PROGRAM_NAME "memexist"
-#define PROGRAM_DESCRIPTION "Erase a key or set of keys from a memcached cluster."
+#define PROGRAM_DESCRIPTION "Check for the existance of a key within a cluster."
 
 /* Prototypes */
 static void options_parse(int argc, char *argv[]);
diff --git a/docs/bin/memexist.rst b/docs/bin/memexist.rst
new file mode 100644 (file)
index 0000000..22c3a4d
--- /dev/null
@@ -0,0 +1,64 @@
+===========================================
+memexist - Check for the existance of a key
+===========================================
+
+
+--------
+SYNOPSIS
+--------
+
+memexist [options] [key]
+
+.. program:: memexist
+
+
+-----------
+DESCRIPTION
+-----------
+
+:program:`memexist` checks for the existance of a key within a cluster.
+
+
+-------
+OPTIONS
+-------
+
+
+You can specify servers via the option:
+
+.. option:: --servers
+
+or via the environment variable:
+
+.. envvar:: `MEMCACHED_SERVERS`
+
+If you do not specify either these, the final value in the command line list is the name of a server(s).
+
+For a full list of operations run the tool with the option:
+
+.. option:: --help
+
+
+----
+HOME
+----
+
+
+To find out more information please check:
+`http://libmemcached.org/ <http://libmemcached.org/>`_
+
+
+------
+AUTHOR
+------
+
+
+Brian Aker, <brian@tangent.org>
+
+--------
+SEE ALSO
+--------
+
+
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+
diff --git a/docs/bin/memparse.rst b/docs/bin/memparse.rst
new file mode 100644 (file)
index 0000000..c50c5f0
--- /dev/null
@@ -0,0 +1,56 @@
+=================================
+memparse - Parse an option string
+=================================
+
+
+Copies files to a collection of memcached servers
+
+
+--------
+SYNOPSIS
+--------
+
+memparse [options] "option string"
+
+.. program:: memparse
+
+
+-----------
+DESCRIPTION
+-----------
+
+
+:program:`memparse` can be used to validate an option string.
+
+-------
+OPTIONS
+-------
+
+For a full list of operations run the tool with the option:
+
+.. option:: --help
+
+
+----
+HOME
+----
+
+
+To find out more information please check:
+`http://libmemcached.org/ <http://libmemcached.org/>`_
+
+
+------
+AUTHOR
+------
+
+
+Brian Aker, <brian@tangent.org>
+
+--------
+SEE ALSO
+--------
+
+
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+
diff --git a/docs/bin/memping.rst b/docs/bin/memping.rst
new file mode 100644 (file)
index 0000000..5a78429
--- /dev/null
@@ -0,0 +1,61 @@
+===============================================
+memping - Test to see if a server is available.
+===============================================
+
+
+--------
+SYNOPSIS
+--------
+
+memping [options] [server]
+
+.. program:: memping
+
+
+-----------
+DESCRIPTION
+-----------
+
+
+:program:`memping` can be used to ping a memcached server to see if it is taking connections.
+
+-------
+OPTIONS
+-------
+
+
+You can specify servers via the option:
+
+.. option:: --servers
+
+or via the environment variable:
+
+.. envvar:: `MEMCACHED_SERVERS`
+
+If you do not specify either these, the final value in the command line list is the name of a server(s).
+
+For a full list of operations run the tool with the option:
+
+.. option:: --help
+
+
+----
+HOME
+----
+
+
+To find out more information please check:
+`http://libmemcached.org/ <http://libmemcached.org/>`_
+
+
+------
+AUTHOR
+------
+
+Brian Aker, <brian@tangent.org>
+
+--------
+SEE ALSO
+--------
+
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
diff --git a/docs/bin/memtouch.rst b/docs/bin/memtouch.rst
new file mode 100644 (file)
index 0000000..3f7cd1c
--- /dev/null
@@ -0,0 +1,63 @@
+=========================
+memtouch - Touches a key.
+=========================
+
+
+--------
+SYNOPSIS
+--------
+
+memtouch [options] key
+
+.. program:: memtouch
+
+
+-----------
+DESCRIPTION
+-----------
+
+
+:program:`memtouch` does a "touch" on the specified key.
+
+-------
+OPTIONS
+-------
+
+
+You can specify servers via the option:
+
+.. option:: --servers
+
+or via the environment variable:
+
+.. envvar:: `MEMCACHED_SERVERS`
+
+If you do not specify either these, the final value in the command line list is the name of a server(s).
+
+For a full list of operations run the tool with the option:
+
+.. option:: --help
+
+
+----
+HOME
+----
+
+
+To find out more information please check:
+`http://libmemcached.org/ <http://libmemcached.org/>`_
+
+
+------
+AUTHOR
+------
+
+Brian Aker, <brian@tangent.org>
+
+--------
+SEE ALSO
+--------
+
+
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+
index 5686ad04fbe1337cc95ad1c15ca9b50abb873374..08b6f639eeb064e0edfd7fc050b3f8177b3e6a34 100644 (file)
@@ -353,4 +353,8 @@ man_pages = [
   ('bin/memaslap', 'memaslap', u'libmemcached Documentation', [u'Brian Aker'], 1),
   ('bin/memslap', 'memslap', u'libmemcached Documentation', [u'Brian Aker'], 1),
   ('bin/memstat', 'memstat', u'libmemcached Documentation', [u'Brian Aker'], 1),
+  ('bin/memexist', 'memexist', u'libmemcached Documentation', [u'Brian Aker'], 1),
+  ('bin/memparse', 'memparse', u'libmemcached Documentation', [u'Brian Aker'], 1),
+  ('bin/memping', 'memping', u'libmemcached Documentation', [u'Brian Aker'], 1),
+  ('bin/memtouch', 'memtouch', u'libmemcached Documentation', [u'Brian Aker'], 1),
   ]
index 286848e59747f8925733cdbfedc231fae1a456bf..e0dba59b8adb18bca6737750ab69c854eeeb59cd 100644 (file)
@@ -129,6 +129,10 @@ Client Applications
    bin/memslap
    bin/memaslap
    bin/memstat
+   bin/memexist.rst
+   bin/memparse.rst
+   bin/memping.rst
+   bin/memtouch.rst
 
 ----------
 Libhashkit
index ae5e7baeb1c868c42f76f08a4b02ce8bb23d98f1..6ec518148cd300ac8e41cb2b6ea1481ffb98962a 100644 (file)
@@ -60,10 +60,7 @@ copy is made of structure so the list provided (and any operations on
 the list) are not saved.
 
 :c:func:`memcached_server_by_key()` allows you to provide a key and retrieve the
-server which would be used for assignment. This structure is cloned
-from its original structure and must be freed. If NULL is returned you
-should consult \*error. The returning structure should be freed with
-:c:func:`memcached_server_free()`.
+server which would be used for assignment.
 
 :c:func:`memcached_server_get_last_disconnect()` returns a pointer to the last 
 server for which there was a connection problem. It does not mean this 
index 5aa59f8852e048b098ea8ade94a651b4d4b3947b..8561c9594218084a054884ace674406afb71c633 100644 (file)
 
 void get_world(Framework *world)
 {
+  if (getenv("LIBMEMCACHED_SERVER_NUMBER"))
+  {
+    int set_count= atoi(getenv("LIBMEMCACHED_SERVER_NUMBER"));
+    assert(set_count >= 0);
+    world->servers().set_count(set_count);
+  }
+  else
+  {
+    world->servers().set_count(8);
+  }
+
   world->collections= collection;
 
   world->_create= (test_callback_create_fn*)world_create;
index 83552304554c976ed6426e3d77c2ae0038c97832..4411d77f22129ed07e8bef1accd197b186c7b4c7 100644 (file)
@@ -43,7 +43,6 @@
 
 #include <tests/libmemcached-1.0/generate.h>
 #include <tests/libmemcached-1.0/fetch_all_results.h>
-#include "tests/libmemcached-1.0/servers_to_create.h"
 #include "tests/libmemcached-1.0/callback_counter.h"
 
 #include "clients/generator.h"
@@ -113,7 +112,7 @@ test_return_t generate_data_with_stats(memcached_st *memc)
   memcached_stat_st *stat_p= memcached_stat(memc, NULL, &rc);
   test_true(stat_p);
 
-  for (uint32_t host_index= 0; host_index < SERVERS_TO_CREATE; host_index++)
+  for (uint32_t host_index= 0; host_index < memcached_server_count(memc); host_index++)
   {
     /* This test was changes so that "make test" would work properlly */
     if (DEBUG)
index 279e2a39593fca45490255ae26b89e71d70c0b53..48a03695468003e5b58ddb85a3226144cd987111 100644 (file)
@@ -25,7 +25,6 @@ noinst_HEADERS+= \
                 tests/libmemcached-1.0/generate.h \
                 tests/libmemcached-1.0/haldenbrand.h \
                 tests/libmemcached-1.0/mem_functions.h \
-                tests/libmemcached-1.0/servers_to_create.h \
                 tests/libmemcached-1.0/setup_and_teardowns.h \
                 tests/libmemcached-1.0/stat.h \
                 tests/namespace.h \
index ef7725e7ec82c741c7388f9d8d2ef5b60d5b875e..1f48aa13b5a05f86f9b7feb91e1e3cc5e3dc725b 100644 (file)
@@ -79,8 +79,6 @@ using namespace libtest;
 
 #include "tests/hash_results.h"
 
-#include "tests/libmemcached-1.0/servers_to_create.h"
-
 #include "tests/libmemcached-1.0/callback_counter.h"
 #include "tests/libmemcached-1.0/fetch_all_results.h"
 #include "tests/libmemcached-1.0/mem_functions.h"
diff --git a/tests/libmemcached-1.0/servers_to_create.h b/tests/libmemcached-1.0/servers_to_create.h
deleted file mode 100644 (file)
index 45b7641..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
- *  Libmemcached Client and Server 
- *
- *  Copyright (C) 2012 Data Differential, http://datadifferential.com/
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are
- *  met:
- *
- *      * Redistributions of source code must retain the above copyright
- *  notice, this list of conditions and the following disclaimer.
- *
- *      * Redistributions in binary form must reproduce the above
- *  copyright notice, this list of conditions and the following disclaimer
- *  in the documentation and/or other materials provided with the
- *  distribution.
- *
- *      * The names of its contributors may not be used to endorse or
- *  promote products derived from this software without specific prior
- *  written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#pragma once
-#define SERVERS_TO_CREATE 5