| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
.. groonga-command |
| 4 |
.. database: commands_logical_shard_list |
| 5 |
|
| 6 |
``logical_shard_list`` |
| 7 |
====================== |
| 8 |
|
| 9 |
Summary |
| 10 |
------- |
| 11 |
|
| 12 |
.. versionadded:: 5.0.7 |
| 13 |
|
| 14 |
``logical_shard_list`` returns all existing shard names against the |
| 15 |
specified logical table name. |
| 16 |
|
| 17 |
Syntax |
| 18 |
------ |
| 19 |
|
| 20 |
This command takes only one required parameter:: |
| 21 |
|
| 22 |
logical_shard_list logical_table |
| 23 |
|
| 24 |
Usage |
| 25 |
----- |
| 26 |
|
| 27 |
You need to register ``sharding`` plugin to use this command: |
| 28 |
|
| 29 |
.. groonga-command |
| 30 |
.. include:: ../../example/reference/commands/logical_shard_list/usage_register.log |
| 31 |
.. plugin_register sharding |
| 32 |
|
| 33 |
Here are sample shards: |
| 34 |
|
| 35 |
.. groonga-command |
| 36 |
.. include:: ../../example/reference/commands/logical_shard_list/usage_shards.log |
| 37 |
.. table_create Logs_20150801 TABLE_HASH_KEY ShortText |
| 38 |
.. column_create Logs_20150801 timestamp COLUMN_SCALAR Time |
| 39 |
.. table_create Logs_20150802 TABLE_HASH_KEY ShortText |
| 40 |
.. column_create Logs_20150802 timestamp COLUMN_SCALAR Time |
| 41 |
.. table_create Logs_20150930 TABLE_HASH_KEY ShortText |
| 42 |
.. column_create Logs_20150930 timestamp COLUMN_SCALAR Time |
| 43 |
|
| 44 |
You can get the all shard names in ascending order by specifying |
| 45 |
``Logs`` as the logical table name: |
| 46 |
|
| 47 |
.. groonga-command |
| 48 |
.. include:: ../../example/reference/commands/logical_shard_list/usage_list.log |
| 49 |
.. logical_shard_list --logical_table Logs |
| 50 |
|
| 51 |
|
| 52 |
Parameters |
| 53 |
---------- |
| 54 |
|
| 55 |
This section describes parameters. |
| 56 |
|
| 57 |
Required parameters |
| 58 |
^^^^^^^^^^^^^^^^^^^ |
| 59 |
|
| 60 |
There is only one required parameter. |
| 61 |
|
| 62 |
.. _logical-shard-logical-table: |
| 63 |
|
| 64 |
``logical_table`` |
| 65 |
""""""""""""""""" |
| 66 |
|
| 67 |
Specifies the logical table name. ``logical_shard_list`` returns a |
| 68 |
list of shard name of the logical table: |
| 69 |
|
| 70 |
.. groonga-command |
| 71 |
.. include:: ../../example/reference/commands/logical_shard_list/logical_table.log |
| 72 |
.. logical_shard_list --logical_table Logs |
| 73 |
|
| 74 |
The list is sorted by shard name in ascending order. |
| 75 |
|
| 76 |
Optional parameters |
| 77 |
^^^^^^^^^^^^^^^^^^^ |
| 78 |
|
| 79 |
There is no optional parameter. |
| 80 |
|
| 81 |
Return value |
| 82 |
------------ |
| 83 |
|
| 84 |
The command returns a list of shard names in ascending order:: |
| 85 |
|
| 86 |
[ |
| 87 |
HEADER, |
| 88 |
[ |
| 89 |
{"name": "SHARD_NAME_1"}, |
| 90 |
{"name": "SHARD_NAME_2"}, |
| 91 |
... |
| 92 |
{"name": "SHARD_NAME_N"} |
| 93 |
] |
| 94 |
] |
| 95 |
|
| 96 |
See :doc:`/reference/command/output_format` for ``HEADER``. |
| 97 |
|
| 98 |
See also |
| 99 |
-------- |
| 100 |
|
| 101 |
* :doc:`/reference/sharding` |