Skip to content

Compatibility with memcached

benjamin-surma edited this page May 16, 2013 · 3 revisions

EN / [JP](Compatibility with memcached JP)

Incompatibility

flush_all

Flare does not support expiration time argument of a flush_all command (flush_all command itself is ''supported'').

Upward compatibility

Flare supports some extended commands and arguments (not in memcached).

dump

syntax

dump ([wait]) ([partition]) ([partition size])

response

VALUE [key] [flag] [size] [version] [expiration]
(data)
...
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.

dump_key (>= 1.1.0)

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.

kill

syntax

kill [thread id]

response

OK

Kill specified thread (thread id is identified via "stats threads").

node add (index server only)

syntax

node add [server name] [server port]

response

OK

Node server sends this command at startup (internal command).

node role (index server only)

syntax

node role [server name] [server port] [role=(master|slave|proxy)] [balance] ([partition])

response

OK

Shift node role.

node state (index server only)

syntax

node state [server name] [server port] [state=(active|prepare|down)]

response

OK

Shift node state.

node remove (index server only)

syntax

node remove [server name] [server port]

Remove node from index server (only available if target node is down).

node sync (index server only)

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).

ping

syntax

ping

response

OK

Always return "OK" (internal command - to watch each node).

stats nodes

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).

stats threads

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.

sync option

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).

key length

Flare can accept keys more than 250 bytes.

data length

Flare can accpet data more thatn 1M bytes (memcached returns "object too large").

proxy identifier

Flare ''internally'' add proxy identifier w/ following format (to avoid infinite loop):

<node key1,node key2,...>[command...]