1 /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
5 * Copyright (C) 2011 Data Differential, http://datadifferential.com/
6 * Copyright (C) 2006-2009 Brian Aker All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following disclaimer
17 * in the documentation and/or other materials provided with the
20 * * The names of its contributors may not be used to endorse or
21 * promote products derived from this software without specific prior
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 @note these are static and should not change without a call to behavior.
46 bool is_processing_input
:1;
47 bool is_time_for_rebuild
:1;
52 // Everything below here is pretty static.
53 bool auto_eject_hosts
:1;
54 bool binary_protocol
:1;
55 bool buffer_requests
:1;
56 bool hash_with_namespace
:1;
57 bool no_block
:1; // Don't block
59 bool randomize_replica_read
:1;
62 bool use_sort_hosts
:1;
67 bool is_fetching_version
:1;
71 memcached_server_distribution_t distribution
;
76 uint32_t number_of_hosts
;
78 org::libmemcached::Instance
* servers
;
79 org::libmemcached::Instance
* last_disconnected_server
;
82 void *last_disconnected_server
;
86 uint32_t server_failure_limit
;
87 uint32_t io_msg_watermark
;
88 uint32_t io_bytes_watermark
;
89 uint32_t io_key_prefetch
;
90 uint32_t tcp_keepidle
;
92 int32_t connect_timeout
; // How long we will wait on connect() before we will timeout
93 int32_t retry_timeout
;
99 uint32_t number_of_replicas
;
100 memcached_result_st result
;
104 uint32_t continuum_count
; // Ketama
105 uint32_t continuum_points_counter
; // Ketama
106 time_t next_distribution_rebuild
; // Ketama
107 struct memcached_continuum_item_st
*continuum
; // Ketama
110 struct memcached_virtual_bucket_t
*virtual_bucket
;
112 struct memcached_allocator_t allocators
;
114 memcached_clone_fn on_clone
;
115 memcached_cleanup_fn on_cleanup
;
116 memcached_trigger_key_fn get_key_failure
;
117 memcached_trigger_delete_key_fn delete_trigger
;
118 memcached_callback_st
*callbacks
;
119 struct memcached_sasl_st sasl
;
120 struct memcached_error_t
*error_messages
;
121 struct memcached_array_st
*_namespace
;
123 uint32_t initial_pool_size
;
124 uint32_t max_pool_size
;
125 int32_t version
; // This is used by pool and others to determine if the memcached_st is out of date.
126 struct memcached_array_st
*filename
;