类 SystemPropertiesUtils
- java.lang.Object
-
- org.apache.iotdb.confignode.conf.SystemPropertiesUtils
-
public class SystemPropertiesUtils extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 SystemPropertiesUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidcheckSystemProperties()Check whether system parameters are consistent during each restart.static booleanisRestarted()Check if the ConfigNode is restartedstatic booleanisSeedConfigNode()Check if the current ConfigNode is SeedConfigNode.static java.lang.StringloadClusterNameWhenRestarted()Load the cluster_name in confignode-system.properties file.static intloadConfigNodeIdWhenRestarted()Load the config_node_id in confignode-system.properties file.static java.util.List<org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation>loadConfigNodeList()Load the config_node_list in confignode-system.properties file.static voidstoreConfigNodeList(java.util.List<org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation> configNodes)Store the latest config_node_list in confignode-system.properties filestatic voidstoreSystemParameters()The system parameters can't be changed after the ConfigNode first started.
-
-
-
方法详细资料
-
isRestarted
public static boolean isRestarted()
Check if the ConfigNode is restarted- 返回:
- True if confignode-system.properties file exist.
-
checkSystemProperties
public static void checkSystemProperties() throws java.io.IOException, org.apache.iotdb.commons.exception.ConfigurationExceptionCheck whether system parameters are consistent during each restart. We only invoke this interface when restarted- 抛出:
java.io.IOException- When read the confignode-system.properties file failedorg.apache.iotdb.commons.exception.ConfigurationException- When some system parameters are inconsistent
-
loadConfigNodeList
public static java.util.List<org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation> loadConfigNodeList() throws java.io.IOException, org.apache.iotdb.commons.exception.BadNodeUrlExceptionLoad the config_node_list in confignode-system.properties file. We only invoke this interface when restarted.- 返回:
- The property of config_node_list in confignode-system.properties file
- 抛出:
java.io.IOException- When load confignode-system.properties file failedorg.apache.iotdb.commons.exception.BadNodeUrlException- When parsing config_node_list failed
-
storeSystemParameters
public static void storeSystemParameters() throws java.io.IOExceptionThe system parameters can't be changed after the ConfigNode first started. Therefore, store them in confignode-system.properties during the first startup- 抛出:
java.io.IOException
-
storeConfigNodeList
public static void storeConfigNodeList(java.util.List<org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation> configNodes) throws java.io.IOExceptionStore the latest config_node_list in confignode-system.properties file- 参数:
configNodes- The latest ConfigNodeList- 抛出:
java.io.IOException- When store confignode-system.properties file failed
-
loadClusterNameWhenRestarted
public static java.lang.String loadClusterNameWhenRestarted() throws java.io.IOExceptionLoad the cluster_name in confignode-system.properties file. We only invoke this interface when restarted.- 返回:
- The property of cluster_name in confignode-system.properties file
- 抛出:
java.io.IOException- When load confignode-system.properties file failed
-
loadConfigNodeIdWhenRestarted
public static int loadConfigNodeIdWhenRestarted() throws java.io.IOExceptionLoad the config_node_id in confignode-system.properties file. We only invoke this interface when restarted.- 返回:
- The property of config_node_id in confignode-system.properties file
- 抛出:
java.io.IOException- When load confignode-system.properties file failed
-
isSeedConfigNode
public static boolean isSeedConfigNode()
Check if the current ConfigNode is SeedConfigNode.Notice: Only invoke this interface when restarted.
- 返回:
- True if the is_seed_config_node is set to True in iotdb-confignode.properties file or getInternalAddress().equals(conf.getTargetConfigNode())
-
-