roma_logo ROMA-Project
  • Getting Started
  • Learn
    • Tutorial
    • Status List
    • Monitoring Point
    • Trouble Shooting
    • FAQ
    • ROMA Training Map
  • Docs
    • About ROMA
    • Versions
    • Architectures
    • Configuration File
    • Plugin
    • High Stability
    • Storage Architecture
    • Developer Manual
    • PHP client
    • Ruby client
    • Java client
  • Commands
  • GUI Tools
  • Discuss
    • Blog
    • Mailing List
    • Issues
    • Twitter
    • Facebook
    • Google+
    • Github
    • Quora

    Command List

  • ROMA Commands
    • Storage Command
      • - set
      • - add
      • - replace
      • - append
      • - prepend
      • - cas
      • - set_expt
      • - set_size_of_zredundant
    • Retrieval Command
      • - get/gets
      • - get_expt
    • Deletion Command
      • - delete
    • Increment/Decrement Command
      • - incr/decr
    • Operation Command
      • - shutdown_self
      • - balse/shutdown
      • - stat/stats
  • Shell Commands
    • make cluster Command
      • - mkroute
    • booting Command
      • - romad
    • Other Command
      • - roma-adm
      • - check_tc_flag
  • Dynamic Commands
    • for Config.rb
      • - set_lost_action
      • - set_auto_recover
      • - set_threshold_for_failover
      • - set_gap_for_failover
      • - set_log_level
      • - set_shift_size
      • - set_shift_age
      • - set_descriptor_table_size
      • - set_continuous_limit
      • - set_accepted_connection_expire_time
      • - set_connection_pool_expire_time
      • - set_connection_pool_maxlength
      • - set_emconnection_pool_expire_time
      • - set_emconnection_pool_maxlength
      • - dcnice
      • - set_wb_shift_size
      • - set_size_of_zredundant
    • for Others
      • - switch_failover
      • - set_hilatency_warn_time
      • - set_latency_avg_calc_rule
      • - wb_command_map
      • - set_routing_trans_timeout
      • - set_spushv_klength_warn
      • - set_spushv_vlength_warn
      • - switch_dns_caching
      • - get_key_info
      • - set_cleanup_regexp
      • - add_rttable_sub_nid
  • Plugin Commands
    • plugin_storage Command
    • plugin_alist Command
      • - alist_at
      • - alist_clear
      • - alist_delete
      • - alist_delete_at
      • - alist_empty?
      • - alist_first
      • - alist_gets
      • - alist_gets_with_time
      • - alist_include?
      • - alist_index
      • - alist_insert
      • - alist_sized_insert
      • - alist_swap_and_insert
      • - alist_swap_and_sized_insert
      • - alist_join_with_time
      • - alist_join
      • - alist_last
      • - alist_pop
      • - alist_push
      • - alist_sized_push
      • - alist_swap_and_push
      • - alist_update_at
      • - alist_shift
      • - alist_to_s
    • plugin_test Command
      • - echo
    • plugin_map Command
      • - map_set
      • - map_get
      • - map_delete
      • - map_clear
      • - map_size
      • - map_key?
      • - map_value?
      • - map_empty?
      • - map_keys
      • - map_values
      • - map_to_s
    • plugin_map_count Command
      • - mapcount_countup
      • - mapcount_countup_ms
      • - mapcount_update
      • - mapcount_update_ms
      • - mapcount_get
      • - mapcount_get_ms
    • plugin_debug Command
      • - eval
      • - get_key_info
    • plugin_gui Command
      • - get_routing_history
      • - gather_logs
      • - show_logs

Command List

ROMA Commands

"ROMA Commands" is the list of basic commands.

storage command

set

Purpose

set is a command which stores data in ROMA.

set <key> <flags> <exptime> <bytes>\r\n
<value>\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • Otherwise

    NOT_STORED\r\n

add

Purpose

add is a command which stores data in ROMA, only if ROMA doesn't already hold the data for this key.

add <key> <flags> <exptime> <bytes>\r\n
<value>\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<exptime> Specify the expiration time(in unix time or seconds).
Setting rule is same of memcached. (memcached Wiki Page).
When you set expiration date under 1 month, set these seconds.
When you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • Otherwise

    NOT_STORED\r\n

replace

Purpose

replace is a command which stores data in ROMA, only if ROMA does already hold the data for this key.

replace <key> <flags> <exptime> <bytes>\r\n
<value>\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • Otherwise

    NOT_STORED\r\n

append

Purpose

append is a command which adds this data to an existing key after existing data.

append <key> <flags> <exptime> <bytes>\r\n
<value>\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • Otherwise

    NOT_STORED\r\n

prepend

Purpose

prepend is a command which adds this data to an existing key before existing data.

prepend <key> <flags> <exptime> <bytes>\r\n
<value>\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • Otherwise

    NOT_STORED\r\n

cas

Purpose

cas is a check and swap command. ROMA stores this data only if no one else has updated since ROMA last fetched it.

cas <key> <flags> <exptime> <bytes> <cas-id>\r\n
<value>\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<flags> This values is not used. ROMA ignores this option. Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<cas-id> cas-id is a counts of set(logical clock). Specify a unique 64-bit value of an existing entry.
If you use cas command, the client should to get this value by gets command.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • The item you are trying to store with a cas command has been modified since you last fetched it.

    EXISTS\r\n
  • Otherwise

    NOT_FOUND\r\n

set_expt

Purpose

set_expt is a setting expired time command. Data will be removed after this expired time passed.

set_expt <key> <expt>\r\n

Semantics

Name Description Required
<key> Specify the key which you want to set expired time. Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes

Return Code

  • Success

    STORED\r\n
  • Specified key name is undetected.

    SERVER_ERROR #{key} does not exists.\r\n"
  • Otherwise

    NOT_STORED\r\n

set_size_of_zredundant

Purpose

set_size_of_zredundant is a settting zredundant size command.
While data is forwarded to other nodes for redundancy, data that exceed this size will be compressed before forwarding.

set_size_of_zredundant <size>\r\n

Semantics

Name Description Required
<size> Default data size is 0.
If the value is 0 then the data will not be compressed.Specify the key which a client asks to store the data.
Yes

Return Code

  • Success

    STORED\r\n
  • Argunemt error.

    usage:set_set_size_of_zredundant <n>\r\n

retrieval command

get/gets

Purpose

get and gets are retrieval commands. Which is get the corresponded value of inputed key.

get <key>\r\n
gets <key>\r\n

Semantics

Name Description Required
<key> Specify one or more key strings separated by whitespace Yes

Return Code

  • Success

    VALUE <key> <flags> <bytes> [<cas unique>]\r\n
    <value>\r\n
    END\r\n
    
    • <key> is the key which is specified the previous command.
    • <flags> This values is not used.
    • <bytes> is the number of bytes of value without the delimiting.
    • [<cas unique>] is a unique 64-bit integer. Only if you uses gets command.
    • <value> is the data.
  • Otherwise

    END\r\n

get_expt

Purpose

get expired data of inputed key.

get_expt <key> [unix]\r\n

Semantics

Name Description Required
<key> Specify key string which you want to get expired date. Yes
[unix] If you set this option, expired date will be sent back as UNIXTIME format.
Unless this option, expired date will be back as Date format.
No

Return Code

  • Success

    <expired data>\r\n
    END\r\n
    

    Example

    > get_expt foo
    2015-11-05 16:46:08 +0900
    END
    
    > get_expt foo unix
    1446709568
    END
    
  • Otherwise

    END\r\n

deletion command

delete

Purpose

delete is a command which deletes the data logically.

delete <key>\r\n

Semantics

Name Description Required
<key> Specify the key which you want to delete in ROMA. Yes

Return Code

After sending the command line, the client awaits the reply as follows.

  • Success

    DELETED\r\n
  • Otherwise

    NOT_FOUND\r\n

Increment/Decrement command

incr/decr

Purpose

incr and decr are commands which increase/decrease the value to existing data.

Note: If you execute this command to undigit data, value will be overwrite by inputed digit.

incr <key> <digit>\r\n
decr <key> <digit>\r\n

Semantics

Name Description Required
<key> Specify the key which you want to increase/decrease the item. Yes
<digit> Specify the number of a 64-bit unsigned integer. this value is which you want to increase/decrease to the item.
In case of inputed non-digit, it will be regarded as 0.
Yes

Return Code

  • Success

    <digit>\r\n 
  • Otherwise

    NOT_FOUND\r\n

Operation command

shutdown_self

Purpose

shutdown_self is commands which shutdown the only 1 ROMA process.

Note: These commands SHUTDOWN the ROMA instance, BE CAREFULL TO USE!!

Note: rbalse is deprecated, so please use <shutdown_self> command.

shutdown_self\r\n

Return Code

    The server will confirm, you should answer by yes/no.

    > shutdown_self\r\n
    =================================================================
    CAUTION!!:
            This command kill the instance!
            There is some possibility of occuring redundancy down!
    =================================================================
    
    Are you sure to shutdown this instance?(yes/no)
    > yes\r\n
    BYE
    Connection closed by foreign host.
    
    • yes : ROMA instance will be shutdown immediately.
    • no : ROMA doesn't do nothing and this connection will close.

balse/shutdown

Purpose

balse & shutdown are commands which ROMA will be shutdown.

Note: These commands SHUTDOWN the all ROMA instances, BE CAREFULL TO USE!!

balse [<reason>]\r\n
shutdown [<reason>]\r\n

Semantics

Name Description Required
[reason] Sepecify one word which is written to log files. No

Return Code

    The server will confirm, you should answer.

    balse\r\n
    Are you sure?(yes/no)\r\n
    shutdown\r\n
    *** ARE YOU REALLY SURE TO SHUTDOWN? *** (yes/no)\r\n
    • yes : ROMA will be shutdown immediately.
    • no : ROMA doesn't do nothing and this connection will close.

stat/stats

Purpose

stats is a command which informs ROMA's own status.

stats\r\n

If you want to show a part of stats, you should use in the regular expression.

stats <regexp>\r\n

Return Code

Refer to Stats_Information for more detail information about stats command.

Shell Commands

"Shell Commands" is the list of basic commands which run as a shell script.

make cluster command

mkroute

Purpose

mkroute is a command which make routing information files of ROMA.

$ mkroute [options] [nodeIDs]

Specify the list of ROMA processes ID which configure ROMA to nodeIDs.
ROMA processes ID is a pair a port number with a hostname or IP address where ROMA processes start up.
The delimiter which is between the hostname and the port number is "-".

Note: When the ROMA circle is consist of some servers, the mkroute command is required to run only once. And the routing files which is created by the mkroute command is required to be distributed each servers.

Options

Name Description Default Required
-h, --hash [bits] Specify the number of bits for ROMA Hash table.
Example: -h 32 (The range in this case is from 0 to 2^32.)
32 No
-d, --divide [bits] Specify the number of bits for ROMA divide by.
Example: -d 9
9 No
-r, --redundant [num] Specify the number of redundancy.
Example: -r 1 (The redundancy is 1.)
2 No
--replication_in_host Specify this option if some processes start up in single server.
If some processes start up in some hosts, it should be not specified.
No
--enabled_repeathost Specify this option if some processes start up in single server.
If some processes start up in some hosts, it should be not specified.
This option is deprecated, so please use "--replication_in_host" option.
No

Examples

  • 2 servers ( 192.168.10.01 and 192.168.10.02 ) start up each 2 processes.
    In this case, ROMA has 4 ROMA processes.

    $ mkroute 192.168.10.01_11211 192.168.10.01_11212 192.168.10.02_11211 192.168.10.02_11212
  • 1 server ( localhost ) starts up 2 processes. In this case, ROMA has 2 ROMA pcocesses.

    Note: --replication_in_host option is necessary in ROMA, if some ROMA processes start up in single server.

    $ mkroute --replication_in_host localhost_11211 localhost_11212

booting command

romad

Purpose

romad is a command which starts up ROMA.

$ romad [options] address 

Options

Name Description Default Required
-d, --daemon Specify whether ROMA which starts up become daemon process. No
-j, --join [address_port] Specify this option if ROMA process will join an active ROMA dynamically. No
-p, --port [PORT] Specify the port number which ROMA process will receive client requests. No
--verbose Display detailed logs. No
-n, --name [name] Modify the name of ROMA(Services). No
--replication_in_host Specify this option if some ROMA processes start up in single server. No
--enabled_repeathost Specify this option if some ROMA processes start up in single server.
This option is deprecated, so please use "--replication_in_host" option.
No
-h, --help Display help. No
-v, --version Output the version information. No
--disabled_cmd_protect Accept general command when roma is booting.
Roma doesn't accept general commands during booting without this option.
--config Specify the configuration file if you want. lib/roma/config.rb No

Examples

  • In this case, ROMA process starts up using 11211 port in localhost.

    $ romad localhost -p 11212 -d
  • In this case, ROMA process starts up using 11211 port in localhost.
    In addition, localhost will start up 2 ROMA processes.

    Note: --enabled_repeathost option is necessary in ROMA, if some ROMA processes start up in single server.

    $ romad --enabled_repeathost localhost -p 11211 -d
  • You can add new server to an active ROMA dynamically due to increasing data size of ROMA.
    The additional data size is amount of data in which new server can store.
    It is required at least one online ROMA process information.

    An example follow;
    There are ROMA which ROMA process (roma01_11211) takes part in.
    In this case, there is a sample of a command that you add new ROMA process (roma03_11211) to this ROMA.
    In the command, roma03 -p 11211 is information of adding new server.
    And, -j roma01_11211 is information of the online ROMA processes.

    $ romad roma03 -p 11211 -j roma01_11211 -d

Other command

roma-adm

Purpose

roma-adm tool send ROMA command directory and display their results.M
And you can boot ROMA instance via this tool, too.

$ roma-adm [command] [port No.] 

Options

Name Description Default Required
command Specify the ROMA command which you want to send ROMA.
If you want to use argument of ROMA commmad, please enclose by quotes.
Ex.) 'stats node'
Yes
port No. Specify the port No. which you want to send command to. 12000 No

Examples

  • In case of sending 'nodelist' commmand to port No. 12000

    $ roma-adm nodelist
    .
    localhost_12000 localhost_12001 localhost_12002
    
  • In case of sending 'stats node' commmand to port No. 10001

    $ roma-adm 'stats node' 10003
    .
    stats.run_receive_a_vnode {}
    routing.nodes.length 3
    routing.nodes ["localhost_10003", "localhost_10004", "localhost_10005"]
    routing.vnodes.length 512
    routing.short_vnodes 462
    routing.lost_vnodes 0
    routing.version_of_nodes {"localhost_10003"=>66048, "localhost_10004"=>66048, "localhost_10005"=>66048}
    END
    
  • In case of booting ROMA instance of port number 10001

    $ roma-adm start 10001
    
    Please input hostname or ip address which is used for ROMA.
    Ex.) roma_serverA, 192.168.33.11
    > localhost
    
    Please input PATH of config.rb.
    Ex.) /home/roma/config.rb
    > ~/roma/config.rb
    
    2115 <== when booting was finished normaly, process No. will be displayed.
    

check_tc_flag

Purpose

check_tc_flag is check TokyoCabinet file's additonal Flag.

$ check_tc_flag  --storage [TC storage path] --library [TC library path] 

Options

Name Description Default Required
--storage Specify the TC Storage directory.
Ex.) /roma/ds/localhost_10001/roma
Yes
--library Specify the TC library directory.
Ex.) /roma/libexec
Yes

Examples

  • In case of broken TokyoCabinet file, additonal flag is

    $ check_tc_flag --storage /roma/ds/localhost_10001/roma --library /roma/libexec
    /roma/ds/localhost_10001/roma/6.tc : (no flag)
    /roma/ds/localhost_10001/roma/3.tc : (no flag)
    /roma/ds/localhost_10001/roma/5.tc : (no flag)
    /roma/ds/localhost_10001/roma/8.tc : fatal <==== TokyoCabinet file is broken
    /roma/ds/localhost_10001/roma/9.tc : (no flag)
    /roma/ds/localhost_10001/roma/2.tc : (no flag)
    /roma/ds/localhost_10001/roma/7.tc : (no flag)
    /roma/ds/localhost_10001/roma/0.tc : (no flag)
    /roma/ds/localhost_10001/roma/1.tc : (no flag)
    /roma/ds/localhost_10001/roma/4.tc : (no flag)
    

    Refer to Q. How Can I check tc file's health? for more detail.


Dynamic Commands

"Dynamic Commands" is the list of commands which can change the configuration without stopping ROMA.

for Config.rb

set_lost_action

Purpose

set_lost_action is a command which change DEFAULT_LOST_ACTION attribute.

set_lost_action [auto_assign|shutdown]

Target Attribute

DEFAULT_LOST_ACTION

set_auto_recover

Purpose

set_auto_recover is a command which change AUTO_RECOVER attribute.

set_auto_recover [ 'true' | 'false' ] <sec>

Target Attribute

AUTO_RECOVER

set_threshold_for_failover

Purpose

set_threshold_for_failover is a command which change ROUTING_FAIL_CNT_THRESHOLD attribute.

set_threshold_for_failover [count]

Target Attribute

ROUTING_FAIL_CNT_THRESHOLD

set_gap_for_failover

Purpose

set_gap_for_failover is a command which change ROUTING_FAIL_CNT_GAP attribute.

set_gap_for_failover [sec]

Target Attribute

ROUTING_FAIL_CNT_GAP

set_log_level

Purpose

set_log_level is a command which change LOG_LEVEL attribute.

set_log_level [ 'debug' | 'info' | 'warn' | 'error' ]

Target Attribute

LOG_LEVEL

set_log_shift_size

Purpose

set_log_size is a command which change a log's upper limit size. In case of reaching this size, log file will be backed up and make new one.

set_log_shift_size [size]

Target Attribute

LOG_SHIFT_SIZE

set_log_shift_age

Purpose

set_log_shift_age is a command which change the counts of how many generations of log file will be kept.

set_log_shift_size [size|"min"|"hour"|"daily"|"weekly"|"monthly"]

Target Attribute

LOG_SHIFT_AGE

set_descriptor_table_size

Purpose

set_descriptor_table_size is a command which change CONNECTION_DESCRIPTOR_TABLE_SIZE attribute.

set_descriptor_table_size [size]

Target Attribute

CONNECTION_DESCRIPTOR_TABLE_SIZE

set_descriptor_table_size

Purpose

set_descriptor_table_size is a command which change CONNECTION_DESCRIPTOR_TABLE_SIZE attribute.

set_descriptor_table_size [size]

Target Attribute

CONNECTION_DESCRIPTOR_TABLE_SIZE

set_continuous_limit

Purpose

set_continuous_limit is a command which change CONNECTION_CONTINUOUS_LIMIT attribute.

set_continuous_limit [connection]:[rate(%)]:[connection]

Target Attribute

CONNECTION_CONTINUOUS_LIMIT

set_accepted_connection_expire_time

Purpose

set_accepted_connection_expire_time is a command which change CONNECTION_EXPTIME attribute.

set_accepted_connection_expire_time [sec]

Target Attribute

CONNECTION_EXPTIME

set_connection_pool_expire_time

Purpose

set_connection_pool_expire_time is a command which change CONNECTION_POOL_EXPTIME attribute.

set_connection_pool_expire_time [sec]

Target Attribute

CONNECTION_POOL_EXPTIME

set_connection_pool_maxlength

Purpose

set_connection_pool_maxlength is a command which change CONNECTION_POOL_MAX attribute.

set_connection_pool_maxlength [length]

Target Attribute

CONNECTION_POOL_MAX

set_emconnection_pool_expire_time

Purpose

set_emconnection_pool_expire_time is a command which change CONNECTION_EMPOOL_EXPTIME attribute.

set_emconnection_pool_expire_time [sec]

Target Attribute

CONNECTION_EMPOOL_EXPTIME

set_emconnection_pool_maxlength

Purpose

set_emconnection_pool_maxlength is a command which change CONNECTION_EMPOOL_MAX attribute.

set_emconnection_pool_maxlength [length]

Target Attribute

CONNECTION_EMPOOL_MAX

dcnice

Purpose

dcnice is a command which change DATACOPY_STREAM_COPY_WAIT_PARAM attribute.

dcnice [n]

Target Attribute

DATACOPY_STREAM_COPY_WAIT_PARAM
[n] means the ptiority for a data-copy. 1 is the highest and 5 is the lowest priority. The detail is described in "stats.dcnice" in Status page.

set_wb_shift_size

Purpose

set_wb_shift_size is a command which change WRITEBEHIND_SHIFT_SIZE attribute.

set_wb_shift_size [size(byte)]

Target Attribute

WRITEBEHIND_SHIFT_SIZE

set_size_of_zredundant

Purpose

set_size_of_zredundant is a command which change REDUNDANT_ZREDUNDANT_SIZE attribute.

set_size_of_zredundant [bytes]

Target Attribute

REDUNDANT_ZREDUNDANT_SIZE

for Others

switch_failover

Purpose

switch_failover is a command which change failover enbale or disable.

switch_failover [on|off]
  • Default value
    on

set_hilatency_warn_time

Purpose

set_hilatency_warn_time is a command which change hilatency_warn_time attribute.

set_hilatency_warn_time [sec]
  • Default value
    5

Detail

This command set the time for "hilatency_warn_time" property. This time decides the normal limit of executing time of command. This value can be checked as "stats.hilatency_warn_time".

set_latency_avg_calc_rule

Purpose

set_latency_avg_calc_rule is a command which configures the logging of latency.

set_latency_avg_calc_rule [on/off, time, command1, command2,....]
add_latency_avg_calc_cmd [command1, command2,....]
del_latency_avg_calc_cmd [command1, command2,....]
chg_latency_avg_calc_time_count [count]
  • Default value
    cmd => [get, set, delete], denominator => false

Detail

This commands can enable to calculate latency of each command execution and output them to log files. Each attributes for below commands can check by "stat latency" command.
  • set_latency_avg_calc_rule [on/off, time, command1, command2,....]
    "on/off" is turnning on/off the logging. "time" is denominator time to calculate average. And "commandx" is target command.
  • add_latency_avg_calc_cmd [command1, command2,....]
    This command can add commands to the target command list.
  • del_latency_avg_calc_cmd [command1, command2,....]
    This command can delete commands to the target command list.
  • chg_latency_avg_calc_time_count [count]
    This command can change the period of time which is used in calculating average.

wb_command_map

Purpose

wb_command_map is a command which change wb_command_map attribute.

wb_command_map [{:command=>x}]
  • Example
    wb_command_map {:set=>1}
    wb_command_map {:get=>1, :set=>2}
  • Default value
    {}

Detail

This commands changes the value which can confirm as "stats.wb_command_map".

set_routing_trans_timeout

Purpose

set_routing_trans_timeout is a command which change routing_trans_timeout attribute.

set_routing_trans_timeout [sec]
  • Default value
    10080

Detail

This command can change the transaction time of routing change. When over the this setting time, routing will be rollback.

set_spushv_klength_warn

Purpose

set_spushv_klength_warn is a command which change spushv_klength_warn attribute.

 set_spushv_klength_warn [byte]
  • Default value
    1024

Detail

This command sets the limit size of key length. It means set "stats.spushv_klength_warn"

set_spushv_vlength_warn

Purpose

set_spushv_vlength_warn is a command which change spushv_vlength_warn attribute.

set_spushv_vlength_warn [byte]
  • Default value
    1048576

Detail

This command sets the limit size of value length. It means set "stats.spushv_vlength_warn"

switch_dns_caching

Purpose

switch_dns_caching is a command which change dns cache attribute.

switch_dns_caching [on|off]
  • Default value
    -

Detail

This command can enable DNS cache. If this function is enabled, ROMA uses the DNS information stored in cache. Cache is updated in turning on DNS cache function or changing the instance information. This will be useful in case of DNS server down.

get_key_info

Purpose

get_key_info is a command which get key information.

get_key_info [key name]
  • Default value
    -

Detail

This command provide the key inforimation.
  • Example
    eval get_key_info('12345')
    d = 1162951012 0x45513964
    vn = 1157627904 0x45000000
    nodes = ["roma0_11212", "roma0_11313"]

set_cleanup_regexp

Purpose

set_cleanup_regexp is a command which can set the regexp used in outputting clean up log.

set_cleanup_regexp [regexp]
  • Default value
    nil

Detail

ROMA output the key list matched this regexp in cleaning up. The log file "klist.txt" is created in storage path.

add_rttable_sub_nid

Purpose

add_rttable_sub_nid is a command which change NIC configurations.

add_rttable_sub_nid <Target NetMask> <Target> <Replace With>
clear_rttable_sub_nid
delete_rttable_sub_nid <Target NetMask>
  • Example
    add_rttable_sub_nid 127.0.0.0/24 192.168.223.2 localhost.localdomain
    delete_rttable_sub_nid 127.0.0.0/24
  • Default value
      {}

Detail

This command can change the NIC configurations temporarily. The node ID strings matched "Target" is changed to "Replace With" strings. For example, if you'd like to change "dc01_host_10001" to "dc02_host_10001", the command is below.
add_rttable_sub_nid your_subnet_mask dc01 dc02

Plugin Commands

ROMA has plug-in architecture to be extended its function.
It is possible to extend ROMA without changing its source code by preparing plug-ins.

plugin_storage

This plugin is essential unless you will develop alternative one.
Actual command are described in ROMA Commands colum. Please refer it.

plugin_alist

alist_at

Purpose

alist_at is a command which returns the element of the index number of the list which specified by the key.

alist_at <key> <index> \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<index> Specify the index number which a client asks to store the data.
The start number is 0.
Yes

Return Code

  • Success

    • Each item is sent by the server
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_clear

Purpose

alist_clear is a command which clears the list which is specified by the key. But the key remains at ROMA.

alist_clear <key> \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

    CLEARED\r\n
  • When the key doesn't exist.

    NOT_FOUND\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_delete

Purpose

alist_delete is a command which delete the value of "data block" from the list specified by the key.

alist_delete <key> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    DELETED\r\n
  • When the key doesn't exist.

    NOT_FOUND\r\n
  • When the data block doesn't exist.

    NOT_DELETED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_delete_at

Purpose

alist_delete_at is a command which delete the element of the index number from the list specified by the key.

alist_delete_at <key> <index> \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<index> Specify the index number which a client asks to store the data.
The start number is 0.
Yes

Return Code

  • Success

    DELETED\r\n
  • When the key doesn't exist.

    NOT_FOUND\r\n
  • When the index doesn't exist.

    NOT_DELETED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_empty?

Purpose

alist_empty? is a command which returns whether the list specified by the key is empty.

alist_empty? <key> \r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

    true\r\n
  • When the key doesn't exist.

    false\r\n
  • When the data block doesn't exist.

    NOT_FOUND\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_first

Purpose

alist_first is a command which returns the first element of the list specified by the key.

alist_first <key> \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

    • Each item is sent by the server
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_gets

Purpose

alist_gets is a command which returns a part or all of list specified by the key.

alist_gets <key> [<index>]\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<index> Specify the index number which a client asks to store the data.
The start number is 0.
No

Return Code

  • Success

    • Each item is sent by the server
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
      The 1st data block is the number of values.
      Next data blocks are each value of values.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_gets_with_time

Purpose

alist_gets_with_time is a command which returns a part or all of list specified by the key.

alist_gets_with_time <key> [<index>]\r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<index> Specify the index number which a client asks to store the data.
The start number is 0.
Yes

Return Code

  • Success

    • Each item is sent by the server
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
      The 1st data block is the number of values.
      Next data blocks are each value of values.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_include?

Purpose

alist_include? is a command which returns whether the list specified by the key is included "data block" value.

alist_include? <key> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • When the list specified by the key is included.

    true\r\n
  • When the list specified by the key is not included.

    false\r\n
  • When the data block doesn't exist.

    NOT_FOUND\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_index

Purpose

alist_index is a command which returns the index value of the list specified by the key is included "data block" value.

alist_include? <key> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    <size>\r\n
  • When the list specified by the key is not included "data block" value.

    nil\r\n
  • When the key doesn't exist.

    NOT_FOUND\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_insert

Purpose

alist_insert is a command which adds the element at the index number to the list specified by the key.

alist_insert <key> <index> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<index> Specify the index number which a client asks to store the data.
The start number is 0.
Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_sized_insert

Purpose

alist_sized_insert is a command which executes two things.

First, it stores "data block" value at the head of the list specified by the key.

And then, it sets a limit on the list length by "array-size" value.

When elements of the list is longer than "array-size" value, this command will delete them from the list.

alist_sized_insert <key> <array-size> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<array-size> Specify the number of elements in the list. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_swap_and_insert

Purpose

alist_swap_and_insert is a command which executes two things.

First, if there is a <data block> value specified by <key> in the list, it removes this value. And then, it adds this value to the top of the list again.

alist_swap_and_insert <key> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • When the value couldn't store.

    NOT_STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_swap_and_sized_insert

Purpose

alist_swap_and_sized_insert is a command which executes two things.

First, if there is the value in the list specified by the key, it deletes this value and adds this value in the top of the list again.

And then, it sets a limit on the list length by "array-size" value. When elements of the list is longer than "array-size" value, this command will delete them from the list.

alist_swap_and_sized_insert <key> <array-size> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<array-size> Specify the number of elements in the list. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • When the value couldn't store.

    NOT_STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_join_with_time

Purpose

alist_join_with_time is a command which returns a part or all of list specified by the key. The returned value format is value and time with the delimiter character specified by <separator block>.

alist_join_with_time <key> <bytes>  [index|range] [forward] \r\n 
<separator block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
index Specify the index number which a client asks to store the data. No
range Specify the range number as "1..2" which a client asks to store the data. No
<separator block> Specify the separating string. Yes

Return Code

  • Success

    • Three items are sent by the server.
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
      The 1st data block is the number of values.
      Second data block is the list of each values with delimiter string <separator block>.
      The last data block is the list of each values' time data. This format is Unix time.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_join

Purpose

alist_join is a command which returns a part or all of list specified by the key. The returned value format is values with the delimiter character specified by <separator block>.

alist_join <key> <bytes>  [index|range] \r\n 
<separator block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
index Specify the index number which a client asks to store the data. No
range Specify the range number as "1..2" which a client asks to store the data. No
<separator block> Specify the separating string. Yes

Return Code

  • Success

    • Two items are sent by the server.
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
      The 1st data block is the number of values.
      Second data block is the list of each values with delimiter string <separator block>.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_last

Purpose

alist_last is a command which returns the last element of the list specified by the key.

alist_last <key> \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

    • Each item is sent by the server.
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_length

Purpose

alist_length is a command which returns the length of the list specified by the key.

alist_length <key>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

    <size>\r\n
  • When the key doesn't exist.

    NOT_FOUND\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_pop

Purpose

alist_pop is a command which returns the last element of the list specified by the key, and the popped last element is deleted from the list.

alist_pop <key> \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

    • Each item is sent by the server.
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_push

Purpose

alist_push is a command which add to the last of the list specified by the key.

alist_push <key> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • When the value couldn't store.

    NOT_STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_sized_push

Purpose

alist_sized_push is a command which add <data block> to the last of the list specified by the key. But this command does not push if the list is longer than <array-size>.

alist_sized_push <key> <array-size> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<array-size> Specify the number of elements in the list. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • When the list is longer than <array-size>

    NOT_PUSHED\r\n
  • When the value couldn't store.

    NOT_STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_swap_and_push

Purpose

alist_swap_and_push is a command which executes two things.

First, if there is a <data block> value specified by <key> in the list, it removes this value. And then, it adds this value to the last of the list again.

alist_swap_and_push <key> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • When the value couldn't store.

    NOT_STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_swap_and_sized_push

Purpose

alist_swap_and_sized_push is a command which executes two things.

First, if there is the value in the list specified by the key, it deletes this value and adds this value to the last of the list again.

And then, it sets a limit on the list length by "array-size" value. When elements of the list is longer than "array-size" value, this command deletes elements over "array-size" value from the list.

alist_swap_and_sized_push <key> <array-size> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<array-size> Specify the number of elements in the list. Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • When the list is longer than <array-size>

    NOT_PUSHED\r\n
  • When the value couldn't store.

    NOT_STORED\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_update_at

Purpose

alist_update_at is a command which replaces the element of <index> number in the list by <data block> value.

alist_update_at <key> <index> <bytes> \r\n 
<data block>\r\n

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<index> Specify the index number which a client asks to store the data.
The start number is 0.
Yes
<bytes> Specify the number of bytes of <data block> without the delimiting \r\n.
If the value is 0 then it follows by an empty.
Yes
<data block> Specify a chunk of arbitrary 8-bit data. This data of length is <bytes> from the previous line. Yes

Return Code

  • Success

    STORED\r\n
  • When the key doesn't exist.

    NOT_FOUND\r\n
  • When the index doesn't exist.

    NOT_FOUND\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_shift

Purpose

alist_shift is a command which returns the first element of the list specified by the key, and the popped first element is deleted from the list.

alist_shift <key> \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

    • A item is sent by the server.
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

alist_to_s

Purpose

alist_to_s is a command which returns the value of the string type.

alist_to_s <key> [<index>] \r\n 

Semantics

Name Description Required
<key> Specify the key which a client asks to store the data. Yes
<index> Specify the index number which a client asks to store the data. The start number is 0. No

Return Code

  • Success

    • Each item is sent by the server.
      Value <key> <flags> <bytes> \r\n
      <data block> \r\n
      <key>is the key which is specified the previous command.
      <flags>This values is not used. Always 0.
      <bytes>is the number of bytes of data block without the delimiting \r\n.
      <data block>is the data.
      The 1st data block is the number of values.
      Next data blocks are each value of values.
    • Finally, the server sends these strings.
      END\r\n
  • Otherwise

    SERVER_ERROR #{ error messages }\r\n

plugin_test

echo

Purpose

echo is a command which split and display your input word.

Note: This command is a just example command for whoever want to add new plugin command.
echo <word>\r\n 

Semantics

Name Description Required
<word> This word will be displayed in terminal. No

Return Code

  • Success

    • Example
      > echo hello world!!
      ["echo", "hello", "world!!"]
      

plugin_map

ROMA can set data as HashMap style like Java by use plugin_map.

map_set

Purpose

map_set is a command which store data as a HashMap style.

map_set <key> <map_key> <flags> <exptime> <bytes>\r\n
<value>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<map_key> Specify the key which a client asks to store the data. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

  • > map_set foo bar 0 0 4
    > hoge
    STORED
    
  • Otherwise

    ERROR
    Connection closed by foreign host.
    

map_get

Purpose

map_get is a command which get data from HashMap.

map_get <key> <map_key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<map_key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

  • > map_get foo bar
    VALUE foo 0 4
    hoge
    END
    
  • Otherwise

    CLIENT_ERROR does not find key

map_delete

Purpose

map_delete is a deletion command which remove data from HashMap.

map_delete <key> <map_key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<map_key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

  • > map_delete foo bar
    DELETE
    
  • Otherwise

    NOT_FOUND

map_clear

Purpose

map_clear is a deletion command which remove all data which belong specified key.

map_clear <key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<map_key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

  • > map_clear foo
    CLEARED
    
  • Otherwise

    NOT_FOUND

map_size

Purpose

map_size is a command which count data size of specified map key.

map_size <key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes

Return Code

  • Success

  • > map_size foo
    2
    
  • Otherwise

    NOT_FOUND

map_key?

Purpose

map_key? is a command which check whether specified key is exist or not.

map_key? <key> <mapkey>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<map_key> Specify the key which a client asks to store the data. Yes

Return Code

  • Success

  • > map_key? foo bar
    true
    
    > map_key? foo baz
    false
    
  • Otherwise

    NOT_FOUND

map_value?

Purpose

map_value? is a command which check whether specified value is exist or not.

map_value? <key> <bytes>\r\n
<value>

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<bytes> Specify the number of bytes of value without the delimiting.
If the value is 0 then it follows by an empty value.
Yes
<value> Specify a chunk of arbitrary 8-bit data. This data of length is < bytes > from the previous line. Yes

Return Code

  • Success

  • > map_value? foo 5
    > aaaaa
    true
    
    > map_value? foo 5
    > bbbbb
    false
    
  • Otherwise

    NOT_FOUND

map_empty?

Purpose

map_empty? is a command which check whether specified key is nil or not.

map_empty? <key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes

Return Code

  • Success

  • > map_empty? foo
    false
    
    > map_empty? baz
    NOT_FOUND
    
  • Otherwise

    ERROR

map_keys

Purpose

map_keys is a command which display all key name which are stored in specified key.

map_keys <key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes

Return Code

  • Success

  • > map_keys foo
    VALUE foo 0 1
    2
    VALUE foo 0 3
    bar
    VALUE foo 0 3
    baz
    END
    
  • Otherwise

    ERROR

map_values

Purpose

map_values is a command which display all data value which are stored in specified key.

map_values <key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes

Return Code

  • Success

  • > map_values foo
    VALUE foo 0 1
    2
    VALUE foo 0 5
    value1
    VALUE foo 0 5
    value2
    END
    
  • Otherwise

    ERROR

map_to_s

Purpose

map_to_s is a command which convert HashMap data to String Type.

map_to_s <key>\r\n

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes

Return Code

  • Success

  • > map_to_s foo
    VALUE foo 0 32
    {"bar"=>"aaaaa", "baz"=>"sssss"}
    END
    
  • Otherwise

    ERROR

plugin_map_count

map_count plugin commands counts the updating count as a value.

mapcount_countup

Purpose

mapcount_countup is a increment command of value which is stored in specified key.

mapcount_countup <key> <exptime> <sub_keys_length>\r\n
<sub_key>

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<sub_keys_length> Specify the number of bytes of key without the delimiting. Yes
<sub_key> Specify the key which a client asks to store the data. Yes

Return Code

Return data will be diaplayed as json string style.

  • Success

  • > mapcount_countup foo 0 6
    access
    VALUE foo 0 58
    {"access":1,"last_updated_date":"2015-07-13T15:00:36 +00"}
    END
    
    > mapcount_countup foo 0 6
    access
    VALUE foo 0 58
    {"access":2,"last_updated_date":"2015-07-13T15:01:04 +00"}
    END
    
  • Otherwise

    SERVER_ERROR Message forward failed.

mapcount_countup_ms

Purpose

mapcount_countup_ms is a increment command of value which is stored in specified key.

mapcount_countup <key> <exptime> <sub_keys_length>\r\n
<sub_key>

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<sub_keys_length> Specify the number of bytes of key without the delimiting. Yes
<sub_key> Specify the key which a client asks to store the data. Yes

Return Code

Return data will be diaplayed as Marshal string style.

  • Success

  • > mapcount_countup_ms bar 0 6
    access
    VALUE bar 0 74                                                                                                                                           {I"
      access:ETiI"last_updated_date;TI"2015-07-13T15:04:45 +00;T
    END
    
    > mapcount_countup_ms bar 0 6
    access
    VALUE bar 0 74                                                                                                                                           {I"
      access:ETiI"last_updated_date;TI"2015-07-13T15:04:54 +00;T
    END
    
  • Otherwise

    SERVER_ERROR Message forward failed.

mapcount_update

Purpose

mapcount_update is a just update "last_updated_date" column which is stored in specified key.

mapcount_countup <key> <exptime> <sub_keys_length>\r\n
<sub_key>

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<sub_keys_length> Specify the number of bytes of key without the delimiting. Yes
<sub_key> Specify the key which a client asks to store the data. Yes

Return Code

Return data will be diaplayed as json string style.

  • Success

  • > mapcount_update foo 0 6
    access
    VALUE foo 0 58
    {"last_updated_date":"2015-07-13T15:07:07 +00","access":2}
    END
    
    > mapcount_update foo 0 6
    access
    VALUE foo 0 58
    {"last_updated_date":"2015-07-13T15:07:20 +00","access":2}
    END
    
  • Otherwise

    SERVER_ERROR Message forward failed.

mapcount_update_ms

Purpose

mapcount_update_ms is a just update "last_updated_date" column which is stored in specified key.

mapcount_countup_ms <key> <exptime> <sub_keys_length>\r\n
<sub_key>

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<exptime> Specify the expiration time(in unix time or seconds).
when you set expiration date under 1 month, set these seconds.
when you set expiration date over 1month, these seconds + current unix time.
Ex.)
  • expiration date : 7days
    7(d) * 24(h) * 60(m) * 60(s) = 604800(sec)
  • expiration date : 90days
    90(d) * 24(h) * 60(m) * 60(s) + (current unix time)
  • If the value is 0 then the data will not be expired.
Yes
<sub_keys_length> Specify the number of bytes of key without the delimiting. Yes
<sub_key> Specify the key which a client asks to store the data. Yes

Return Code

Return data will be diaplayed as Marshal string style.

  • Success

  • > mapcount_update_ms foo 0 6
    access
    VALUE foo 0 74                                                                                                                                           {I"last_updated_date:ETI"2015-07-13T15:10:40 +00;TI"
                                                       access;Ti
    END
    
    > mapcount_update_ms foo 0 6
    access
    VALUE foo 0 74                                                                                                                                           {I"last_updated_date:ETI"2015-07-13T15:10:48 +00;TI"
                                                       access;Ti
    END
    
  • Otherwise

    SERVER_ERROR Message forward failed.

mapcount_get

Purpose

mapcount_get is a command which get HashMap data(not update any value).

mapcount_get <key> <flags> <sub_keys_length>\r\n
<sub_key>

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<sub_keys_length> Specify the number of bytes of key without the delimiting. Yes
<sub_key> Specify the key which a client asks to store the data. Yes

Return Code

Return data will be diaplayed as json string style.

  • Success

  • > mapcount_get foo 0 6
    access
    VALUE foo 0 58
    {"last_updated_date":"2015-07-13T15:10:48 +00","access":2}
    END
    
  • Otherwise

    SERVER_ERROR Message forward failed.

mapcount_get_ms

Purpose

mapcount_get_ms is a command which get HashMap data(not update any value).

mapcount_get_ms <key> <flags> <sub_keys_length>\r\n
<sub_key>

Semantics

Name Description Required
<key> Specify the key which keep each HashMap datas. Yes
<flags> This values is not used. ROMA ignores this option.
So please input '0'.
Yes
<sub_keys_length> Specify the number of bytes of key without the delimiting. Yes
<sub_key> Specify the key which a client asks to store the data. Yes

Return Code

Return data will be diaplayed as Marshal string style.

  • Success

  • > mapcount_update_ms foo 0 6
    access
    VALUE foo 0 74                                                                                                                                           {I"last_updated_date:ETI"2015-07-13T15:15:46 +00;TI"
                                                       access;Ti
    END
    
  • Otherwise

    SERVER_ERROR Message forward failed.

plugin_debug

eval

Purpose

eval is a command which execute ruby's eval command.

Note: This command has possibility to change or break ROMA setting directory. BE CAREFUL TO USE!!
eval <command>\r\n 

Semantics

Name Description Required
<command> Specify the ruby command or value name. Yes

Return Code

  • Success

    • Example
      > eval @rttable
      #<Roma::Routing::ChurnbasedRoutingTable:0x00000001af4898>
      
      > eval (@rttable.lost_action = "no_action")
      no_action
      
  • Otherwise

    ERROR
    Connection closed by foreign host.
    

get_key_info

Purpose

get_key_info is a command which get information of specified key.

get_key_info <key>\r\n 

Semantics

Name Description Required
<key> Specify the key name. Yes

Return Code

  • Success

  • > get_key_info foo
    d = 3522174797 0xd1f01f4d
    vn = 3514826752 0xd1800000
    nodes = ["192.168.33.12_10002", "192.168.33.12_10003", "192.168.33.12_10001"]
    END
    
  • d : SHA1 hash value which are used for calculate virtual node(decimal and hexadecimal).
    vn : Virtual node number whom specified key was stored(decimal and hexadecimal).
    nodes : Nodes whom specified key was stored.
  • Otherwise

    CLIENT_ERROR number of arguments(0 for 1)

plugin_gui

plugin_gui.rb provides the command which are used in Gladiator(GUI tool).
So it is essential plugin if you want to use Gladiator.

get_routing_history

Purpose

get_routing_history is a command which get routing list when first constructing ROMA.

get_routing_history\r\n 

Return Code

  • Success

  • 192.168.33.12_10001
    192.168.33.12_10002
    192.168.33.12_10003
    END
    
  • Otherwise

    ERROR
    Connection closed by foreign host.
    

gather_logs

Purpose

gather_logs is a command which start gathering logs.

gather_logs [start_date] <end_date>\r\n 

Semantics

Name Description Required
[start_date] Specify the key start date.
Format is ISO8601(YYYY-MM-DDThh:mm:ss).
Yes
<end_date> Specify the key name.
Format is ISO8601(YYYY-MM-DDThh:mm:ss).
Default value is current time.
No

Return Code

  • Success

  • > gather_logs 2015-06-30T00:00:00 2015-06-30T23:59:59
    STARTED
    
    • Gathered log will be stored in memory.
    • You can see the gathered log by using "show_logs" command.
    • Gathered log will be removed after 5 min passed, without execute "show_logs" command.
  • Otherwise

    CLIENT_ERROR number of arguments(0 for 2-3)

show_logs

Purpose

gather_logs is a command of get logs whose gathering_logs command was gathered.

show_logs\r\n 

Semantics

Return Code

  • Success

  • 2015-06-30 15:15:41 +0900
    # Logfile created on 2015-06-30 14:59:41 +0900 by logger.rb/44203
    I, [2015-06-30T14:59:41.092719 #1483]  INFO -- : roma/plugin/plugin_storage.rb loaded
    I, [2015-06-30T14:59:41.101528 #1483]  INFO -- : roma/plugin/plugin_mapcount.rb loaded
    .
    .
    .
    I, [2015-06-30T15:15:03.374572 #1485]  INFO -- : storage_clean_up_process:stop
    D, [2015-06-30T15:15:41.112944 #1485] DEBUG -- : asyncev_start_get_logs ["2015-06-30T00:00:00", "2015-06-30T23:59:59"]
    D, [2015-06-30T15:15:41.113086 #1485] DEBUG -- : get_logs:start.
    END
    
    • Once getting the gathered logs, it will be removed from memory.
    • Response of first line is the date of executing "gather_logs" command.
  • Otherwise

    Not finished gathering

Back to top

@ 2017 Roma Project / Promoted by Rakuten, Inc. and Rakuten Institute of Technology