[Groonga-commit] groonga/groonga at 561fb1d [master] doc logical_table_remove: add --force yes parameter

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Aug 30 19:30:09 JST 2016


Kouhei Sutou	2016-08-30 19:30:09 +0900 (Tue, 30 Aug 2016)

  New Revision: 561fb1db718a9f40ad6415adf5997b30724d88ba
  https://github.com/groonga/groonga/commit/561fb1db718a9f40ad6415adf5997b30724d88ba

  Message:
    doc logical_table_remove: add --force yes parameter

  Added files:
    doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_create.log
    doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_index_column_exist.log
    doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_remove_force.log
  Copied files:
    doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_remove.log
      (from doc/source/example/reference/commands/logical_table_remove/remove_with_reference_default.log)
  Modified files:
    doc/locale/ja/LC_MESSAGES/reference.po
    doc/source/example/reference/commands/logical_table_remove/remove_with_reference_default.log
    doc/source/reference/commands/logical_table_remove.rst

  Modified: doc/locale/ja/LC_MESSAGES/reference.po (+76 -4)
===================================================================
--- doc/locale/ja/LC_MESSAGES/reference.po    2016-08-30 18:48:29 +0900 (8f687c1)
+++ doc/locale/ja/LC_MESSAGES/reference.po    2016-08-30 19:30:09 +0900 (b2ec92d)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 1.2.1\n"
 "Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2016-08-29 11:00+0900\n"
+"PO-Revision-Date: 2016-08-30 19:28+0900\n"
 "Last-Translator: Masafumi Yokoyama <yokoyama �� clear-code.com>\n"
 "Language-Team: Japanese\n"
 "Language: ja\n"
@@ -7041,6 +7041,13 @@ msgstr ""
 "``dependent`` パラメーターを使うと、対象テーブルを参照しているテーブル・カラ"
 "ムと対象シャードに関連しているテーブルも一緒に削除できます。"
 
+msgid ""
+"You can remove broken tables and columns as much as possible by using "
+"``force`` parameter."
+msgstr ""
+"``force`` パラメーターを使うと壊れているテーブル・カラムでもできるだけ削除す"
+"ることができます。"
+
 msgid "You specify logical table name and shard key what you want to remove."
 msgstr "削除したい論理テーブル名とシャードキーを指定します。"
 
@@ -7059,6 +7066,9 @@ msgstr "削除できないケース"
 msgid "Removes with related tables"
 msgstr "関連するテーブルと一緒に削除"
 
+msgid "Removes broken tables as much as possible"
+msgstr "可能な限り壊れているテーブルを削除"
+
 msgid "Decreases used resources"
 msgstr "利用リソースの削減"
 
@@ -7313,6 +7323,54 @@ msgstr ""
 "を確認します。"
 
 msgid ""
+"If the target tables are broken, you can't remove them. But you can remove "
+"them as much as possible by using ``force`` parameter."
+msgstr ""
+"対象のテーブルが壊れていた場合は削除できません。しかし、 ``force`` パラメー"
+"ターを指定することで可能な限り削除することができます。"
+
+msgid ""
+"If you specify ``--force yes``, they are removed as much as possible. In "
+"some cases, some tables and/or columns may not be removed. For example, "
+"broken index column can't be removed."
+msgstr ""
+"``--force yes`` を指定すると、対象テーブルを可能な限り削除します。いくつかの"
+"ケースでは削除できないテーブル・カラムがあります。たとえば、インデックスカラ"
+"ムが壊れている場合はそのインデックスカラムを削除できません。"
+
+msgid "Here is a sample schema to show this case:"
+msgstr "以下はこのケースを示すサンプルスキーマです。"
+
+msgid ""
+"You can't remove ``Logs_20160320`` when ``Timestamps."
+"logs_20160320_timestamp`` is broken:"
+msgstr ""
+"``Timestamps.logs_20160320_timestamp`` が壊れていると ``Logs_20160320`` を削"
+"除できません。"
+
+msgid ""
+"You can remove ``Logs_20160320`` and its columns by using ``--force yes`` "
+"parameter even when ``Timestamps.logs_20160320_timestamp`` is broken:"
+msgstr ""
+"``--force yes`` パラメーターを使うと、たとえ ``Timestamps."
+"logs_20160320_timestamp`` が壊れていても ``Logs_20160320`` とこのテーブルのカ"
+"ラムを削除できます。"
+
+msgid ""
+"``Logs_20160320`` and its columns are removed but ``Timestamps."
+"logs_20160320_timestamp`` isn't removed:"
+msgstr ""
+"``Logs_20160320`` とそのテーブルのカラムは削除されますが ``Timestamps."
+"logs_20160320_timestamp`` は削除されません。"
+
+msgid ""
+"``--force yes`` parameter is a dangerous parameter. Normally, you don't need "
+"to use it."
+msgstr ""
+"``--force yes`` パラメーターは危険なパラメーターです。通常これを使う必要はあ"
+"りません。"
+
+msgid ""
 "You can decrease resources for this command. See :ref:`table-remove-"
 "decreases-used-resources` for details. Because ``logical_table_remove`` uses "
 "the same logic as :doc:`table_remove`."
@@ -7406,6 +7464,23 @@ msgstr ""
 "このパラメーターの使い方は :ref:`logical-table-remove-removes-with-related-"
 "tables` を参照してください。"
 
+msgid "``force``"
+msgstr ""
+
+msgid ""
+"Specifies whether you want to remove target tables and columns even if some "
+"problems exist."
+msgstr ""
+"もし問題があったとしても対象テーブル・カラムを削除したいかどうかを指定しま"
+"す。"
+
+msgid ""
+"See :ref:`logical-table-removes-broken-tables-as-much-as-possible` how to "
+"use this parameter."
+msgstr ""
+"このパラメーターの使い方は :ref:`logical-table-removes-broken-tables-as-much-"
+"as-possible` を参照してください。"
+
 msgid "``normalize``"
 msgstr ""
 
@@ -8459,9 +8534,6 @@ msgstr ""
 "カラムを削除したいときは、次のように ``テーブル名.カラム名`` という書式を使っ"
 "てください。"
 
-msgid "``force``"
-msgstr ""
-
 msgid "Specifies whether removing the object in \"force mode\"."
 msgstr "「強制モード」でオブジェクトを削除するかどうかを指定します。"
 

  Added: doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_create.log (+11 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_create.log    2016-08-30 19:30:09 +0900 (4e2650b)
@@ -0,0 +1,11 @@
+Execution example::
+
+  table_create  Logs_20160320 TABLE_NO_KEY
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_create Logs_20160320 timestamp COLUMN_SCALAR Time
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  table_create  Timestamps TABLE_PAT_KEY Time
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_create Timestamps logs_20160320_timestamp \
+    COLUMN_INDEX Logs_20160320 timestamp
+  # [[0, 1337566253.89858, 0.000355720520019531], true]

  Added: doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_index_column_exist.log (+8 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_index_column_exist.log    2016-08-30 19:30:09 +0900 (06e6954)
@@ -0,0 +1,8 @@
+Execution example::
+
+  object_exist Logs_20160320
+  # [[0, 1337566253.89858, 0.000355720520019531], false]
+  object_exist Logs_20160320.timestamp
+  # [[0, 1337566253.89858, 0.000355720520019531], false]
+  object_exist Timestamps.logs_20160320_timestamp
+  # [[0, 1337566253.89858, 0.000355720520019531], true]

  Copied: doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_remove.log (+3 -3) 69%
===================================================================
--- doc/source/example/reference/commands/logical_table_remove/remove_with_reference_default.log    2016-08-30 18:48:29 +0900 (01882da)
+++ doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_remove.log    2016-08-30 19:30:09 +0900 (4b37d31)
@@ -5,15 +5,15 @@ Execution example::
     --shard_key timestamp
   # [
   #   [
-  #     -2, 
+  #     -55, 
   #     1337566253.89858, 
   #     0.000355720520019531, 
-  #     "operation not permitted: <[table][remove] a column that references the table exists: <Bookmarks.log_20160320> -> <Logs_20160320", 
+  #     "object corrupt: <[column][remove][index] hook has a dangling reference: <Logs_20160320.timestamp> -> <Timestamps.logs_20160320_", 
   #     [
   #       [
   #         "Groonga::Sharding::LogicalTableRemoveCommand.remove_table", 
   #         "/home/kou/work/c/groonga.clean/plugins/sharding/logical_table_remove.rb", 
-  #         80
+  #         139
   #       ]
   #     ]
   #   ]

  Added: doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_remove_force.log (+7 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/logical_table_remove/remove_broken_tables_remove_force.log    2016-08-30 19:30:09 +0900 (634e7be)
@@ -0,0 +1,7 @@
+Execution example::
+
+  logical_table_remove \
+    --logical_table Logs \
+    --shard_key timestamp \
+    --force yes
+  # [[0, 1337566253.89858, 0.000355720520019531], true]

  Modified: doc/source/example/reference/commands/logical_table_remove/remove_with_reference_default.log (+1 -1)
===================================================================
--- doc/source/example/reference/commands/logical_table_remove/remove_with_reference_default.log    2016-08-30 18:48:29 +0900 (01882da)
+++ doc/source/example/reference/commands/logical_table_remove/remove_with_reference_default.log    2016-08-30 19:30:09 +0900 (9e7b64d)
@@ -13,7 +13,7 @@ Execution example::
   #       [
   #         "Groonga::Sharding::LogicalTableRemoveCommand.remove_table", 
   #         "/home/kou/work/c/groonga.clean/plugins/sharding/logical_table_remove.rb", 
-  #         80
+  #         139
   #       ]
   #     ]
   #   ]

  Modified: doc/source/reference/commands/logical_table_remove.rst (+84 -0)
===================================================================
--- doc/source/reference/commands/logical_table_remove.rst    2016-08-30 18:48:29 +0900 (03ea994)
+++ doc/source/reference/commands/logical_table_remove.rst    2016-08-30 19:30:09 +0900 (9276a65)
@@ -37,6 +37,11 @@ specify range as between ``2016-03-18 00:00:00`` and ``2016-03-18
    table and tables related with the target shard by using
    ``dependent`` parameter.
 
+.. versionadded:: 6.0.9
+
+   You can remove broken tables and columns as much as possible by
+   using ``force`` parameter.
+
 Syntax
 ------
 
@@ -51,6 +56,7 @@ The required parameters are ``logical_table`` and ``shard_key``::
                        [max=null]
                        [max_border="include"]
                        [dependent=no]
+                       [force=no]
 
 .. _logical-table-remove-usage:
 
@@ -65,6 +71,7 @@ This section describes about the followings:
   * Removes parts of a logical table
   * Unremovable cases
   * Removes with related tables
+  * Removes broken tables as much as possible
   * Decreases used resources
 
 .. _logical-table-remove-basic-usage:
@@ -332,6 +339,70 @@ table aren't removed:
 .. object_exist NotRelated_20160320
 .. object_exist Servers
 
+.. _logical-table-removes-broken-tables-as-much-as-possible:
+
+Removes broken tables as much as possible
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 6.0.9
+
+If the target tables are broken, you can't remove them. But you can
+remove them as much as possible by using ``force`` parameter.
+
+If you specify ``--force yes``, they are removed as much as
+possible. In some cases, some tables and/or columns may not be
+removed. For example, broken index column can't be removed.
+
+Here is a sample schema to show this case:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/logical_table_remove/remove_broken_tables_create.log
+.. table_create  Logs_20160320 TABLE_NO_KEY
+.. column_create Logs_20160320 timestamp COLUMN_SCALAR Time
+..
+.. table_create  Timestamps TABLE_PAT_KEY Time
+.. column_create Timestamps logs_20160320_timestamp \
+..   COLUMN_INDEX Logs_20160320 timestamp
+
+You can't remove ``Logs_20160320`` when
+``Timestamps.logs_20160320_timestamp`` is broken:
+
+.. groonga-command
+.. thread_limit 1
+.. database_unmap
+.. .. ${DB_PATH}.0000109 is Timestamps.logs_20160320_timestamp.
+.. .. You can confirm ID of Timestamps.logs_20160320_timestamp by object_list.
+.. % echo > ${DB_PATH}.0000109
+
+.. groonga-command
+.. include:: ../../example/reference/commands/logical_table_remove/remove_broken_tables_remove.log
+.. logical_table_remove \
+..   --logical_table Logs \
+..   --shard_key timestamp
+
+You can remove ``Logs_20160320`` and its columns by using ``--force
+yes`` parameter even when ``Timestamps.logs_20160320_timestamp`` is
+broken:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/logical_table_remove/remove_broken_tables_remove_force.log
+.. logical_table_remove \
+..   --logical_table Logs \
+..   --shard_key timestamp \
+..   --force yes
+
+``Logs_20160320`` and its columns are removed but
+``Timestamps.logs_20160320_timestamp`` isn't removed:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/logical_table_remove/remove_broken_tables_index_column_exist.log
+.. object_exist Logs_20160320
+.. object_exist Logs_20160320.timestamp
+.. object_exist Timestamps.logs_20160320_timestamp
+
+``--force yes`` parameter is a dangerous parameter. Normally, you
+don't need to use it.
+
 .. _logical-table-remove-decreases-used-resources:
 
 Decreases used resources
@@ -443,6 +514,19 @@ You should use this parameter carefully. This is a danger parameter.
 See :ref:`logical-table-remove-removes-with-related-tables` how to use
 this parameter.
 
+``force``
+"""""""""
+
+.. versionadded:: 6.0.9
+
+Specifies whether you want to remove target tables and columns even if
+some problems exist.
+
+You should use this parameter carefully. This is a danger parameter.
+
+See :ref:`logical-table-removes-broken-tables-as-much-as-possible` how
+to use this parameter.
+
 Return value
 ------------
 
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index