You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2023/03/08 06:17:05 UTC

[iotdb] branch master updated: Add Tsfile-settle-tool docs and modify the default port of the tool (#9233)

This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new cadc6519d8 Add Tsfile-settle-tool docs and modify the default port of the tool (#9233)
cadc6519d8 is described below

commit cadc6519d8e66813e996171c38454c433374f24f
Author: shuwenwei <55...@users.noreply.github.com>
AuthorDate: Wed Mar 8 14:16:58 2023 +0800

    Add Tsfile-settle-tool docs and modify the default port of the tool (#9233)
---
 .../Maintenance-Tools/TsFile-Settle-Tool.md        | 41 +++++++++++++++++++++
 .../Maintenance-Tools/TsFile-Settle-Tool.md        | 42 ++++++++++++++++++++++
 .../tools/settle/TsFileSettleByCompactionTool.java |  4 +--
 3 files changed, 85 insertions(+), 2 deletions(-)

diff --git a/docs/UserGuide/Maintenance-Tools/TsFile-Settle-Tool.md b/docs/UserGuide/Maintenance-Tools/TsFile-Settle-Tool.md
new file mode 100644
index 0000000000..e2cc13dae9
--- /dev/null
+++ b/docs/UserGuide/Maintenance-Tools/TsFile-Settle-Tool.md
@@ -0,0 +1,41 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+## TsFile Settle tool
+The TsFile Settle tool is used to rewrite one or more TsFiles that have modified record files, and submit the TsFile compaction task by sending an RPC to the DataNode to rewrite the TsFile.
+### Usage:
+```shell
+#MacOs or Linux
+./settle-tsfile.sh -h [host] -p [port] -f [filePaths]
+# Windows
+.\settle-tsfile.bat -h [host] -p [port] -f [filePaths]
+```
+The host and port parameters are the host and port of the DataNodeInternalRPCService. If not specified, the default values are 127.0.0.1 and 10730 respectively. The filePaths parameter specifies the absolute paths of all TsFiles to be submitted as a compaction task on this DataNode, separated by spaces. Pass in at least one path.
+### Example:
+```shell
+./settle-tsfile.sh -h 127.0.0.1 -p 10730 -f /data/sequence/root.sg/0/0/1672133354759-2-0-0.tsfile /data/sequence/root.sg/0/0/1672306417865-3-0-0.tsfile /data/sequence/root.sg/0/0/1672306417865-3-0-0.tsfile
+```
+### Requirement:
+* Specify at least one TsFile
+* All specified TsFiles are in the same space and are continuous, and cross-space compaction is not supported
+* The specified file path is the absolute path of the TsFile of the node where the specified DataNode is located
+* The specified DataNode is configured to allow the space where the input TsFile is located to perform the compaction
+* At least one of the specified TsFiles has a corresponding .mods file
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Maintenance-Tools/TsFile-Settle-Tool.md b/docs/zh/UserGuide/Maintenance-Tools/TsFile-Settle-Tool.md
new file mode 100644
index 0000000000..a5a07afd89
--- /dev/null
+++ b/docs/zh/UserGuide/Maintenance-Tools/TsFile-Settle-Tool.md
@@ -0,0 +1,42 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+## TsFile Settle工具
+TsFile Settle工具用于将一个或多个存在修改记录文件的TsFile重写,通过向DataNode发送RPC的方式提交TsFile合并任务来重写TsFile。
+### 使用方式:
+```shell
+#MacOs or Linux
+./settle-tsfile.sh -h [host] -p [port] -f [filePaths]
+# Windows
+.\settle-tsfile.bat -h [host] -p [port] -f [filePaths]
+```
+其中host和port参数为DataNodeInternalRPCService的host和port,如果不指定默认值分别为127.0.0.1和10730, filePaths参数指定要作为一个compaction任务提交的所有TsFile在此DataNode上的绝对路径,以空格分隔,需要传入至少一个路径。
+
+### 使用示例:
+```shell
+./settle-tsfile.sh -h 127.0.0.1 -p 10730 -f /data/sequence/root.sg/0/0/1672133354759-2-0-0.tsfile /data/sequence/root.sg/0/0/1672306417865-3-0-0.tsfile /data/sequence/root.sg/0/0/1672306417865-3-0-0.tsfile
+```
+### 使用要求:
+* 最少指定一个TsFile
+* 所有指定的TsFile都在同一个空间内且连续,不支持跨空间合并
+* 指定的文件路径为指定DataNode所在节点的该TsFile的绝对路径
+* 指定的DataNode上配置了允许输入的TsFile所在的空间执行合并操作
+* 指定的TsFile中至少有一个存在对应的.mods文件
\ No newline at end of file
diff --git a/server/src/main/java/org/apache/iotdb/db/tools/settle/TsFileSettleByCompactionTool.java b/server/src/main/java/org/apache/iotdb/db/tools/settle/TsFileSettleByCompactionTool.java
index 51eccb2ed2..7cc4102087 100644
--- a/server/src/main/java/org/apache/iotdb/db/tools/settle/TsFileSettleByCompactionTool.java
+++ b/server/src/main/java/org/apache/iotdb/db/tools/settle/TsFileSettleByCompactionTool.java
@@ -50,7 +50,7 @@ public class TsFileSettleByCompactionTool {
   private static final String FILE_PATH_NAME = "file paths";
 
   private static final String DEFAULT_HOST_VALUE = "127.0.0.1";
-  private static final String DEFAULT_PORT_VALUE = "9003";
+  private static final String DEFAULT_PORT_VALUE = "10730";
 
   public static void main(String[] args) throws TException {
     String[] filePaths;
@@ -100,7 +100,7 @@ public class TsFileSettleByCompactionTool {
         Option.builder(PORT_ARGS)
             .argName(PORT_NAME)
             .hasArg()
-            .desc("Port (optional, default 9003)")
+            .desc("Port (optional, default 10730)")
             .build();
     options.addOption(port);