You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/03/24 05:37:56 UTC

[GitHub] [iotdb] OneSizeFitsQuorum commented on a change in pull request #5330: [IOTDB-2747] Start data node

OneSizeFitsQuorum commented on a change in pull request #5330:
URL: https://github.com/apache/iotdb/pull/5330#discussion_r833926947



##########
File path: node-commons/src/main/java/org/apache/iotdb/commons/utils/CommonUtils.java
##########
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+package org.apache.iotdb.commons.utils;
+
+import org.apache.iotdb.service.rpc.thrift.EndPoint;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CommonUtils {
+  private static final Logger logger = LoggerFactory.getLogger(CommonUtils.class);
+
+  public static EndPoint parseNodeUrl(String nodeUrl) {
+    EndPoint result = new EndPoint();
+    String[] split = nodeUrl.split(":");
+    if (split.length != 2) {
+      logger.warn("Bad node url: {}", nodeUrl);
+      return null;
+    }
+    String ip = split[0];
+    try {
+      int port = Integer.parseInt(split[1]);
+      result.setIp(ip).setPort(port);
+    } catch (NumberFormatException e) {
+      logger.warn("Bad node url: {}", nodeUrl);

Review comment:
       return null?

##########
File path: server/pom.xml
##########
@@ -82,6 +82,16 @@
             <artifactId>influxdb-thrift</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift-datanode</artifactId>
+            <version>0.14.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift-confignode</artifactId>
+            <version>0.14.0-SNAPSHOT</version>

Review comment:
       ${project.version}

##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
##########
@@ -803,8 +808,28 @@
   /** Encryption provided class parameter */
   private String encryptDecryptProviderParameter;
 
+  /**
+   * Ip and port of config nodes. each one is a {internalIp | domain name}:{meta port} string tuple.
+   */
+  private List<String> configNodeUrls;
+
+  /** Internal ip for data node */
+  private String internalIp;
+
+  /** Internal port of data node */
+  private int internalPort = 9003;
+
+  /** The max time of data node waiting to join into the cluster */
+  private long joinClusterTimeOutMs = TimeUnit.SECONDS.toMillis(5);

Review comment:
       Maybe large? such as 1 minute?

##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
##########
@@ -131,7 +135,14 @@ private void loadProps() {
       properties.load(inputStream);
 
       conf.setRpcAddress(properties.getProperty("rpc_address", conf.getRpcAddress()));
-      replaceHostnameWithIP();
+
+      loadClusterProps(properties);
+
+      try {
+        replaceHostnameWithIP();

Review comment:
       Maybe we do not need this anymore if we can use FQDN to identify our nodes

##########
File path: server/pom.xml
##########
@@ -82,6 +82,16 @@
             <artifactId>influxdb-thrift</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift-datanode</artifactId>
+            <version>0.14.0-SNAPSHOT</version>

Review comment:
       ${project.version}




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org