2 * Summary: Constants for libmemcached
4 * Copy: See Copyright for the status of this software.
9 #ifndef __MEMCACHED_CONSTANTS_H__
10 #define __MEMCACHED_CONSTANTS_H__
17 #define MEMCACHED_DEFAULT_PORT 11211
18 #define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */
19 #define MEMCACHED_MAX_BUFFER 8196
20 #define MEMCACHED_MAX_HOST_LENGTH 64
21 #define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */
22 #define MEMCACHED_POINTS_PER_SERVER 100
23 #define MEMCACHED_POINTS_PER_SERVER_KETAMA 160
24 #define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This would then set max hosts to 100 */
25 #define MEMCACHED_STRIDE 4
26 #define MEMCACHED_DEFAULT_TIMEOUT 1000
27 #define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should build for in the continuum */
28 #define MEMCACHED_PREFIX_KEY_MAX_SIZE 128
33 MEMCACHED_HOST_LOOKUP_FAILURE
,
34 MEMCACHED_CONNECTION_FAILURE
,
35 MEMCACHED_CONNECTION_BIND_FAILURE
,
36 MEMCACHED_WRITE_FAILURE
,
37 MEMCACHED_READ_FAILURE
,
38 MEMCACHED_UNKNOWN_READ_FAILURE
,
39 MEMCACHED_PROTOCOL_ERROR
,
40 MEMCACHED_CLIENT_ERROR
,
41 MEMCACHED_SERVER_ERROR
,
42 MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
,
43 MEMCACHED_DATA_EXISTS
,
44 MEMCACHED_DATA_DOES_NOT_EXIST
,
48 MEMCACHED_MEMORY_ALLOCATION_FAILURE
,
49 MEMCACHED_PARTIAL_READ
,
50 MEMCACHED_SOME_ERRORS
,
57 MEMCACHED_FAIL_UNIX_SOCKET
,
58 MEMCACHED_NOT_SUPPORTED
,
59 MEMCACHED_NO_KEY_PROVIDED
, /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED! */
60 MEMCACHED_FETCH_NOTFINISHED
,
63 MEMCACHED_BAD_KEY_PROVIDED
,
64 MEMCACHED_MAXIMUM_RETURN
/* Always add new error code before */
68 MEMCACHED_DISTRIBUTION_MODULA
,
69 MEMCACHED_DISTRIBUTION_CONSISTENT
,
70 MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
,
71 MEMCACHED_DISTRIBUTION_RANDOM
72 } memcached_server_distribution
;
75 MEMCACHED_BEHAVIOR_NO_BLOCK
,
76 MEMCACHED_BEHAVIOR_TCP_NODELAY
,
77 MEMCACHED_BEHAVIOR_HASH
,
78 MEMCACHED_BEHAVIOR_KETAMA
,
79 MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
,
80 MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
,
81 MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
,
82 MEMCACHED_BEHAVIOR_SUPPORT_CAS
,
83 MEMCACHED_BEHAVIOR_POLL_TIMEOUT
,
84 MEMCACHED_BEHAVIOR_DISTRIBUTION
,
85 MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
,
86 MEMCACHED_BEHAVIOR_USER_DATA
,
87 MEMCACHED_BEHAVIOR_SORT_HOSTS
,
88 MEMCACHED_BEHAVIOR_VERIFY_KEY
,
89 MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
,
90 MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
,
91 MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
,
92 MEMCACHED_BEHAVIOR_KETAMA_HASH
,
93 MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
,
94 MEMCACHED_BEHAVIOR_SND_TIMEOUT
,
95 MEMCACHED_BEHAVIOR_RCV_TIMEOUT
,
96 MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
,
97 MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
,
98 MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
,
99 MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
,
100 MEMCACHED_BEHAVIOR_NOREPLY
101 } memcached_behavior
;
104 MEMCACHED_CALLBACK_PREFIX_KEY
,
105 MEMCACHED_CALLBACK_USER_DATA
,
106 MEMCACHED_CALLBACK_CLEANUP_FUNCTION
,
107 MEMCACHED_CALLBACK_CLONE_FUNCTION
,
108 MEMCACHED_CALLBACK_MALLOC_FUNCTION
,
109 MEMCACHED_CALLBACK_REALLOC_FUNCTION
,
110 MEMCACHED_CALLBACK_FREE_FUNCTION
,
111 MEMCACHED_CALLBACK_GET_FAILURE
,
112 MEMCACHED_CALLBACK_DELETE_TRIGGER
113 } memcached_callback
;
116 MEMCACHED_HASH_DEFAULT
= 0,
119 MEMCACHED_HASH_FNV1_64
,
120 MEMCACHED_HASH_FNV1A_64
,
121 MEMCACHED_HASH_FNV1_32
,
122 MEMCACHED_HASH_FNV1A_32
,
123 MEMCACHED_HASH_HSIEH
,
124 MEMCACHED_HASH_MURMUR
,
125 MEMCACHED_HASH_JENKINS
129 MEMCACHED_CONNECTION_UNKNOWN
,
130 MEMCACHED_CONNECTION_TCP
,
131 MEMCACHED_CONNECTION_UDP
,
132 MEMCACHED_CONNECTION_UNIX_SOCKET
133 } memcached_connection
;
139 #endif /* __MEMCACHED_CONSTANTS_H__ */