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:20]
Rob Holda [get]
litespeed_wiki:lsmcd:commands [2016/04/07 15:41]
Rob Holda
Line 6: Line 6:
 </​code>​ </​code>​
  
-The following is a list of LSMCD commands useable in telnet, each with a description, ​the command'​s ​syntax, an example of use (including user input and system output separated by an empty line), and an explanation of potentially confusing values. Note: in the syntax sections, values enclosed in <> indicate a required value while values enclosed in [] indicate an optional one.+The following is a list of LSMCD commands useable in telnet, each with a brief description. For more informationsee each command'​s ​page.
  
-[[litespeed_wiki:​lsmcd:​commands:​get|get]] - Read value tied to the user-provided key. +[[litespeed_wiki:​lsmcd:​commands:​get|get]] - Read the value tied to the user-provided key.
-===== bget =====+
  
-Read binary value.+[[litespeed_wiki:​lsmcd:​commands:​bget|bget]] - Read the binary value tied to the user-provided key.
  
-**syntax:** +[[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).
-<​code>​ +
-bget <key+
-</​code>​ +
-**example:** +
-<​code>​ +
-bget mykey+
  
-VALUE mykey 0 10 +[[litespeed_wiki:lsmcd:​commands:​add|add]] - Add a key/value pair only if a pair does not already exist for the user-provided key.
-abcdefghij +
-END</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **10** → Size in bytes +
-  * **myvalueabc** → value of "​mykey"​+
  
-===== gets ===== +[[litespeed_wiki:​lsmcd:​commands:​set|set]] - Store key/value pair. If a pair already exists for the user-provided key, overwrites it.
-Read a value and its cas token (to be used with the **cas** command).+
  
-**syntax:**  +[[litespeed_wiki:lsmcd:​commands:​replace|replace]] - Store a key/value pair, but only if it already exists.
-<​code>​ +
-gets <key+
-</code> +
-**example:​**  +
-<​code>​ +
-gets mykey+
  
-VALUE mykey 0 10 9 +[[litespeed_wiki:lsmcd:​commands:​append|append]] - Add data to an existing key after existing data.
-myvalueabc +
-END +
-</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **10** → Size in bytes +
-  * **9** → unique cas token number+
  
-===== add ===== +[[litespeed_wiki:​lsmcd:​commands:​prepend|prepend]] - Add data to an existing ​key before existing data.
-Add a new key/value pair, but only if the server doesn’t already hold data for this key.+
  
-**syntax:**  +[[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>​ +
-add <key> <​flags>​ <TTL> <​length> ​[noreply\r\n <​value>​ \r\n +
-</​code>​ +
-**example:**  +
-<​code>​ +
-add newkey 0 120 10 +
-myvalueabc+
  
-STORED +[[litespeed_wiki:lsmcd:​commands:​incr|incr]] - Increment a numerical key’s value by the given number if the key/value pair exists.
-</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **120** → TTL in seconds +
-  * **10** → Size in bytes +
-  * **myvalueabc** → value to set "​newkey"​ to+
  
-===== set ===== +[[litespeed_wiki:​lsmcd:​commands:​decr|decr]] - Decrement ​numerical ​key'​s ​value by the given number ​if the key/value pair exists.
-Store a key/value pair, if the key exists ​already, overwrite it.+
  
-**syntax:**  +[[litespeed_wiki:​lsmcd:​commands:​delete|delete]] - Delete an existing key/value pair.
-<​code>​ +
-set <key> <​flags>​ <TTL> <​length> ​[noreply\r\n <​value>​ \r\n +
-</code>+
  
-**parameters:** +[[litespeed_wiki:lsmcd:​commands:​touch|touch]] ​Update ​the expiration time for a key/value pair without fetching it.
-  * **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:​stats|stats]] - Print or reset general statistics.
-<​code>​ +
-set mykey 0 120 10 +
-myvalueabc+
  
-STORED +[[litespeed_wiki:​lsmcd:​commands:​flush_all|flush_all]] - Delete all key/value pairs immediately.
-</code> +
-===== replace =====+
  
-Store a key/value pair, but only if it already exists.+[[litespeed_wiki:​lsmcd:​commands:​version|version]] - Print LSMCD server version.
  
-**syntax:​** +[[litespeed_wiki:lsmcd:​commands:​quit|quit]] - Terminate telnet session.
-<​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:verbosity|verbosity]] - Change ​the verbosity level of the output of LSMCD.
-</​code>​ +
-**output notes:** +
-  * **0** → no flags +
-  * **120** → TTL in seconds +
-  * **10** → Size in bytes +
-  * **myvalueabc** → value to set "​mykey"​ to +
- +
-===== append ===== +
-Add data to an existing key after existing data. +
- +
-**syntax:​** +
-<​code>​ +
-append <key> <​flags>​ <TTL> <​length> ​[noreply] ​ \r\n <​value>​ \r\n +
-</​code>​ +
-**example:** +
-<​code>​ +
-append mykey 0 120 10 +
-defghijklm +
- +
-STORED +
-</​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 ===== +
-Add data to an existing key before existing data. +
- +
-**syntax:** +
-<​code>​ +
-prepend <key> <​flags>​ <TTL> <​length>​ [noreply\r\n <​value>​ \r\n +
-</​code>​ +
-**example:​** +
-<​code>​ +
-prepend mykey 0 120 10 +
-abcdeabcde +
- +
-STORED +
-</​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