syntax
get [key name]
response
VALUE [key name] [flag] [expiration time]
(value)
Get value by key name.
syntax
set [key name] [flag] [expiration time] [size of value]
[value]
response
STORED
- flag: the flag indicating whether or not to compress the value.
- expiration time: time [sec] to be erased. If you set this option
0
, the key will not be erased.
Set a key unconditionally. If the key already exists, it will be overwritten.
syntax
add [key name] [flag] [expiration time] [size of value]
[value]
response
STORED
Add a key. If the key already exists, it will NOT be overwritten and abort writing.
syntax
replace [key name] [flag] [expiration time] [size of value]
[value]
response
STORED
Overwrite existing key. If the key doesn't exist, abort writing.
syntax
append [key name] [flag] [expiration time] [size of value]
[value]
response
STORED
Append value to existing key. If the key doesn't exist, abort writing.
syntax
prepend [key name] [flag] [expiration time] [size of value]
[value]
response
STORED
Prepend value to existing key. If the key doesn't exist, abort writing.
syntax
incr [key name] [number]
response
(incremented value)
Increments numerical key value by given number.
If the key value is not numeric value, it will be treated 0
.
syntax
decr [key name] [number]
response
(decremented value)
Decrements numerical key value by given number.
If the key value is not numeric value, the value will be 0
.
syntax
delete [key name]
response
DELETED
Deletes an existing key.
syntax
version
response
VERSION flare-X.X.X
Prints server version.
syntax
quit
Terminate telnet session.
available on set/add/replace/append/prepend/incr/decr commands, like:
set key1 0 0 3 noreply
If this option is specified, response will NOT be returned.
syntax
flush_all
response
OK
Clear all data from terget node.
syntax
dump ([wait]) ([partition]) ([partition size])
response
VALUE [key] [flag] [size of value] [version] [expiration time]
(value)
...
END
- wait: wait msec for each key retrieval (msec) (default = 0)
- partition: target partition to dump
- partition size: partition size to calculate parition
Dump all the data in the target node. If partition arguments are specified, only data in target partition are dumped.
syntax
dump_key ([partition]) ([partition size])
response
KEY [key]
...
END
- partition: target partition to dump
- partition size: partition size to calculate parition
Dump all the keys in the target node. If partition arguments are specified, only keys in target partition are dumped.
syntax
kill [thread id]
response
OK
Kill specified thread (thread id is identified via "stats threads").
syntax
node add [server name] [server port]
response
OK
Node server sends this command at startup (internal command).
syntax
node role [server name] [server port] [role=(master|slave|proxy)] [balance] ([partition])
response
OK
Shift node role.
syntax
node state [server name] [server port] [state=(active|prepare|down)]
response
OK
Shift node state.
syntax
node remove [server name] [server port]
Remove node from index server (only available if target node is down).
syntax
node sync
NODE [server name] [server port] [role] [state] [partition] [balance] [thread type]
...
response
OK
Index server sends this command to each node if index server detects any change of role or state (internal command).
syntax
ping
response
OK
Always return "OK" (internal command - to watch each node).
syntax
stats nodes
response
STAT [node key]:role [value=(master|slave|proxy)]
STAT [node_key]:state [value=(active|prepare|down)]
STAT [node_key]:partition [value]
STAT [node_key]:balance [value]
STAT [node_key]:thread_type [value]
Show all nodes ("thread_type" is internal id).
syntax
stats threads
response
STAT [thread id]:type [value]
STAT [thread id]:peer [value]
STAT [thread id]:op [value]
STAT [thread id]:uptime [value]
STAT [thread id]:state [value]
STAT [thread id]:info [value]
STAT [thread id]:queue [value]
Show all threads.
available on set/add/replace/append/prepend/incr/decr commands, like:
set key1 0 0 3 sync
If this option is specified, response is send ''after'' replication is done (just opposite way of "noreply" option).
Flare can accept keys more than 250 bytes.
Flare can accpet value more than 1M bytes (memcached returns "object too large").
Flare ''internally'' add proxy identifier w/ following format (to avoid infinite loop):
<node name:port, node name:port,...>[command...]
for example:
<flare.example.com:12121>get key1