Class MppBaseConfig

java.lang.Object
org.apache.iotdb.it.env.cluster.config.MppBaseConfig
Direct Known Subclasses:
MppCommonConfig, MppConfigNodeConfig, MppDataNodeConfig

public abstract class MppBaseConfig extends Object
This class stands for a config object of one single property file.
  • Field Details

  • Constructor Details

    • MppBaseConfig

      protected MppBaseConfig()
      Create an empty MppPersistentConfig.
    • MppBaseConfig

      protected MppBaseConfig(String filePath) throws IOException
      Create a MppPersistentConfig from the property file.
      Parameters:
      filePath - the property file path.
      Throws:
      IOException - if load properties failed.
  • Method Details

    • updateProperties

      public final void updateProperties(@NotNull @NotNull Properties properties)
      Put all the key-value pairs of input properties to the current instance one. If the key is existed in both, the value will be overridden.
      Parameters:
      properties - the properties to update with.
    • updateProperties

      public void updateProperties(@NotNull @NotNull MppBaseConfig persistentConfig)
      Put all the properties of the input persistent config to the current instance. If the key is existed in both, the value will be overridden.
      Parameters:
      persistentConfig - the config instance to update with.
    • updateProperties

      public final void updateProperties(@Nullable String filePath) throws IOException
      Put all the properties of the input file to the current instance. If the key is existed in both, the value will be overridden.
      Parameters:
      filePath - the path of the properties file to update with. If it's null, then nothing will happen.
      Throws:
      IOException - there's some errors during processing the file.
    • persistent

      public final void persistent(String filePath) throws IOException
      Persistent the properties to the file.
      Parameters:
      filePath - the file path.
      Throws:
      IOException - if properties storage failed.
    • setProperty

      protected final void setProperty(@NotNull @NotNull String key, String value)
      Set a property with the input key and value. If the key is existed, the value will be overridden. If the value is an empty String, the key will be removed.
      Parameters:
      key - the key.
      value - the value.
    • emptyClone

      public abstract MppBaseConfig emptyClone()
      Create an instance but with empty properties.