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/15 12:15:44 UTC

[GitHub] [iotdb] qiaojialin commented on a change in pull request #5247: [To new_cluster] [IOTDB-2685] Create and start config node

qiaojialin commented on a change in pull request #5247:
URL: https://github.com/apache/iotdb/pull/5247#discussion_r826903252



##########
File path: confignode/src/main/java/org/apache/iotdb/confignode/service/register/ServiceType.java
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.confignode.service.register;
+
+public enum ServiceType {
+  JMX_SERVICE("JMX ServerService", "JMX ServerService"),
+  CLUSTER_RPC_SERVICE("Cluster RPC Service", "ClusterRPCService");

Review comment:
       ```suggestion
     CLUSTER_RPC_SERVER("Cluster RPC Server", "ClusterRPCServer");
   ```

##########
File path: iotdb-commons/pom.xml
##########
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>0.13.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-commons</artifactId>
+    <name>IoTDB Cluster common tools</name>

Review comment:
       ```suggestion
       <name>IoTDB commons</name>
   ```

##########
File path: confignode/src/main/java/org/apache/iotdb/confignode/service/startup/StartupChecks.java
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.confignode.service.startup;
+
+import org.apache.iotdb.confignode.conf.ConfigNodeConstant;
+import org.apache.iotdb.confignode.exception.startup.StartupException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** StartupChecks checks the startup environment for running ConfigNode */
+public class StartupChecks {
+
+  private static final Logger LOGGER = LoggerFactory.getLogger(StartupChecks.class);
+  public static final StartupCheck checkJMXPort =
+      () -> {
+        String jmxPort = System.getProperty(ConfigNodeConstant.CONFIGNODE_JMX_PORT);
+        if (jmxPort == null) {
+          LOGGER.warn(
+              "{} missing from {}.sh(Unix or OS X, if you use Windows," + " check conf/{}.bat)",
+              ConfigNodeConstant.CONFIGNODE_JMX_PORT,
+              ConfigNodeConstant.ENV_FILE_NAME,
+              ConfigNodeConstant.ENV_FILE_NAME);
+        } else {
+          LOGGER.info("JMX is enabled to receive remote connection on port {}", jmxPort);
+        }
+      };
+  public static final StartupCheck checkJDK =
+      () -> {
+        int version = getJdkVersion();
+        if (version < ConfigNodeConstant.MIN_SUPPORTED_JDK_VERSION) {
+          throw new StartupException(
+              String.format(
+                  "Requires JDK version >= %d, current version is %d",
+                  ConfigNodeConstant.MIN_SUPPORTED_JDK_VERSION, version));
+        } else {
+          LOGGER.info("JDK version is {}.", version);
+        }
+      };
+  private final List<StartupCheck> preChecks = new ArrayList<>();
+  private final List<StartupCheck> defaultTests = new ArrayList<>();

Review comment:
       ```suggestion
     private final List<StartupCheck> defaultChecks = new ArrayList<>();
   ```

##########
File path: iotdb-commons/pom.xml
##########
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>0.13.0-SNAPSHOT</version>

Review comment:
       ```suggestion
           <version>0.14.0-SNAPSHOT</version>
   ```
   or use parent 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