Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:lsmcd:commands [2016/04/06 20:56]
Rob Holda
litespeed_wiki:lsmcd:commands [2016/04/07 15:41]
Rob Holda
Line 12: Line 12:
 [[litespeed_wiki:​lsmcd:​commands:​bget|bget]] - Read the binary value tied to the user-provided key. [[litespeed_wiki:​lsmcd:​commands:​bget|bget]] - Read the binary value tied to the user-provided key.
  
-[[litespeed_wiki:​lsmcd:​commands:​gets|gets]] - Read the value tied to the user-provided key and its cas token (to be used with the **cas** command).+[[litespeed_wiki:​lsmcd:​commands:​gets|gets]] - Read the value tied to the user-provided key and its cas token (to be used with the [[litespeed_wiki:​lsmcd:​commands:​cas|cas]] ​command).
  
 [[litespeed_wiki:​lsmcd:​commands:​add|add]] - Add a key/value pair only if a pair does not already exist for the user-provided key. [[litespeed_wiki:​lsmcd:​commands:​add|add]] - Add a key/value pair only if a pair does not already exist for the user-provided key.
Line 18: Line 18:
 [[litespeed_wiki:​lsmcd:​commands:​set|set]] - Store a key/value pair. If a pair already exists for the user-provided key, overwrites it. [[litespeed_wiki:​lsmcd:​commands:​set|set]] - Store a key/value pair. If a pair already exists for the user-provided key, overwrites it.
  
-**syntax:**  +[[litespeed_wiki:​lsmcd:​commands:​replace|replace]] - Store a key/value pair, but only if it already exists.
-<​code>​ +
-set <key> <​flags>​ <TTL> <​length> ​[noreply\r\n <​value>​ \r\n +
-</code>+
  
-**parameters:** +[[litespeed_wiki:lsmcd:​commands:​append|append]] ​Add data to an existing key after existing ​data.
-  * **flags** - A 32-bit unsigned integer that the server stores with the data provided by the user, and returns along with the data when the item is retrieved. +
-  * **TTL** +
-  * **length** +
-  * **noreply** +
-  * **value**+
  
-**example:**  +[[litespeed_wiki:lsmcd:​commands:​prepend|prepend]] - Add data to an existing key before existing data.
-<​code>​ +
-set mykey 0 120 10 +
-myvalueabc+
  
-STORED +[[litespeed_wiki:​lsmcd:​commands:​cas|cas]] - Check-and-Set an item; store data only if no one else has updated since the last fetch, determined with the cas token from the [[litespeed_wiki:​lsmcd:​commands:​gets|gets]] command.
-</​code>​ +
-===== replace =====+
  
-Store a key/value pair, but only if it already ​exists.+[[litespeed_wiki:​lsmcd:​commands:​incr|incr]] - Increment ​numerical key’s value by the given number if the key/value pair exists.
  
-**syntax:​** +[[litespeed_wiki:​lsmcd:​commands:​decr|decr]] - Decrement a numerical key'​s ​value by the given number if the key/value pair exists.
-<​code>​ +
-replace <key> <​flags>​ <TTL> <​length> ​[noreply\r\n <value> \r\n +
-</code> +
-**example:​**  +
-<​code>​ +
-replace mykey 0 120 10 +
-myvalueabc+
  
-STORED +[[litespeed_wiki:lsmcd:​commands:​delete|delete]] - Delete an existing key/value pair.
-</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **120** → TTL in seconds +
-  * **10** → Size in bytes +
-  * **myvalueabc** → value to set "​mykey"​ to+
  
-===== append ===== +[[litespeed_wiki:​lsmcd:​commands:​touch|touch]] - Update the expiration time for a key/value pair without fetching it.
-Add data to an existing ​key after existing data.+
  
-**syntax:​** +[[litespeed_wiki:lsmcd:​commands:​stats|stats]] - Print or reset general statistics.
-<​code>​ +
-append <key> <​flags>​ <TTL> <​length> ​[noreply] ​ \r\n <​value>​ \r\n +
-</​code>​ +
-**example:** +
-<​code>​ +
-append mykey 0 120 10 +
-defghijklm+
  
-STORED +[[litespeed_wiki:lsmcd:​commands:​flush_all|flush_all]] - Delete all key/value pairs immediately.
-</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **120** → TTL in seconds +
-  * **10** → Size to append in bytes +
-  * In this example, if "​mykey"​ had a value of "​myvalueabc",​ after running **append**, its value would be "​myvalueabcdefghijklm"​.+
  
-===== prepend ===== +[[litespeed_wiki:​lsmcd:​commands:​version|version]] - Print LSMCD server version.
-Add data to an existing key before existing data.+
  
-**syntax:​** +[[litespeed_wiki:lsmcd:​commands:​quit|quit]] - Terminate telnet session.
-<​code>​ +
-prepend <key> <​flags>​ <TTL> <​length> ​[noreply] \r\n <​value>​ \r\n +
-</​code>​ +
-**example:** +
-<​code>​ +
-prepend mykey 0 120 10 +
-abcdeabcde+
  
-STORED +[[litespeed_wiki:lsmcd:commands:verbosity|verbosity]- Change the verbosity level of the output of LSMCD.
-</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **120** → TTL in seconds +
-  * **10** → Size to prepend in bytes +
-  * In this example, if "​mykey"​ had a value of "​myvalueabc",​ after running **prepend**,​ its value would be "​abcdeabcdemyvalueabc"​. +
- +
-===== cas ===== +
-Check-and-Set an item; store data only if no one else has updated since the last fetch, determined with the cas token from the **gets** command. +
- +
-**syntax:​** +
-<​code>​ +
-cas <key> <​flags>​ <TTL> <​length>​ <cas unique key> ​[noreply] +
-</​code>​ +
-**example:** +
-<​code>​ +
-cas mykey 0 120 10 2 +
-abcdeabcde +
- +
-STORED +
-</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **120** → TTL in seconds +
-  * **10** → Size in bytes +
-  * **2** → unique token number obtained from **gets** command +
- +
-===== incr ===== +
-Increment numerical key’s value by the given number if the key/value pair exists. +
- +
-**syntax:**  +
-<​code>​ +
-incr <key> <​value>​ [noreply] +
-</​code>​ +
-**example:​** +
-<​code>​ +
-incr mykey 4 +
- +
-+
-</​code>​ +
-**output notes:** +
-  * **4** → value to increment by +
-    * In this example, if "​mykey"​ had a value of "​1",​ after running **incr**, its value would be "​5"​.  +
- +
-===== decr ===== +
-Decrement numerical key’s value by the given number if the key/value pair exists. +
- +
-**syntax:**  +
-<​code>​ +
-decr <key> <​value>​ [noreply] +
-</​code>​ +
-**example:​** +
-<​code>​ +
-decr mykey 3 +
- +
-+
-</​code>​ +
-**output ​notes:** +
-  * **3** → value to decrement by. +
-  * In this example, if "​mykey"​ had a value of "​5",​ after running **decr**, its value would be "​2"​. +
- +
-===== delete ===== +
-Delete an existing key/value pair. +
- +
-**syntax:**  +
-<​code>​ +
-delete <key> [<​time>​] [noreply] +
-</​code>​ +
-**example:​**  +
-<​code>​ +
-delete mykey +
- +
-DELETED +
-</​code>​ +
- +
-===== touch ===== +
-Update the expiration time for a key/value pair without fetching it. +
- +
-**syntax:**  +
-<​code>​ +
-touch <key> <TTL> [noreply] +
-</​code>​ +
-**example:​**  +
-<​code>​ +
-touch mykey 1200 +
- +
-TOUCHED +
-</​code>​ +
-**output notes:** +
-  * **1200** → new TTL in seconds +
- +
-===== stats ===== +
-Print or reset general statistics +
- +
-**syntax:**  +
-<​code>​ +
-stats [reset] +
-</​code>​ +
-**example:​**  +
-<​code>​ +
-stats +
- +
-STAT pid 16825 +
-STAT version 1.0.0 +
-STAT pointer_size 64 +
-STAT rusage_user 0.300000 +
-STAT rusage_system 0.520000 +
-STAT cmd_get 10 +
-STAT cmd_set 11 +
-STAT cmd_flush 2 +
-STAT cmd_touch 2 +
-STAT get_hits 8 +
-STAT get_misses 2 +
-STAT delete_misses 0 +
-STAT delete_hits 1 +
-STAT incr_misses 0 +
-STAT incr_hits 1 +
-STAT decr_misses 1 +
-STAT decr_hits 1 +
-STAT cas_misses 0 +
-STAT cas_hits 1 +
-STAT cas_badval 0 +
-STAT touch_hits 2 +
-STAT touch_misses 0 +
-STAT auth_cmds 0 +
-STAT auth_errors 0 +
-END +
-</​code>​ +
-**example:​**  +
-<​code>​ +
-stats reset +
- +
-RESET +
-</​code>​ +
- +
-===== flush_all ===== +
-Delete all key/value pairs immediately. +
- +
-**syntax:**  +
-<​code>​ +
-flush_all [<​time>​] [noreply] +
-</​code>​ +
-**example:​**  +
-<​code>​ +
-flush_all +
- +
-OK +
-</​code>​ +
- +
-===== version ===== +
-Print server version. +
- +
-**syntax:**  +
-<​code>​ +
-version +
-</​code>​ +
-**example:​**  +
-<​code>​ +
-version +
- +
-VERSION 1.0.0 +
-</​code>​ +
- +
-===== quit ===== +
-Terminate telnet session. +
- +
-**syntax:**  +
-<​code>​ +
-quit +
-</​code>​ +
-**example:​** +
-<​code>​ +
-quit +
- +
-Connection closed by foreign host. +
-</​code>​ +
- +
-===== verbosity ===== +
-Increase log version. +
- +
-**syntax:**  +
-<​code>​ +
-verbosity <​level>​ [noreply] +
-</​code>​ +
-**example:​**  +
-<​code>​ +
-verbosity 1 +
- +
-OK +
-</​code>​+
  • Admin
  • Last modified: 2016/04/07 19:36
  • by Rob Holda