7.3.36. logical_shard_list

7.3.36.1. Summary

New in version 5.0.7.

logical_shard_list returns all existing shard names against the specified logical table name.

7.3.36.2. Syntax

This command takes only one required parameter:

logical_shard_list logical_table

7.3.36.3. Usage

You need to register sharding plugin to use this command:

Execution example:

plugin_register sharding
# [[0, 1337566253.89858, 0.000355720520019531], true]

Here are sample shards:

Execution example:

table_create  Logs_20150801           TABLE_HASH_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Logs_20150801 timestamp COLUMN_SCALAR  Time
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create  Logs_20150802           TABLE_HASH_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Logs_20150802 timestamp COLUMN_SCALAR  Time
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create  Logs_20150930           TABLE_HASH_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Logs_20150930 timestamp COLUMN_SCALAR  Time
# [[0, 1337566253.89858, 0.000355720520019531], true]

You can get the all shard names in ascending order by specifying Logs as the logical table name:

Execution example:

logical_shard_list --logical_table Logs
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     {
#       "name": "Logs_20150801"
#     },
#     {
#       "name": "Logs_20150802"
#     },
#     {
#       "name": "Logs_20150930"
#     }
#   ]
# ]

7.3.36.4. Parameters

This section describes parameters.

7.3.36.4.1. Required parameters

There is only one required parameter.

7.3.36.4.1.1. logical_table

Specifies the logical table name. logical_shard_list returns a list of shard name of the logical table:

Execution example:

logical_shard_list --logical_table Logs
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     {
#       "name": "Logs_20150801"
#     },
#     {
#       "name": "Logs_20150802"
#     },
#     {
#       "name": "Logs_20150930"
#     }
#   ]
# ]

The list is sorted by shard name in ascending order.

7.3.36.4.2. Optional parameters

There is no optional parameter.

7.3.36.5. Return value

The command returns a list of shard names in ascending order:

[
  HEADER,
  [
    {"name": "SHARD_NAME_1"},
    {"name": "SHARD_NAME_2"},
    ...
    {"name": "SHARD_NAME_N"}
  ]
]

See Output format for HEADER.

7.3.36.6. See also