Class SystemPropertiesUtils

java.lang.Object
org.apache.iotdb.confignode.conf.SystemPropertiesUtils

public class SystemPropertiesUtils extends Object
  • Method Details

    • reinitializeStatics

      public static void reinitializeStatics()
    • isRestarted

      public static boolean isRestarted()
      Check if the ConfigNode is restarted.
      Returns:
      True if confignode-system.properties file exist.
    • checkSystemProperties

      public static void checkSystemProperties() throws IOException
      Check whether system parameters are consistent during each restart. We only invoke this interface when restarted.
      Throws:
      IOException - When read the confignode-system.properties file failed
    • loadConfigNodeList

      public static List<TConfigNodeLocation> loadConfigNodeList() throws IOException, BadNodeUrlException
      Load the config_node_list in confignode-system.properties file. We only invoke this interface when restarted.
      Returns:
      The property of config_node_list in confignode-system.properties file
      Throws:
      IOException - When load confignode-system.properties file failed
      BadNodeUrlException - When parsing config_node_list failed
    • storeSystemParameters

      public static void storeSystemParameters() throws IOException
      The system parameters can't be changed after the ConfigNode first started. Therefore, store them in confignode-system.properties during the first startup.
      Throws:
      IOException - systemPropertiesHandler.read()
    • storeConfigNodeList

      public static void storeConfigNodeList(List<TConfigNodeLocation> configNodes) throws IOException
      Store the latest config_node_list in confignode-system.properties file
      Parameters:
      configNodes - The latest ConfigNodeList
      Throws:
      IOException - When store confignode-system.properties file failed
    • loadConfigNodeIdWhenRestarted

      public static int loadConfigNodeIdWhenRestarted() throws IOException
      Load the config_node_id in confignode-system.properties file. We only invoke this interface when restarted.
      Returns:
      The property of config_node_id in confignode-system.properties file
      Throws:
      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.

      Returns:
      True if the is_seed_config_node is set to True in iotdb-confignode.properties file