<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Apache Portable Runtime: apr_memcache.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.7.3 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Apache Portable Runtime</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li id="searchli"> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>apr_memcache.h</h1> </div> </div> <div class="contents"> <a href="apr__memcache_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Licensed to the Apache Software Foundation (ASF) under one or more</span> <a name="l00002"></a>00002 <span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span> <a name="l00003"></a>00003 <span class="comment"> * this work for additional information regarding copyright ownership.</span> <a name="l00004"></a>00004 <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span> <a name="l00005"></a>00005 <span class="comment"> * (the "License"); you may not use this file except in compliance with</span> <a name="l00006"></a>00006 <span class="comment"> * the License. You may obtain a copy of the License at</span> <a name="l00007"></a>00007 <span class="comment"> *</span> <a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span> <a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span> <a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> <a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span> <a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span> <a name="l00015"></a>00015 <span class="comment"> */</span> <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="preprocessor">#ifndef APR_MEMCACHE_H</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_MEMCACHE_H</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="comment"></span> <a name="l00020"></a>00020 <span class="comment">/**</span> <a name="l00021"></a>00021 <span class="comment"> * @file apr_memcache.h</span> <a name="l00022"></a>00022 <span class="comment"> * @brief Client interface for memcached</span> <a name="l00023"></a>00023 <span class="comment"> * @remark To use this interface you must have a separate memcached</span> <a name="l00024"></a>00024 <span class="comment"> * server running. See the memcached website at http://www.danga.com/memcached/</span> <a name="l00025"></a>00025 <span class="comment"> * for more information.</span> <a name="l00026"></a>00026 <span class="comment"> */</span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="apr_8h.html" title="APR Platform Definitions.">apr.h</a>"</span> <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="apr__pools_8h.html" title="APR memory allocation.">apr_pools.h</a>"</span> <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="apr__time_8h.html" title="APR Time Library.">apr_time.h</a>"</span> <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="apr__strings_8h.html" title="APR Strings library.">apr_strings.h</a>"</span> <a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="apr__network__io_8h.html" title="APR Network library.">apr_network_io.h</a>"</span> <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="apr__ring_8h.html" title="APR Rings.">apr_ring.h</a>"</span> <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="apr__buckets_8h.html" title="APR-UTIL Buckets/Bucket Brigades.">apr_buckets.h</a>"</span> <a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="apr__reslist_8h.html" title="APR-UTIL Resource List Routines.">apr_reslist.h</a>"</span> <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="apr__hash_8h.html" title="APR Hash Tables.">apr_hash.h</a>"</span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00039"></a>00039 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00040"></a>00040 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span> <a name="l00041"></a>00041 <span class="comment"></span> <a name="l00042"></a>00042 <span class="comment">/**</span> <a name="l00043"></a>00043 <span class="comment"> * @defgroup APR_Util_MC Memcached Client Routines</span> <a name="l00044"></a>00044 <span class="comment"> * @ingroup APR_Util</span> <a name="l00045"></a>00045 <span class="comment"> * @{</span> <a name="l00046"></a>00046 <span class="comment"> */</span> <a name="l00047"></a>00047 <span class="comment"></span> <a name="l00048"></a>00048 <span class="comment">/** Specifies the status of a memcached server */</span> <a name="l00049"></a><a class="code" href="group___a_p_r___util___m_c.html#ga3b18c7c3f0ecabb930b78aa549c2e2e8">00049</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00050"></a>00050 { <a name="l00051"></a><a class="code" href="group___a_p_r___util___m_c.html#gga3b18c7c3f0ecabb930b78aa549c2e2e8a211c8d3d7a4a187b5c8f936a6929d007">00051</a> <a class="code" href="group___a_p_r___util___m_c.html#gga3b18c7c3f0ecabb930b78aa549c2e2e8a211c8d3d7a4a187b5c8f936a6929d007">APR_MC_SERVER_LIVE</a>, <span class="comment">/**< Server is alive and responding to requests */</span> <a name="l00052"></a><a class="code" href="group___a_p_r___util___m_c.html#gga3b18c7c3f0ecabb930b78aa549c2e2e8a6dffa918006f926e0fdf0074f4bdac28">00052</a> <a class="code" href="group___a_p_r___util___m_c.html#gga3b18c7c3f0ecabb930b78aa549c2e2e8a6dffa918006f926e0fdf0074f4bdac28">APR_MC_SERVER_DEAD</a> <span class="comment">/**< Server is not responding to requests */</span> <a name="l00053"></a>00053 } <a class="code" href="group___a_p_r___util___m_c.html#ga3b18c7c3f0ecabb930b78aa549c2e2e8">apr_memcache_server_status_t</a>; <a name="l00054"></a>00054 <span class="comment"></span> <a name="l00055"></a>00055 <span class="comment">/** Opaque memcache client connection object */</span> <a name="l00056"></a><a class="code" href="group___a_p_r___util___m_c.html#gac4fabf6e3b3efb959eca48f473b73825">00056</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group___a_p_r___util___m_c.html#gac4fabf6e3b3efb959eca48f473b73825">apr_memcache_conn_t</a> <a class="code" href="group___a_p_r___util___m_c.html#gac4fabf6e3b3efb959eca48f473b73825">apr_memcache_conn_t</a>; <a name="l00057"></a>00057 <span class="comment"></span> <a name="l00058"></a>00058 <span class="comment">/** Memcache Server Info Object */</span> <a name="l00059"></a><a class="code" href="group___a_p_r___util___m_c.html#gaa7b43f2275de0fc700cc05e2467bbc4b">00059</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> <a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a>; <a name="l00060"></a><a class="code" href="structapr__memcache__server__t.html">00060</a> <span class="keyword">struct </span><a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> <a name="l00061"></a>00061 { <a name="l00062"></a><a class="code" href="structapr__memcache__server__t.html#a3f0cbe5cde09d28791f8a8950258b305">00062</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structapr__memcache__server__t.html#a3f0cbe5cde09d28791f8a8950258b305">host</a>; <span class="comment">/**< Hostname of this Server */</span> <a name="l00063"></a><a class="code" href="structapr__memcache__server__t.html#aade2ee234b229b6711a80fe2a3de853b">00063</a> <a class="code" href="group__apr__network__io.html#gaa670a71960f6eb4fe0d0de2a1e7aba03">apr_port_t</a> <a class="code" href="structapr__memcache__server__t.html#aade2ee234b229b6711a80fe2a3de853b">port</a>; <span class="comment">/**< Port of this Server */</span> <a name="l00064"></a><a class="code" href="structapr__memcache__server__t.html#a641c9cd95499a998ba2717ec5f03b174">00064</a> <a class="code" href="group___a_p_r___util___m_c.html#ga3b18c7c3f0ecabb930b78aa549c2e2e8">apr_memcache_server_status_t</a> <a class="code" href="structapr__memcache__server__t.html#a641c9cd95499a998ba2717ec5f03b174">status</a>; <span class="comment">/**< @see apr_memcache_server_status_t */</span> <a name="l00065"></a>00065 <span class="preprocessor">#if APR_HAS_THREADS || defined(DOXYGEN)</span> <a name="l00066"></a><a class="code" href="structapr__memcache__server__t.html#a49f27525b9dd7de3dfb15dba3b86bd05">00066</a> <span class="preprocessor"></span> <a class="code" href="group___a_p_r___util___r_l.html#ga670f6719dfeffe1037e063eaab7b82ac">apr_reslist_t</a> *<a class="code" href="structapr__memcache__server__t.html#a49f27525b9dd7de3dfb15dba3b86bd05">conns</a>; <span class="comment">/**< Resource list of actual client connections */</span> <a name="l00067"></a>00067 <span class="preprocessor">#else</span> <a name="l00068"></a>00068 <span class="preprocessor"></span> <a class="code" href="group___a_p_r___util___m_c.html#gac4fabf6e3b3efb959eca48f473b73825">apr_memcache_conn_t</a> *conn; <a name="l00069"></a>00069 <span class="preprocessor">#endif</span> <a name="l00070"></a>00070 <span class="preprocessor"></span> <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p; <span class="comment">/** Pool to use for private allocations */</span> <a name="l00071"></a>00071 <span class="preprocessor">#if APR_HAS_THREADS</span> <a name="l00072"></a><a class="code" href="structapr__memcache__server__t.html#aab472a87e5f0abe993e565a8e3a72490">00072</a> <span class="preprocessor"></span> <a class="code" href="group__apr__thread__mutex.html#ga95712060ba3a192036416e1ccef1db75">apr_thread_mutex_t</a> *<a class="code" href="structapr__memcache__server__t.html#aab472a87e5f0abe993e565a8e3a72490">lock</a>; <a name="l00073"></a>00073 <span class="preprocessor">#endif</span> <a name="l00074"></a>00074 <span class="preprocessor"></span> <a class="code" href="group__apr__time.html#gadb4bde16055748190eae190c55aa02bb">apr_time_t</a> btime; <a name="l00075"></a>00075 }; <a name="l00076"></a>00076 <a name="l00077"></a>00077 <span class="comment">/* Custom hash callback function prototype, user for server selection.</span> <a name="l00078"></a>00078 <span class="comment">* @param baton user selected baton</span> <a name="l00079"></a>00079 <span class="comment">* @param data data to hash</span> <a name="l00080"></a>00080 <span class="comment">* @param data_len length of data</span> <a name="l00081"></a>00081 <span class="comment">*/</span> <a name="l00082"></a>00082 <span class="keyword">typedef</span> apr_uint32_t (*apr_memcache_hash_func)(<span class="keywordtype">void</span> *baton, <a name="l00083"></a>00083 <span class="keyword">const</span> <span class="keywordtype">char</span> *data, <a name="l00084"></a>00084 <span class="keyword">const</span> apr_size_t data_len); <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> <a class="code" href="structapr__memcache__t.html">apr_memcache_t</a>; <a name="l00087"></a>00087 <a name="l00088"></a>00088 <span class="comment">/* Custom Server Select callback function prototype.</span> <a name="l00089"></a>00089 <span class="comment">* @param baton user selected baton</span> <a name="l00090"></a>00090 <span class="comment">* @param mc memcache instance, use mc->live_servers to select a node</span> <a name="l00091"></a>00091 <span class="comment">* @param hash hash of the selected key.</span> <a name="l00092"></a>00092 <span class="comment">*/</span> <a name="l00093"></a>00093 <span class="keyword">typedef</span> <a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a>* (*apr_memcache_server_func)(<span class="keywordtype">void</span> *baton, <a name="l00094"></a>00094 <a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00095"></a>00095 <span class="keyword">const</span> apr_uint32_t hash); <a name="l00096"></a>00096 <span class="comment"></span> <a name="l00097"></a>00097 <span class="comment">/** Container for a set of memcached servers */</span> <a name="l00098"></a><a class="code" href="structapr__memcache__t.html">00098</a> <span class="keyword">struct </span><a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> <a name="l00099"></a>00099 { <a name="l00100"></a><a class="code" href="structapr__memcache__t.html#aeb0639bc75fd5bc7561ab88f671f75d3">00100</a> apr_uint32_t <a class="code" href="structapr__memcache__t.html#aeb0639bc75fd5bc7561ab88f671f75d3">flags</a>; <span class="comment">/**< Flags, Not currently used */</span> <a name="l00101"></a><a class="code" href="structapr__memcache__t.html#a95d15cfa5b291700cd9a697687eeac73">00101</a> apr_uint16_t <a class="code" href="structapr__memcache__t.html#a95d15cfa5b291700cd9a697687eeac73">nalloc</a>; <span class="comment">/**< Number of Servers Allocated */</span> <a name="l00102"></a><a class="code" href="structapr__memcache__t.html#a94e1353d23d4d02a18a9f0ca0e90005d">00102</a> apr_uint16_t <a class="code" href="structapr__memcache__t.html#a94e1353d23d4d02a18a9f0ca0e90005d">ntotal</a>; <span class="comment">/**< Number of Servers Added */</span> <a name="l00103"></a><a class="code" href="structapr__memcache__t.html#a85f916183d0aae6aaa88251edc7a1f81">00103</a> <a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> **<a class="code" href="structapr__memcache__t.html#a85f916183d0aae6aaa88251edc7a1f81">live_servers</a>; <span class="comment">/**< Array of Servers */</span> <a name="l00104"></a>00104 <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p; <span class="comment">/** Pool to use for allocations */</span> <a name="l00105"></a><a class="code" href="structapr__memcache__t.html#a26614ee9cfdc014d7e5ea46df253193a">00105</a> <span class="keywordtype">void</span> *<a class="code" href="structapr__memcache__t.html#a26614ee9cfdc014d7e5ea46df253193a">hash_baton</a>; <a name="l00106"></a>00106 apr_memcache_hash_func hash_func; <a name="l00107"></a>00107 <span class="keywordtype">void</span> *server_baton; <a name="l00108"></a>00108 apr_memcache_server_func server_func; <a name="l00109"></a>00109 }; <a name="l00110"></a>00110 <span class="comment"></span> <a name="l00111"></a>00111 <span class="comment">/** Returned Data from a multiple get */</span> <a name="l00112"></a><a class="code" href="structapr__memcache__value__t.html">00112</a> <span class="keyword">typedef</span> <span class="keyword">struct</span> <a name="l00113"></a>00113 { <a name="l00114"></a>00114 <a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> status; <a name="l00115"></a>00115 <span class="keyword">const</span> <span class="keywordtype">char</span>* key; <a name="l00116"></a>00116 apr_size_t len; <a name="l00117"></a>00117 <span class="keywordtype">char</span> *data; <a name="l00118"></a>00118 apr_uint16_t flags; <a name="l00119"></a>00119 } <a class="code" href="structapr__memcache__value__t.html">apr_memcache_value_t</a>; <a name="l00120"></a>00120 <span class="comment"></span> <a name="l00121"></a>00121 <span class="comment">/**</span> <a name="l00122"></a>00122 <span class="comment"> * Creates a crc32 hash used to split keys between servers</span> <a name="l00123"></a>00123 <span class="comment"> * @param mc The memcache client object to use</span> <a name="l00124"></a>00124 <span class="comment"> * @param data Data to be hashed</span> <a name="l00125"></a>00125 <span class="comment"> * @param data_len Length of the data to use</span> <a name="l00126"></a>00126 <span class="comment"> * @return crc32 hash of data</span> <a name="l00127"></a>00127 <span class="comment"> * @remark The crc32 hash is not compatible with old memcached clients.</span> <a name="l00128"></a>00128 <span class="comment"> */</span> <a name="l00129"></a>00129 APU_DECLARE(apr_uint32_t) <a class="code" href="group___a_p_r___util___m_c.html#ga945a83f7f56800b18243ec5933c16593">apr_memcache_hash</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00130"></a>00130 const <span class="keywordtype">char</span> *data, <a name="l00131"></a>00131 const apr_size_t data_len); <a name="l00132"></a>00132 <span class="comment"></span> <a name="l00133"></a>00133 <span class="comment">/**</span> <a name="l00134"></a>00134 <span class="comment"> * Pure CRC32 Hash. Used by some clients.</span> <a name="l00135"></a>00135 <span class="comment"> */</span> <a name="l00136"></a>00136 APU_DECLARE(apr_uint32_t) <a class="code" href="group___a_p_r___util___m_c.html#ga103ab58d59ca8e4668d31631ee0d3222">apr_memcache_hash_crc32</a>(<span class="keywordtype">void</span> *baton, <a name="l00137"></a>00137 const <span class="keywordtype">char</span> *data, <a name="l00138"></a>00138 const apr_size_t data_len); <a name="l00139"></a>00139 <span class="comment"></span> <a name="l00140"></a>00140 <span class="comment">/**</span> <a name="l00141"></a>00141 <span class="comment"> * hash compatible with the standard Perl Client.</span> <a name="l00142"></a>00142 <span class="comment"> */</span> <a name="l00143"></a>00143 APU_DECLARE(apr_uint32_t) <a class="code" href="group___a_p_r___util___m_c.html#ga6e2fa2e270332d2cdb44abf775f8022e">apr_memcache_hash_default</a>(<span class="keywordtype">void</span> *baton, <a name="l00144"></a>00144 const <span class="keywordtype">char</span> *data, <a name="l00145"></a>00145 const apr_size_t data_len); <a name="l00146"></a>00146 <span class="comment"></span> <a name="l00147"></a>00147 <span class="comment">/**</span> <a name="l00148"></a>00148 <span class="comment"> * Picks a server based on a hash</span> <a name="l00149"></a>00149 <span class="comment"> * @param mc The memcache client object to use</span> <a name="l00150"></a>00150 <span class="comment"> * @param hash Hashed value of a Key</span> <a name="l00151"></a>00151 <span class="comment"> * @return server that controls specified hash</span> <a name="l00152"></a>00152 <span class="comment"> * @see apr_memcache_hash</span> <a name="l00153"></a>00153 <span class="comment"> */</span> <a name="l00154"></a>00154 APU_DECLARE(<a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *) <a class="code" href="group___a_p_r___util___m_c.html#ga22fe48405f08eaded915f5205d9fc221">apr_memcache_find_server_hash</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00155"></a>00155 const apr_uint32_t hash); <a name="l00156"></a>00156 <span class="comment"></span> <a name="l00157"></a>00157 <span class="comment">/**</span> <a name="l00158"></a>00158 <span class="comment"> * server selection compatible with the standard Perl Client.</span> <a name="l00159"></a>00159 <span class="comment"> */</span> <a name="l00160"></a>00160 APU_DECLARE(<a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *) <a class="code" href="group___a_p_r___util___m_c.html#ga0c1f483d299b083e0c06e9ec1c9eb316">apr_memcache_find_server_hash_default</a>(<span class="keywordtype">void</span> *baton, <a name="l00161"></a>00161 <a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00162"></a>00162 const apr_uint32_t hash); <a name="l00163"></a>00163 <span class="comment"></span> <a name="l00164"></a>00164 <span class="comment">/**</span> <a name="l00165"></a>00165 <span class="comment"> * Adds a server to a client object</span> <a name="l00166"></a>00166 <span class="comment"> * @param mc The memcache client object to use</span> <a name="l00167"></a>00167 <span class="comment"> * @param server Server to add</span> <a name="l00168"></a>00168 <span class="comment"> * @remark Adding servers is not thread safe, and should be done once at startup.</span> <a name="l00169"></a>00169 <span class="comment"> * @warning Changing servers after startup may cause keys to go to</span> <a name="l00170"></a>00170 <span class="comment"> * different servers.</span> <a name="l00171"></a>00171 <span class="comment"> */</span> <a name="l00172"></a>00172 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga9d6381d9d9f8f83f4fa5450cc8066590">apr_memcache_add_server</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00173"></a>00173 <a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *server); <a name="l00174"></a>00174 <a name="l00175"></a>00175 <span class="comment"></span> <a name="l00176"></a>00176 <span class="comment">/**</span> <a name="l00177"></a>00177 <span class="comment"> * Finds a Server object based on a hostname/port pair</span> <a name="l00178"></a>00178 <span class="comment"> * @param mc The memcache client object to use</span> <a name="l00179"></a>00179 <span class="comment"> * @param host Hostname of the server</span> <a name="l00180"></a>00180 <span class="comment"> * @param port Port of the server</span> <a name="l00181"></a>00181 <span class="comment"> * @return Server with matching Hostname and Port, or NULL if none was found.</span> <a name="l00182"></a>00182 <span class="comment"> */</span> <a name="l00183"></a>00183 APU_DECLARE(<a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *) <a class="code" href="group___a_p_r___util___m_c.html#ga76b77e042ced1bae3b23f71696482a7e">apr_memcache_find_server</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00184"></a>00184 const <span class="keywordtype">char</span> *host, <a name="l00185"></a>00185 <a class="code" href="group__apr__network__io.html#gaa670a71960f6eb4fe0d0de2a1e7aba03">apr_port_t</a> port); <a name="l00186"></a>00186 <span class="comment"></span> <a name="l00187"></a>00187 <span class="comment">/**</span> <a name="l00188"></a>00188 <span class="comment"> * Enables a Server for use again</span> <a name="l00189"></a>00189 <span class="comment"> * @param mc The memcache client object to use</span> <a name="l00190"></a>00190 <span class="comment"> * @param ms Server to Activate</span> <a name="l00191"></a>00191 <span class="comment"> */</span> <a name="l00192"></a>00192 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#gafe4824659cbe261409b57a48d85c34e3">apr_memcache_enable_server</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00193"></a>00193 <a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *ms); <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="comment"></span> <a name="l00196"></a>00196 <span class="comment">/**</span> <a name="l00197"></a>00197 <span class="comment"> * Disable a Server</span> <a name="l00198"></a>00198 <span class="comment"> * @param mc The memcache client object to use</span> <a name="l00199"></a>00199 <span class="comment"> * @param ms Server to Disable</span> <a name="l00200"></a>00200 <span class="comment"> */</span> <a name="l00201"></a>00201 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#gae8a982e8794a08a78264ec3a966797fc">apr_memcache_disable_server</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00202"></a>00202 <a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *ms); <a name="l00203"></a>00203 <span class="comment"></span> <a name="l00204"></a>00204 <span class="comment">/**</span> <a name="l00205"></a>00205 <span class="comment"> * Creates a new Server Object</span> <a name="l00206"></a>00206 <span class="comment"> * @param p Pool to use</span> <a name="l00207"></a>00207 <span class="comment"> * @param host hostname of the server</span> <a name="l00208"></a>00208 <span class="comment"> * @param port port of the server</span> <a name="l00209"></a>00209 <span class="comment"> * @param min minimum number of client sockets to open</span> <a name="l00210"></a>00210 <span class="comment"> * @param smax soft maximum number of client connections to open</span> <a name="l00211"></a>00211 <span class="comment"> * @param max hard maximum number of client connections</span> <a name="l00212"></a>00212 <span class="comment"> * @param ttl time to live in microseconds of a client connection</span> <a name="l00213"></a>00213 <span class="comment"> * @param ns location of the new server object</span> <a name="l00214"></a>00214 <span class="comment"> * @see apr_reslist_create</span> <a name="l00215"></a>00215 <span class="comment"> * @remark min, smax, and max are only used when APR_HAS_THREADS</span> <a name="l00216"></a>00216 <span class="comment"> */</span> <a name="l00217"></a>00217 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga18ddd72bc1ab5edb0a08a8f26f193bd3">apr_memcache_server_create</a>(<a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p, <a name="l00218"></a>00218 const <span class="keywordtype">char</span> *host, <a name="l00219"></a>00219 <a class="code" href="group__apr__network__io.html#gaa670a71960f6eb4fe0d0de2a1e7aba03">apr_port_t</a> port, <a name="l00220"></a>00220 apr_uint32_t min, <a name="l00221"></a>00221 apr_uint32_t smax, <a name="l00222"></a>00222 apr_uint32_t max, <a name="l00223"></a>00223 apr_uint32_t ttl, <a name="l00224"></a>00224 <a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> **ns);<span class="comment"></span> <a name="l00225"></a>00225 <span class="comment">/**</span> <a name="l00226"></a>00226 <span class="comment"> * Creates a new memcached client object</span> <a name="l00227"></a>00227 <span class="comment"> * @param p Pool to use</span> <a name="l00228"></a>00228 <span class="comment"> * @param max_servers maximum number of servers</span> <a name="l00229"></a>00229 <span class="comment"> * @param flags Not currently used</span> <a name="l00230"></a>00230 <span class="comment"> * @param mc location of the new memcache client object</span> <a name="l00231"></a>00231 <span class="comment"> */</span> <a name="l00232"></a>00232 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga5a510d8ac3f5bf12cf2da1a445f4854b">apr_memcache_create</a>(<a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p, <a name="l00233"></a>00233 apr_uint16_t max_servers, <a name="l00234"></a>00234 apr_uint32_t flags, <a name="l00235"></a>00235 <a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> **mc); <a name="l00236"></a>00236 <span class="comment"></span> <a name="l00237"></a>00237 <span class="comment">/**</span> <a name="l00238"></a>00238 <span class="comment"> * Gets a value from the server, allocating the value out of p</span> <a name="l00239"></a>00239 <span class="comment"> * @param mc client to use</span> <a name="l00240"></a>00240 <span class="comment"> * @param p Pool to use</span> <a name="l00241"></a>00241 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00242"></a>00242 <span class="comment"> * @param baton location of the allocated value</span> <a name="l00243"></a>00243 <span class="comment"> * @param len length of data at baton</span> <a name="l00244"></a>00244 <span class="comment"> * @param flags any flags set by the client for this key</span> <a name="l00245"></a>00245 <span class="comment"> * @return </span> <a name="l00246"></a>00246 <span class="comment"> */</span> <a name="l00247"></a>00247 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#gac41597ff979e7a181da459398196196f">apr_memcache_getp</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00248"></a>00248 <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p, <a name="l00249"></a>00249 const <span class="keywordtype">char</span>* key, <a name="l00250"></a>00250 <span class="keywordtype">char</span> **baton, <a name="l00251"></a>00251 apr_size_t *len, <a name="l00252"></a>00252 apr_uint16_t *flags); <a name="l00253"></a>00253 <a name="l00254"></a>00254 <span class="comment"></span> <a name="l00255"></a>00255 <span class="comment">/**</span> <a name="l00256"></a>00256 <span class="comment"> * Add a key to a hash for a multiget query</span> <a name="l00257"></a>00257 <span class="comment"> * if the hash (*value) is NULL it will be created</span> <a name="l00258"></a>00258 <span class="comment"> * @param data_pool pool from where the hash and their items are created from</span> <a name="l00259"></a>00259 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00260"></a>00260 <span class="comment"> * @param values hash of keys and values that this key will be added to</span> <a name="l00261"></a>00261 <span class="comment"> * @return</span> <a name="l00262"></a>00262 <span class="comment"> */</span> <a name="l00263"></a>00263 APU_DECLARE(<span class="keywordtype">void</span>) <a class="code" href="group___a_p_r___util___m_c.html#gac94d47eedb9baebe823b2e5eeed54157">apr_memcache_add_multget_key</a>(<a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *data_pool, <a name="l00264"></a>00264 const <span class="keywordtype">char</span>* key, <a name="l00265"></a>00265 <a class="code" href="group__apr__hash.html#ga72ec09b8bde6d874c36bd49df915fff6">apr_hash_t</a> **values); <a name="l00266"></a>00266 <span class="comment"></span> <a name="l00267"></a>00267 <span class="comment">/**</span> <a name="l00268"></a>00268 <span class="comment"> * Gets multiple values from the server, allocating the values out of p</span> <a name="l00269"></a>00269 <span class="comment"> * @param mc client to use</span> <a name="l00270"></a>00270 <span class="comment"> * @param temp_pool Pool used for temporary allocations. May be cleared inside this</span> <a name="l00271"></a>00271 <span class="comment"> * call.</span> <a name="l00272"></a>00272 <span class="comment"> * @param data_pool Pool used to allocate data for the returned values.</span> <a name="l00273"></a>00273 <span class="comment"> * @param values hash of apr_memcache_value_t keyed by strings, contains the</span> <a name="l00274"></a>00274 <span class="comment"> * result of the multiget call.</span> <a name="l00275"></a>00275 <span class="comment"> * @return</span> <a name="l00276"></a>00276 <span class="comment"> */</span> <a name="l00277"></a>00277 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga4a5beadb98954331896e95c35324b0fc">apr_memcache_multgetp</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00278"></a>00278 <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *temp_pool, <a name="l00279"></a>00279 <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *data_pool, <a name="l00280"></a>00280 <a class="code" href="group__apr__hash.html#ga72ec09b8bde6d874c36bd49df915fff6">apr_hash_t</a> *values); <a name="l00281"></a>00281 <span class="comment"></span> <a name="l00282"></a>00282 <span class="comment">/**</span> <a name="l00283"></a>00283 <span class="comment"> * Sets a value by key on the server</span> <a name="l00284"></a>00284 <span class="comment"> * @param mc client to use</span> <a name="l00285"></a>00285 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00286"></a>00286 <span class="comment"> * @param baton data to store on the server</span> <a name="l00287"></a>00287 <span class="comment"> * @param data_size length of data at baton</span> <a name="l00288"></a>00288 <span class="comment"> * @param timeout time in seconds for the data to live on the server</span> <a name="l00289"></a>00289 <span class="comment"> * @param flags any flags set by the client for this key</span> <a name="l00290"></a>00290 <span class="comment"> * @bug timeout is not implemented</span> <a name="l00291"></a>00291 <span class="comment"> * @bug timeouts for apr must be prototyped in apr_interval_time_t;</span> <a name="l00292"></a>00292 <span class="comment"> * this changes in 2.0</span> <a name="l00293"></a>00293 <span class="comment"> */</span> <a name="l00294"></a>00294 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#gaa5bbe2c60302a689773d6a70da8f99fb">apr_memcache_set</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00295"></a>00295 const <span class="keywordtype">char</span> *key, <a name="l00296"></a>00296 <span class="keywordtype">char</span> *baton, <a name="l00297"></a>00297 const apr_size_t data_size, <a name="l00298"></a>00298 apr_uint32_t timeout, <a name="l00299"></a>00299 apr_uint16_t flags); <a name="l00300"></a>00300 <span class="comment"></span> <a name="l00301"></a>00301 <span class="comment">/**</span> <a name="l00302"></a>00302 <span class="comment"> * Adds value by key on the server</span> <a name="l00303"></a>00303 <span class="comment"> * @param mc client to use</span> <a name="l00304"></a>00304 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00305"></a>00305 <span class="comment"> * @param baton data to store on the server</span> <a name="l00306"></a>00306 <span class="comment"> * @param data_size length of data at baton</span> <a name="l00307"></a>00307 <span class="comment"> * @param timeout time for the data to live on the server</span> <a name="l00308"></a>00308 <span class="comment"> * @param flags any flags set by the client for this key</span> <a name="l00309"></a>00309 <span class="comment"> * @return APR_SUCCESS if the key was added, APR_EEXIST if the key </span> <a name="l00310"></a>00310 <span class="comment"> * already exists on the server.</span> <a name="l00311"></a>00311 <span class="comment"> */</span> <a name="l00312"></a>00312 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga3c150706f243bf2b9cd89152d416ee56">apr_memcache_add</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00313"></a>00313 const <span class="keywordtype">char</span> *key, <a name="l00314"></a>00314 <span class="keywordtype">char</span> *baton, <a name="l00315"></a>00315 const apr_size_t data_size, <a name="l00316"></a>00316 apr_uint32_t timeout, <a name="l00317"></a>00317 apr_uint16_t flags); <a name="l00318"></a>00318 <span class="comment"></span> <a name="l00319"></a>00319 <span class="comment">/**</span> <a name="l00320"></a>00320 <span class="comment"> * Replaces value by key on the server</span> <a name="l00321"></a>00321 <span class="comment"> * @param mc client to use</span> <a name="l00322"></a>00322 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00323"></a>00323 <span class="comment"> * @param baton data to store on the server</span> <a name="l00324"></a>00324 <span class="comment"> * @param data_size length of data at baton</span> <a name="l00325"></a>00325 <span class="comment"> * @param timeout time for the data to live on the server</span> <a name="l00326"></a>00326 <span class="comment"> * @param flags any flags set by the client for this key</span> <a name="l00327"></a>00327 <span class="comment"> * @return APR_SUCCESS if the key was added, APR_EEXIST if the key </span> <a name="l00328"></a>00328 <span class="comment"> * did not exist on the server.</span> <a name="l00329"></a>00329 <span class="comment"> */</span> <a name="l00330"></a>00330 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga0f7b9fdb5d7a0a1feb5642d7778e268d">apr_memcache_replace</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00331"></a>00331 const <span class="keywordtype">char</span> *key, <a name="l00332"></a>00332 <span class="keywordtype">char</span> *baton, <a name="l00333"></a>00333 const apr_size_t data_size, <a name="l00334"></a>00334 apr_uint32_t timeout, <a name="l00335"></a>00335 apr_uint16_t flags);<span class="comment"></span> <a name="l00336"></a>00336 <span class="comment">/**</span> <a name="l00337"></a>00337 <span class="comment"> * Deletes a key from a server</span> <a name="l00338"></a>00338 <span class="comment"> * @param mc client to use</span> <a name="l00339"></a>00339 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00340"></a>00340 <span class="comment"> * @param timeout time for the delete to stop other clients from adding</span> <a name="l00341"></a>00341 <span class="comment"> */</span> <a name="l00342"></a>00342 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga97d2c5be42ef773ba82fd8293b219ece">apr_memcache_delete</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00343"></a>00343 const <span class="keywordtype">char</span> *key, <a name="l00344"></a>00344 apr_uint32_t timeout); <a name="l00345"></a>00345 <span class="comment"></span> <a name="l00346"></a>00346 <span class="comment">/**</span> <a name="l00347"></a>00347 <span class="comment"> * Increments a value</span> <a name="l00348"></a>00348 <span class="comment"> * @param mc client to use</span> <a name="l00349"></a>00349 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00350"></a>00350 <span class="comment"> * @param n number to increment by</span> <a name="l00351"></a>00351 <span class="comment"> * @param nv new value after incrementing</span> <a name="l00352"></a>00352 <span class="comment"> */</span> <a name="l00353"></a>00353 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga2cfc95fe963f2d4190996153a2ddb748">apr_memcache_incr</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00354"></a>00354 const <span class="keywordtype">char</span> *key, <a name="l00355"></a>00355 apr_int32_t n, <a name="l00356"></a>00356 apr_uint32_t *nv); <a name="l00357"></a>00357 <span class="comment"></span> <a name="l00358"></a>00358 <span class="comment">/**</span> <a name="l00359"></a>00359 <span class="comment"> * Decrements a value</span> <a name="l00360"></a>00360 <span class="comment"> * @param mc client to use</span> <a name="l00361"></a>00361 <span class="comment"> * @param key null terminated string containing the key</span> <a name="l00362"></a>00362 <span class="comment"> * @param n number to decrement by</span> <a name="l00363"></a>00363 <span class="comment"> * @param new_value new value after decrementing</span> <a name="l00364"></a>00364 <span class="comment"> */</span> <a name="l00365"></a>00365 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#gacf93837a1fd4c3d230644098f3043a39">apr_memcache_decr</a>(<a class="code" href="structapr__memcache__t.html">apr_memcache_t</a> *mc, <a name="l00366"></a>00366 const <span class="keywordtype">char</span> *key, <a name="l00367"></a>00367 apr_int32_t n, <a name="l00368"></a>00368 apr_uint32_t *new_value); <a name="l00369"></a>00369 <span class="comment"></span> <a name="l00370"></a>00370 <span class="comment">/**</span> <a name="l00371"></a>00371 <span class="comment"> * Query a server's version</span> <a name="l00372"></a>00372 <span class="comment"> * @param ms server to query</span> <a name="l00373"></a>00373 <span class="comment"> * @param p Pool to allocate answer from</span> <a name="l00374"></a>00374 <span class="comment"> * @param baton location to store server version string</span> <a name="l00375"></a>00375 <span class="comment"> * @param len length of the server version string</span> <a name="l00376"></a>00376 <span class="comment"> */</span> <a name="l00377"></a>00377 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#ga1d1b9478138b907eb9c10576cb1653ff">apr_memcache_version</a>(<a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *ms, <a name="l00378"></a>00378 <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p, <a name="l00379"></a>00379 <span class="keywordtype">char</span> **baton); <a name="l00380"></a>00380 <a name="l00381"></a><a class="code" href="structapr__memcache__stats__t.html">00381</a> typedef struct <a name="l00382"></a>00382 {<span class="comment"></span> <a name="l00383"></a>00383 <span class="comment"> /** Version string of this server */</span> <a name="l00384"></a><a class="code" href="structapr__memcache__stats__t.html#a5fa17a72064c6b5ae0624f5945fceea7">00384</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structapr__memcache__stats__t.html#a5fa17a72064c6b5ae0624f5945fceea7">version</a>;<span class="comment"></span> <a name="l00385"></a>00385 <span class="comment"> /** Process id of this server process */</span> <a name="l00386"></a><a class="code" href="structapr__memcache__stats__t.html#a8ed498f4a6cbfb55312b8b67ce2689d3">00386</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a8ed498f4a6cbfb55312b8b67ce2689d3">pid</a>;<span class="comment"></span> <a name="l00387"></a>00387 <span class="comment"> /** Number of seconds this server has been running */</span> <a name="l00388"></a><a class="code" href="structapr__memcache__stats__t.html#aec6db8440a51aabfbfaf2130ec5a78bb">00388</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#aec6db8440a51aabfbfaf2130ec5a78bb">uptime</a>;<span class="comment"></span> <a name="l00389"></a>00389 <span class="comment"> /** current UNIX time according to the server */</span> <a name="l00390"></a><a class="code" href="structapr__memcache__stats__t.html#adc02da0e6bfc619cd7eaebfae94404ff">00390</a> <a class="code" href="group__apr__time.html#gadb4bde16055748190eae190c55aa02bb">apr_time_t</a> <a class="code" href="structapr__memcache__stats__t.html#adc02da0e6bfc619cd7eaebfae94404ff">time</a>;<span class="comment"></span> <a name="l00391"></a>00391 <span class="comment"> /** The size of a pointer on the current machine */</span> <a name="l00392"></a><a class="code" href="structapr__memcache__stats__t.html#a01bd7ed7ba82b7a7bf03f9de468fcc2e">00392</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a01bd7ed7ba82b7a7bf03f9de468fcc2e">pointer_size</a>;<span class="comment"></span> <a name="l00393"></a>00393 <span class="comment"> /** Accumulated user time for this process */</span> <a name="l00394"></a><a class="code" href="structapr__memcache__stats__t.html#a4e43e96550407edd29e81ba59706c5b5">00394</a> <a class="code" href="group__apr__time.html#gadb4bde16055748190eae190c55aa02bb">apr_time_t</a> <a class="code" href="structapr__memcache__stats__t.html#a4e43e96550407edd29e81ba59706c5b5">rusage_user</a>;<span class="comment"></span> <a name="l00395"></a>00395 <span class="comment"> /** Accumulated system time for this process */</span> <a name="l00396"></a><a class="code" href="structapr__memcache__stats__t.html#a2eff9899b9cb4ee704fae93af4c5bf76">00396</a> <a class="code" href="group__apr__time.html#gadb4bde16055748190eae190c55aa02bb">apr_time_t</a> <a class="code" href="structapr__memcache__stats__t.html#a2eff9899b9cb4ee704fae93af4c5bf76">rusage_system</a>;<span class="comment"></span> <a name="l00397"></a>00397 <span class="comment"> /** Current number of items stored by the server */</span> <a name="l00398"></a><a class="code" href="structapr__memcache__stats__t.html#abe0f28297441a55d30a6c7c8e0faaea3">00398</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#abe0f28297441a55d30a6c7c8e0faaea3">curr_items</a>;<span class="comment"></span> <a name="l00399"></a>00399 <span class="comment"> /** Total number of items stored by this server */</span> <a name="l00400"></a><a class="code" href="structapr__memcache__stats__t.html#a298fd199bee38cd658d54f6099e9fb58">00400</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a298fd199bee38cd658d54f6099e9fb58">total_items</a>;<span class="comment"></span> <a name="l00401"></a>00401 <span class="comment"> /** Current number of bytes used by this server to store items */</span> <a name="l00402"></a><a class="code" href="structapr__memcache__stats__t.html#a327ed9d43d6df23337101eda379a7870">00402</a> apr_uint64_t <a class="code" href="structapr__memcache__stats__t.html#a327ed9d43d6df23337101eda379a7870">bytes</a>;<span class="comment"></span> <a name="l00403"></a>00403 <span class="comment"> /** Number of open connections */</span> <a name="l00404"></a><a class="code" href="structapr__memcache__stats__t.html#a1db1876674d978f4f70ae465a060bfc2">00404</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a1db1876674d978f4f70ae465a060bfc2">curr_connections</a>;<span class="comment"></span> <a name="l00405"></a>00405 <span class="comment"> /** Total number of connections opened since the server started running */</span> <a name="l00406"></a><a class="code" href="structapr__memcache__stats__t.html#a47413a65552fa02fcc8adb74b3d0b8c0">00406</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a47413a65552fa02fcc8adb74b3d0b8c0">total_connections</a>;<span class="comment"></span> <a name="l00407"></a>00407 <span class="comment"> /** Number of connection structures allocated by the server */</span> <a name="l00408"></a><a class="code" href="structapr__memcache__stats__t.html#ac155c7a510e94b3cd43aea90a05e3cd3">00408</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#ac155c7a510e94b3cd43aea90a05e3cd3">connection_structures</a>;<span class="comment"></span> <a name="l00409"></a>00409 <span class="comment"> /** Cumulative number of retrieval requests */</span> <a name="l00410"></a><a class="code" href="structapr__memcache__stats__t.html#abd9b0fa7bf554436883c8b6a2a89c2a8">00410</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#abd9b0fa7bf554436883c8b6a2a89c2a8">cmd_get</a>;<span class="comment"></span> <a name="l00411"></a>00411 <span class="comment"> /** Cumulative number of storage requests */</span> <a name="l00412"></a><a class="code" href="structapr__memcache__stats__t.html#a4930557b41d879b1b4767862c1693f95">00412</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a4930557b41d879b1b4767862c1693f95">cmd_set</a>;<span class="comment"></span> <a name="l00413"></a>00413 <span class="comment"> /** Number of keys that have been requested and found present */</span> <a name="l00414"></a><a class="code" href="structapr__memcache__stats__t.html#a6d3b60bc77c024259a2e9dfb1e35bfd7">00414</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a6d3b60bc77c024259a2e9dfb1e35bfd7">get_hits</a>;<span class="comment"></span> <a name="l00415"></a>00415 <span class="comment"> /** Number of items that have been requested and not found */</span> <a name="l00416"></a><a class="code" href="structapr__memcache__stats__t.html#affaa2901db1db585fca3cfa77fcb0230">00416</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#affaa2901db1db585fca3cfa77fcb0230">get_misses</a>;<span class="comment"></span> <a name="l00417"></a>00417 <span class="comment"> /** Number of items removed from cache because they passed their</span> <a name="l00418"></a>00418 <span class="comment"> expiration time */</span> <a name="l00419"></a><a class="code" href="structapr__memcache__stats__t.html#ad430486ea11c0e5f7b70c9c2b95a216c">00419</a> apr_uint64_t <a class="code" href="structapr__memcache__stats__t.html#ad430486ea11c0e5f7b70c9c2b95a216c">evictions</a>;<span class="comment"></span> <a name="l00420"></a>00420 <span class="comment"> /** Total number of bytes read by this server */</span> <a name="l00421"></a><a class="code" href="structapr__memcache__stats__t.html#acf5d7892543403de8a48e9276d94b5af">00421</a> apr_uint64_t <a class="code" href="structapr__memcache__stats__t.html#acf5d7892543403de8a48e9276d94b5af">bytes_read</a>;<span class="comment"></span> <a name="l00422"></a>00422 <span class="comment"> /** Total number of bytes sent by this server */</span> <a name="l00423"></a><a class="code" href="structapr__memcache__stats__t.html#a05f5b9a19c330460fe66b79746989094">00423</a> apr_uint64_t <a class="code" href="structapr__memcache__stats__t.html#a05f5b9a19c330460fe66b79746989094">bytes_written</a>;<span class="comment"></span> <a name="l00424"></a>00424 <span class="comment"> /** Number of bytes this server is allowed to use for storage. */</span> <a name="l00425"></a><a class="code" href="structapr__memcache__stats__t.html#afbfa184ab0898d4a897a629c935783b8">00425</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#afbfa184ab0898d4a897a629c935783b8">limit_maxbytes</a>;<span class="comment"></span> <a name="l00426"></a>00426 <span class="comment"> /** Number of threads the server is running (if built with threading) */</span> <a name="l00427"></a><a class="code" href="structapr__memcache__stats__t.html#a4e2a4875902e032a56de9ac58315f372">00427</a> apr_uint32_t <a class="code" href="structapr__memcache__stats__t.html#a4e2a4875902e032a56de9ac58315f372">threads</a>; <a name="l00428"></a>00428 } <a class="code" href="structapr__memcache__stats__t.html">apr_memcache_stats_t</a>; <a name="l00429"></a>00429 <span class="comment"></span> <a name="l00430"></a>00430 <span class="comment">/**</span> <a name="l00431"></a>00431 <span class="comment"> * Query a server for statistics</span> <a name="l00432"></a>00432 <span class="comment"> * @param ms server to query</span> <a name="l00433"></a>00433 <span class="comment"> * @param p Pool to allocate answer from</span> <a name="l00434"></a>00434 <span class="comment"> * @param stats location of the new statistics structure</span> <a name="l00435"></a>00435 <span class="comment"> */</span> <a name="l00436"></a>00436 APU_DECLARE(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group___a_p_r___util___m_c.html#gad81ba4ef97f7dd64e37a0fbb09677859">apr_memcache_stats</a>(<a class="code" href="structapr__memcache__server__t.html">apr_memcache_server_t</a> *ms, <a name="l00437"></a>00437 <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p, <a name="l00438"></a>00438 <a class="code" href="structapr__memcache__stats__t.html">apr_memcache_stats_t</a> **stats); <a name="l00439"></a>00439 <a name="l00440"></a>00440 <span class="comment"></span> <a name="l00441"></a>00441 <span class="comment">/** @} */</span> <a name="l00442"></a>00442 <a name="l00443"></a>00443 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00444"></a>00444 <span class="preprocessor"></span>} <a name="l00445"></a>00445 <span class="preprocessor">#endif</span> <a name="l00446"></a>00446 <span class="preprocessor"></span> <a name="l00447"></a>00447 <span class="preprocessor">#endif </span><span class="comment">/* APR_MEMCACHE_H */</span> </pre></div></div> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Feb 8 2011 for Apache Portable Runtime by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>