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
    • PIDFILE_SETTING

      public static final Setting<String> PIDFILE_SETTING
    • NODE_PIDFILE_SETTING

      public static final Setting<String> NODE_PIDFILE_SETTING
  • Constructor Details

    • Environment

      public Environment(Settings settings, Path configPath)
    • Environment

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

    • settings

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

      public Path[] dataFiles()
      The data location.
    • sharedDataFile

      public Path sharedDataFile()
      The shared data location
    • repoFiles

      public Path[] repoFiles()
      The shared filesystem repo locations.
    • resolveRepoFile

      public Path resolveRepoFile(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.
    • configFile

      public Path configFile()
      The config directory.
    • pluginsFile

      public Path pluginsFile()
    • binFile

      public Path binFile()
    • libFile

      public Path libFile()
    • modulesFile

      public Path modulesFile()
    • logsFile

      public Path logsFile()
    • pidFile

      public Path pidFile()
      The PID file location (can be null if no PID file is configured)
    • tmpFile

      public Path tmpFile()
      Path to the default temp directory used by the JDK
    • validateTmpFile

      public void validateTmpFile() throws IOException
      Ensure the configured temp directory is a valid directory
      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)