Oracle 5.0 Reference Manual page 1398

Table of Contents

Advertisement

Both text lines (commands and responses) and unstructured data are always terminated with the string
\r\n. Because the data being stored may contain this sequence, the length of the data (returned by
the client before the unstructured data is transmitted should be used to determine the end of the data.
Commands to the server are structured according to their operation:
• Storage commands: set, add, replace, append, prepend,
Storage commands to the server take the form:
command key [flags] [exptime] length [noreply]
Or when using compare and swap (cas):
cas key [flags] [exptime] length [casunique] [noreply]
Where:
• command: The command name.
• set: Store value against key
• add: Store this value against key if the key does not already exist
• replace: Store this value against key if the key already exists
• append: Append the supplied value to the end of the value for the specified key. The
and
arguments should not be used.
exptime
• prepend: Append value currently in the cache to the end of the supplied value for the specified
key. The
flags
• cas: Set the specified key to the supplied value, only if the supplied
This is effectively the equivalent of change the information if nobody has updated it since I last
fetched it.
• key: The key. All data is stored using a the specific key. The key cannot contain control characters
or whitespace, and can be up to 250 characters in size.
• flags: The flags for the operation (as an integer). Flags in
server ignores the contents of the flags. They can be used by the client to indicate
memcached
any type of information. In
1.2.1 and higher the value is a 32-bit integer.
memcached
• exptime: The expiry time, or zero for no expiry.
• length: The length of the supplied value block in bytes, excluding the terminating
characters.
• casunique: A unique 64-bit value of an existing entry. This is used to compare against the
existing value. Use the value returned by the
• noreply: Tells the server not to reply to the command.
For example, to store the value
set xyzkey 0 0 6\r\nabcdef\r\n
The return value from the server is one line, specifying the status or error information. For more
information, see
Table 15.3,
• Retrieval commands: get,
Developing a
memcached
and
arguments should not be used.
exptime
1.2.0 and lower the value is a 16-bit integer value. In
memcached
into the key xyzkey, you would use:
abcdef
"memcached
Protocol
gets
1378
Application
cas
memcached
command when issuing
gets
Responses".
flags
matches.
casunique
are transparent. The
\r\n
updates.
cas

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents