You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yo...@apache.org on 2025/09/21 05:59:10 UTC

(iotdb) branch master updated: Append some interfaces for Nodes startup (#16452)

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

yongzao 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 21c1893db08 Append some interfaces for Nodes startup (#16452)
21c1893db08 is described below

commit 21c1893db08842957d3a3a4885615ea6dcc73492
Author: libo <ze...@163.com>
AuthorDate: Sun Sep 21 13:59:04 2025 +0800

    Append some interfaces for Nodes startup (#16452)
---
 .../apache/iotdb/confignode/service/ConfigNode.java | 21 +++++++++++++++++++++
 .../java/org/apache/iotdb/db/service/DataNode.java  | 20 ++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index 39612202720..819f655c23f 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -201,7 +201,12 @@ public class ConfigNode extends ServerCommandLine implements ConfigNodeMBean {
             startUpSleep("restart ConfigNode failed! ");
           }
         }
+        loadSecretKey();
+        loadHardwareCode();
         return;
+      } else {
+        saveSecretKey();
+        saveHardwareCode();
       }
 
       /* Initial startup of Seed-ConfigNode */
@@ -413,6 +418,22 @@ public class ConfigNode extends ServerCommandLine implements ConfigNodeMBean {
     stop();
   }
 
+  protected void saveSecretKey() {
+    // Do nothing
+  }
+
+  protected void saveHardwareCode() {
+    // Do nothing
+  }
+
+  protected void loadSecretKey() throws IOException {
+    // Do nothing
+  }
+
+  protected void loadHardwareCode() throws IOException {
+    // Do nothing
+  }
+
   private TConfigNodeLocation generateConfigNodeLocation(int configNodeId) {
     return new TConfigNodeLocation(
         configNodeId,
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
index be7c97a13ba..86e217ebdbc 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -238,6 +238,8 @@ public class DataNode extends ServerCommandLine implements DataNodeMBean {
         ConfigNodeInfo.getInstance().storeConfigNodeList();
         // Register this DataNode to the cluster when first start
         sendRegisterRequestToConfigNode(false);
+        saveSecretKey();
+        saveHardwareCode();
       } else {
         /* Check encrypt magic string */
         try {
@@ -247,6 +249,8 @@ public class DataNode extends ServerCommandLine implements DataNodeMBean {
         }
         // Send restart request of this DataNode
         sendRestartRequestToConfigNode();
+        loadSecretKey();
+        loadHardwareCode();
       }
       // TierManager need DataNodeId to do some operations so the reset method need to be invoked
       // after DataNode adding
@@ -550,6 +554,22 @@ public class DataNode extends ServerCommandLine implements DataNodeMBean {
     }
   }
 
+  protected void saveSecretKey() {
+    // Do nothing
+  }
+
+  protected void saveHardwareCode() {
+    // Do nothing
+  }
+
+  protected void loadSecretKey() throws IOException {
+    // Do nothing
+  }
+
+  protected void loadHardwareCode() throws IOException {
+    // Do nothing
+  }
+
   private void makeRegionsCorrect(List<TRegionReplicaSet> correctRegions) {
     List<ConsensusGroupId> dataNodeConsensusGroupIds =
         correctRegions.stream()