MEMCACHED_BEHAVIOR_GET(3) libmemcached-awesome MEMCACHED_BEHAVIOR_GET(3)
NAME
memcached_behavior_get - libmemcached Documentation
Manipulate the behavior of a memcached_st structure.
SYNOPSIS
#include <libmemcached/memcached.h>
Compile and link with -lmemcached
uint64_t memcached_behavior_get(memcached_st *ptr, memcached_behavior_t
flag)
Parameters
o ptr -- pointer to initialized memcached_st struct
o flag -- memcached_behavior_t to query
Returns
the vaue set for flag
memcached_return_t memcached_behavior_set(memcached_st *ptr,
memcached_behavior_t flag, uint64_t data)
Parameters
o ptr -- pointer to initialized memcached_st struct
o flag -- memcached_behavior_t to set
o data -- the value to set for flag
Returns
memcached_return_t indicating success
Changed in version 0.17: The data argument of
memcached_behavior_set() was changed from taking a pointer to
data value, to taking a uin64_t.
typedef enum memcached_behavior_t memcached_behavior_t
enum memcached_behavior_t
enumerator MEMCACHED_BEHAVIOR_USE_UDP
Causes libmemcached to use the UDP transport when commu-
nicating with a memcached server. Not all I/O operations
are tested when this behavior is enabled.
The following operations will return
MEMCACHED_NOT_SUPPORTED when executed with
MEMCACHED_BEHAVIOR_USE_UDP enabled:
o memcached_version(),
o memcached_stat(),
o memcached_get(),
o memcached_get_by_key(),
o memcached_mget(),
o memcached_mget_by_key(),
o memcached_fetch(),
o memcached_fetch_result(),
o memcached_fetch_execute().
All other operations are tested but are executed in a
'fire-and-forget' mode, in which once the client has exe-
cuted the operation, no attempt will be made to ensure
the operation has been received and acted on by the
server.
libmemcached does not allow TCP and UDP servers to be
shared within the same libmemcached client 'instance'. An
attempt to add a TCP server when this behavior is enabled
will result in a MEMCACHED_INVALID_HOST_PROTOCOL, as will
attempting to add a UDP server when this behavior has not
been enabled.
enumerator MEMCACHED_BEHAVIOR_NO_BLOCK
This enables SO_LINGER only, so the close(2) call on the
socket returns immediately. I/O is always handled asyn-
chronously in recent versions of libmemcached.
enumerator MEMCACHED_BEHAVIOR_SND_TIMEOUT
This sets the microsecond behavior of the socket against
the SO_SNDTIMEO flag.
enumerator MEMCACHED_BEHAVIOR_RCV_TIMEOUT
This sets the microsecond behavior of the socket against
the SO_RCVTIMEO flag.
enumerator MEMCACHED_BEHAVIOR_TCP_NODELAY
Disables Nagle's algorithm. See RFC 896.
enumerator MEMCACHED_BEHAVIOR_HASH
Set the hash algorithm used for keys.
Each hash has its advantages and its weaknesses. If you
don't know or don't care, just go with the default.
enumerator MEMCACHED_BEHAVIOR_DISTRIBUTION
Setting a memcached_server_distribution_t you can enable
different means of distributing values to servers.
The default method is MEMCACHED_DISTRIBUTION_MODULA (hash
of the key modulo number of servers).
You can enable consistent hashing by setting
MEMCACHED_DISTRIBUTION_CONSISTENT. Consistent hashing de-
livers better distribution and allows servers to be added
to the cluster with minimal cache losses.
Currently MEMCACHED_DISTRIBUTION_CONSISTENT is an alias
for the value MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA.
enumerator MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
Deprecated since version 0.46(?): DNS lookups are now
always cached until an error occurs with the server.
Memcached can cache named lookups so that DNS lookups are
made only once.
enumerator MEMCACHED_BEHAVIOR_SUPPORT_CAS
Support CAS operations (this is not enabled by default at
this point in the server since it imposes a slight per-
formance penalty).
enumerator MEMCACHED_BEHAVIOR_KETAMA
Sets the default distribution to
MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA and the hash to
MEMCACHED_HASH_MD5.
enumerator MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
Sets the default distribution to
MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA with the
weighted tests. Makes the default hashing algorithm for
keys use MEMCACHED_HASH_MD5.
enumerator MEMCACHED_BEHAVIOR_KETAMA_HASH
Sets the hashing algorithm for host mapping on continuum.
enumerator MEMCACHED_BEHAVIOR_KETAMA_COMPAT
Sets the compatibility mode. The value can be set to ei-
ther MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED (this is the
default) or MEMCACHED_KETAMA_COMPAT_SPY to be compatible
with the SPY Memcached client for Java.
enumerator MEMCACHED_BEHAVIOR_POLL_TIMEOUT
Modify the timeout in milliseconds value that is used by
poll. The default value is -1. An signed int must be
passed to memcached_behavior_set() to change this value
(this requires casting). For memcached_behavior_get() a
'signed int' value will be cast and returned as 'unsigned
long long'.
enumerator MEMCACHED_BEHAVIOR_USER_DATA
Deprecated since version <: 0.30
enumerator MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
Enabling buffered IO causes commands to "buffer" instead
of being sent. Any action that gets data causes this
buffer to be be sent to the remote connection. Quiting
the connection or closing down the connection will also
cause the buffered data to be pushed to the remote con-
nection.
enumerator MEMCACHED_BEHAVIOR_VERIFY_KEY
Enabling this will cause libmemcached to test all keys to
verify that they are valid keys.
enumerator MEMCACHED_BEHAVIOR_SORT_HOSTS
Enabling this will cause hosts that are added to be
placed in the host list in sorted order. This will defeat
consistent hashing.
enumerator MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
Set the timeout during socket connection in milliseconds.
Specifying -1 means an infinite timeout.
enumerator MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
Enable the use of the binary protocol. Please note that
you cannot toggle this flag on an open connection.
enumerator MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
Set this value to tune the number of messages that.
MEMCACHED_BEHAVIOR_GET(3) libmemcached-awesome MEMCACHED_BEHAVIOR_GET(3)
NAME
memcached_behavior_get - libmemcached Documentation
Manipulate the behavior of a memcached_st structure.
SYNOPSIS
#include <libmemcached/memcached.h>
Compile and link with -lmemcached
uint64_t memcached_behavior_get(memcached_st *ptr, memcached_behavior_t
flag)
Parameters
o ptr -- pointer to initialized memcached_st struct
o flag -- memcached_behavior_t to query
Returns
the vaue set for flag
memcached_return_t memcached_behavior_set(memcached_st *ptr,
memcached_behavior_t flag, uint64_t data)
Parameters
o ptr -- pointer to initialized memcached_st struct
o flag -- memcached_behavior_t to set
o data -- the value to set for flag
Returns
memcached_return_t indicating success
Changed in version 0.17: The data argument of
memcached_behavior_set() was changed from taking a pointer to
data value, to taking a uin64_t.
typedef enum memcached_behavior_t memcached_behavior_t
enum memcached_behavior_t
enumerator MEMCACHED_BEHAVIOR_USE_UDP
Causes libmemcached to use the UDP transport when commu-
nicating with a memcached server. Not all I/O operations
are tested when this behavior is enabled.
The following operations will return
MEMCACHED_NOT_SUPPORTED when executed with
MEMCACHED_BEHAVIOR_USE_UDP enabled:
o memcached_version(),
o memcached_stat(),
o memcached_get(),
o memcached_get_by_key(),
o memcached_mget(),
o memcached_mget_by_key(),
o memcached_fetch(),
o memcached_fetch_result(),
o memcached_fetch_execute().
All other operations are tested but are executed in a
'fire-and-forget' mode, in which once the client has exe-
cuted the operation, no attempt will be made to ensure
the operation has been received and acted on by the
server.
libmemcached does not allow TCP and UDP servers to be
shared within the same libmemcached client 'instance'. An
attempt to add a TCP server when this behavior is enabled
will result in a MEMCACHED_INVALID_HOST_PROTOCOL, as will
attempting to add a UDP server when this behavior has not
been enabled.
enumerator MEMCACHED_BEHAVIOR_NO_BLOCK
This enables SO_LINGER only, so the close(2) call on the
socket returns immediately. I/O is always handled asyn-
chronously in recent versions of libmemcached.
enumerator MEMCACHED_BEHAVIOR_SND_TIMEOUT
This sets the microsecond behavior of the socket against
the SO_SNDTIMEO flag.
enumerator MEMCACHED_BEHAVIOR_RCV_TIMEOUT
This sets the microsecond behavior of the socket against
the SO_RCVTIMEO flag.
enumerator MEMCACHED_BEHAVIOR_TCP_NODELAY
Disables Nagle's algorithm. See RFC 896.
enumerator MEMCACHED_BEHAVIOR_HASH
Set the hash algorithm used for keys.
Each hash has its advantages and its weaknesses. If you
don't know or don't care, just go with the default.
enumerator MEMCACHED_BEHAVIOR_DISTRIBUTION
Setting a memcached_server_distribution_t you can enable
different means of distributing values to servers.
The default method is MEMCACHED_DISTRIBUTION_MODULA (hash
of the key modulo number of servers).
You can enable consistent hashing by setting
MEMCACHED_DISTRIBUTION_CONSISTENT. Consistent hashing de-
livers better distribution and allows servers to be added
to the cluster with minimal cache losses.
Currently MEMCACHED_DISTRIBUTION_CONSISTENT is an alias
for the value MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA.
enumerator MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
Deprecated since version 0.46(?): DNS lookups are now
always cached until an error occurs with the server.
Memcached can cache named lookups so that DNS lookups are
made only once.
enumerator MEMCACHED_BEHAVIOR_SUPPORT_CAS
Support CAS operations (this is not enabled by default at
this point in the server since it imposes a slight per-
formance penalty).
enumerator MEMCACHED_BEHAVIOR_KETAMA
Sets the default distribution to
MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA and the hash to
MEMCACHED_HASH_MD5.
enumerator MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
Sets the default distribution to
MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA with the
weighted tests. Makes the default hashing algorithm for
keys use MEMCACHED_HASH_MD5.
enumerator MEMCACHED_BEHAVIOR_KETAMA_HASH
Sets the hashing algorithm for host mapping on continuum.
enumerator MEMCACHED_BEHAVIOR_KETAMA_COMPAT
Sets the compatibility mode. The value can be set to ei-
ther MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED (this is the
default) or MEMCACHED_KETAMA_COMPAT_SPY to be compatible
with the SPY Memcached client for Java.
enumerator MEMCACHED_BEHAVIOR_POLL_TIMEOUT
Modify the timeout in milliseconds value that is used by
poll. The default value is -1. An signed int must be
passed to memcached_behavior_set() to change this value
(this requires casting). For memcached_behavior_get() a
'signed int' value will be cast and returned as 'unsigned
long long'.
enumerator MEMCACHED_BEHAVIOR_USER_DATA
Deprecated since version <: 0.30
enumerator MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
Enabling buffered IO causes commands to "buffer" instead
of being sent. Any action that gets data causes this
buffer to be be sent to the remote connection. Quiting
the connection or closing down the connection will also
cause the buffered data to be pushed to the remote con-
nection.
enumerator MEMCACHED_BEHAVIOR_VERIFY_KEY
Enabling this will cause libmemcached to test all keys to
verify that they are valid keys.
enumerator MEMCACHED_BEHAVIOR_SORT_HOSTS
Enabling this will cause hosts that
1.1 Mar 06, 2023 MEMCACHED_BEHAVIOR_GET(3)
Czas wygenerowania: 0.00037 sek.
Created with the man page lookup class by Andrew Collington.
Based on a C man page viewer by Vadim Pavlov
Unicode soft-hyphen fix (as used by RedHat) by Dan Edwards
Some optimisations by Eli Argon
Caching idea and code contribution by James Richardson
Copyright © 2003-2025 Linux.pl
Hosted by Hosting Linux.pl