Class Environment

java.lang.Object
org.elasticsearch.env.Environment

public class Environment extends Object
The environment of where things exists.
  • Field Details

    • PATH_HOME_SETTING

      public static final Setting<String> PATH_HOME_SETTING
    • PATH_DATA_SETTING

      public static final Setting<List<String>> PATH_DATA_SETTING
    • PATH_LOGS_SETTING

      public static final Setting<String> PATH_LOGS_SETTING
    • PATH_REPO_SETTING

      public static final Setting<List<String>> PATH_REPO_SETTING
    • PATH_SHARED_DATA_SETTING

      public static final Setting<String> PATH_SHARED_DATA_SETTING
  • Constructor Details

    • Environment

      public Environment(Settings settings, Path configPath)
  • Method Details

    • settings

      public Settings settings()
      The settings used to build this environment.
    • dataDirs

      public Path[] dataDirs()
      The data location.
    • sharedDataDir

      public Path sharedDataDir()
      The shared data location
    • repoDirs

      public Path[] repoDirs()
      The shared filesystem repo locations.
    • resolveRepoDir

      public Path resolveRepoDir(String location)
      Resolves the specified location against the list of configured repository roots If the specified location doesn't match any of the roots, returns null.
    • resolveRepoURL

      public URL resolveRepoURL(URL url)
      Checks if the specified URL is pointing to the local file system and if it does, resolves the specified url against the list of configured repository roots If the specified url doesn't match any of the roots, returns null.
    • configDir

      public Path configDir()
      The config directory.
    • pluginsDir

      public Path pluginsDir()
    • binDir

      public Path binDir()
    • libDir

      public Path libDir()
    • modulesDir

      public Path modulesDir()
    • logsDir

      public Path logsDir()
    • tmpDir

      public Path tmpDir()
      Path to the default temp directory used by the JDK
    • validateTmpDir

      public void validateTmpDir() throws IOException
      Ensure the configured temp directory is a valid directory
      Throws:
      IOException
    • validateNativesConfig

      public void validateNativesConfig() throws IOException
      Ensure the temp directories needed for JNA are set up correctly.
      Throws:
      IOException
    • dataPathUsesList

      public static boolean dataPathUsesList(Settings settings)
      Returns true if the data path is a list, false otherwise
    • getFileStore

      public static FileStore getFileStore(Path path) throws IOException
      Throws:
      IOException
    • getUsableSpace

      public static long getUsableSpace(Path path) throws IOException
      Throws:
      IOException
    • assertEquivalent

      public static void assertEquivalent(Environment actual, Environment expected)
      asserts that the two environments are equivalent for all things the environment cares about (i.e., all but the setting object which may contain different setting)