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

lta pushed a commit to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/cluster by this push:
     new 9c24a01  modify startup script
9c24a01 is described below

commit 9c24a01db35acf5cff6b5e41237465303e43e273
Author: lta <[email protected]>
AuthorDate: Fri Apr 5 19:00:45 2019 +0800

    modify startup script
---
 .../apache/iotdb/cluster/config/ClusterDescriptor.java   |  8 ++++++++
 .../iotdb/cluster/config/ClusterDescriptorTest.java      |  6 ------
 iotdb/iotdb/bin/start-cluster.bat                        |  1 -
 iotdb/iotdb/bin/start-cluster.sh                         |  1 -
 iotdb/iotdb/conf/iotdb-cluster.properties                |  6 +++---
 .../java/org/apache/iotdb/db/conf/IoTDBConstant.java     |  3 ---
 .../java/org/apache/iotdb/db/conf/IoTDBDescriptor.java   | 16 ++++------------
 7 files changed, 15 insertions(+), 26 deletions(-)

diff --git 
a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
index ee6a536..9b8eb75 100644
--- 
a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
+++ 
b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
@@ -24,13 +24,19 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
+import org.apache.iotdb.cluster.rpc.service.TSServiceClusterImpl;
+import org.apache.iotdb.db.conf.IoTDBConfig;
 import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ClusterDescriptor {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(ClusterDescriptor.class);
+
+  private IoTDBConfig ioTDBConf = IoTDBDescriptor.getInstance().getConfig();
+
   private ClusterConfig conf = new ClusterConfig();
 
   private ClusterDescriptor() {
@@ -51,6 +57,8 @@ public class ClusterDescriptor {
    * In most case, you should invoke this method.
    */
   public void loadProps() {
+    ioTDBConf.setRpcImplClassName(TSServiceClusterImpl.class.getName());
+    ioTDBConf.setEnableWal(false);
     conf.setDefaultPath();
     InputStream inputStream;
     String url = System.getProperty(IoTDBConstant.IOTDB_CONF, null);
diff --git 
a/cluster/src/test/java/org/apache/iotdb/cluster/config/ClusterDescriptorTest.java
 
b/cluster/src/test/java/org/apache/iotdb/cluster/config/ClusterDescriptorTest.java
index abbb827..feb916c 100644
--- 
a/cluster/src/test/java/org/apache/iotdb/cluster/config/ClusterDescriptorTest.java
+++ 
b/cluster/src/test/java/org/apache/iotdb/cluster/config/ClusterDescriptorTest.java
@@ -99,10 +99,6 @@ public class ClusterDescriptorTest {
     }
   };
 
-  static {
-    System.setProperty(IoTDBConstant.IOTDB_TYPE, "CLUSTER");
-  }
-
   @Before
   public void setUp() throws Exception {
     EnvironmentUtils.envSetUp();
@@ -145,8 +141,6 @@ public class ClusterDescriptorTest {
     assertEquals(testQueueLenNew, config.getMaxQueueNumOfInnerRpcClient() + 
"");
     assertEquals(testMetadataConsistencyNew, 
config.getReadMetadataConsistencyLevel() + "");
     assertEquals(testDataConsistencyNew, config.getReadDataConsistencyLevel() 
+ "");
-    
assertEquals(IoTDBDescriptor.getInstance().getConfig().getRpcImplClassName(),
-        IoTDBConstant.CLUSTER_RPC_IMPL_CALSS);
 
     System.setProperty(IoTDBConstant.IOTDB_CONF, "");
     config.deleteAllPath();
diff --git a/iotdb/iotdb/bin/start-cluster.bat 
b/iotdb/iotdb/bin/start-cluster.bat
index 8728ce3..6132850 100755
--- a/iotdb/iotdb/bin/start-cluster.bat
+++ b/iotdb/iotdb/bin/start-cluster.bat
@@ -56,7 +56,6 @@ popd
 
 set IOTDB_CONF=%IOTDB_HOME%\conf
 set IOTDB_LOGS=%IOTDB_HOME%\logs
-set IOTDB_TYPE=CLUSTER
 
 IF EXIST "%IOTDB_CONF%\iotdb-env.bat" (
     CALL "%IOTDB_CONF%\iotdb-env.bat"
diff --git a/iotdb/iotdb/bin/start-cluster.sh b/iotdb/iotdb/bin/start-cluster.sh
index bf41270..c057af8 100755
--- a/iotdb/iotdb/bin/start-cluster.sh
+++ b/iotdb/iotdb/bin/start-cluster.sh
@@ -28,7 +28,6 @@ if [ -z "${IOTDB_HOME}" ]; then
 fi
 
 IOTDB_CONF=${IOTDB_HOME}/conf
-IOTDB_TYPE=CLUSTER
 # IOTDB_LOGS=${IOTDB_HOME}/logs
 
 if [ -f "$IOTDB_CONF/iotdb-env.sh" ]; then
diff --git a/iotdb/iotdb/conf/iotdb-cluster.properties 
b/iotdb/iotdb/conf/iotdb-cluster.properties
index 88bd41a..0f43f6f 100644
--- a/iotdb/iotdb/conf/iotdb-cluster.properties
+++ b/iotdb/iotdb/conf/iotdb-cluster.properties
@@ -55,14 +55,14 @@ task_timeout_ms = 1000
 num_of_virtula_nodes = 2
 
 # Max number of use inner rpc client
-max_num_of_inner_rpc_client = 50;
+max_num_of_inner_rpc_client = 50
 
 # Max number of queue length to use inner rpc client, the request which exceed 
to this
 # number will be rejected.
 max_queue_num_of_inner_rpc_client = 50
 
-# ReadMetadataConsistencyLevel: 1 Strong consistency, 2 Weak consistency
+# ReadMetadataConsistencyLevel: 1  Strong consistency, 2  Weak consistency
 read_metadata_consistency_level = 1
 
-# ReadDataConsistencyLevel: 1 Strong consistency, 2 Weak consistency
+# ReadDataConsistencyLevel: 1  Strong consistency, 2  Weak consistency
 read_data_consistency_level = 1
\ No newline at end of file
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java 
b/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
index 0d5aed1..f9c5462 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
@@ -35,8 +35,6 @@ public class IoTDBConstant {
   public static final String JMX_REMOTE_RMI_PORT = 
"com.sun.management.jmxremote.rmi.port";
   public static final String IOTDB_PACKAGE = "org.apache.iotdb.service";
   public static final String JMX_TYPE = "type";
-  public static final String IOTDB_TYPE = "IOTDB_TYPE";
-  public static final String IOTDB_CLUSTER_TYPE = "CLUSTER";
 
   public static final long GB = 1024 * 1024 * 1024L;
   public static final long MB = 1024 * 1024L;
@@ -59,5 +57,4 @@ public class IoTDBConstant {
   public static final String MIN_TIME = "min_time";
   public static final int MIN_SUPPORTED_JDK_VERSION = 8;
 
-  public static final String CLUSTER_RPC_IMPL_CALSS = 
"org.apache.iotdb.cluster.rpc.service.TSServiceClusterImpl";
 }
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java 
b/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index d4a2bee..38892fd 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -52,13 +52,6 @@ public class IoTDBDescriptor {
   private void loadProps() {
     InputStream inputStream;
 
-    /** IoTDB Type: Single or Cluster **/
-    String iotdbType = System.getProperty(IoTDBConstant.IOTDB_TYPE, null);
-    if (iotdbType != null && 
iotdbType.equals(IoTDBConstant.IOTDB_CLUSTER_TYPE)) {
-      conf.setRpcImplClassName(IoTDBConstant.CLUSTER_RPC_IMPL_CALSS);
-      conf.setEnableWal(false);
-    }
-
     String url = System.getProperty(IoTDBConstant.IOTDB_CONF, null);
     if (url == null) {
       url = System.getProperty(IoTDBConstant.IOTDB_HOME, null);
@@ -120,12 +113,11 @@ public class IoTDBDescriptor {
       conf.setRpcAddress(properties.getProperty("rpc_address", 
conf.getRpcAddress()));
 
       conf.setRpcPort(Integer.parseInt(properties.getProperty("rpc_port",
-              Integer.toString(conf.getRpcPort()))));
+          Integer.toString(conf.getRpcPort()))));
+
+      
conf.setEnableWal(Boolean.parseBoolean(properties.getProperty("enable_wal",
+          Boolean.toString(conf.isEnableWal()))));
 
-      if (iotdbType == null || 
!iotdbType.equals(IoTDBConstant.IOTDB_CLUSTER_TYPE)) {
-        
conf.setEnableWal(Boolean.parseBoolean(properties.getProperty("enable_wal",
-            Boolean.toString(conf.isEnableWal()))));
-      }
       conf.setFlushWalThreshold(Integer
           .parseInt(properties.getProperty("flush_wal_threshold",
                   Integer.toString(conf.getFlushWalThreshold()))));

Reply via email to