Package org.elasticsearch.env
Class Environment
- java.lang.Object
-
- org.elasticsearch.env.Environment
-
public class Environment extends java.lang.Object
The environment of where things exists.
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<java.util.List<java.lang.String>>
PATH_DATA_SETTING
static Setting<java.lang.String>
PATH_HOME_SETTING
static Setting<java.lang.String>
PATH_LOGS_SETTING
static Setting<java.util.List<java.lang.String>>
PATH_REPO_SETTING
static Setting<java.lang.String>
PATH_SHARED_DATA_SETTING
static Setting<java.lang.String>
PIDFILE_SETTING
-
Constructor Summary
Constructors Constructor Description Environment(Settings settings, java.nio.file.Path configPath)
-
Method Summary
Modifier and Type Method Description 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)java.nio.file.Path
binFile()
java.nio.file.Path
configFile()
The config directory.java.nio.file.Path[]
dataFiles()
The data location.static java.nio.file.FileStore
getFileStore(java.nio.file.Path path)
java.nio.file.Path
libFile()
java.nio.file.Path
logsFile()
java.nio.file.Path
modulesFile()
java.nio.file.Path
pidFile()
The PID file location (can be null if no PID file is configured)java.nio.file.Path
pluginsFile()
java.nio.file.Path[]
repoFiles()
The shared filesystem repo locations.java.nio.file.Path
resolveRepoFile(java.lang.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.java.net.URL
resolveRepoURL(java.net.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.Settings
settings()
The settings used to build this environment.java.nio.file.Path
sharedDataFile()
The shared data locationjava.nio.file.Path
tmpFile()
Path to the default temp directory used by the JDKvoid
validateTmpFile()
Ensure the configured temp directory is a valid directory
-
-
-
Field Detail
-
PATH_HOME_SETTING
public static final Setting<java.lang.String> PATH_HOME_SETTING
-
PATH_DATA_SETTING
public static final Setting<java.util.List<java.lang.String>> PATH_DATA_SETTING
-
PATH_LOGS_SETTING
public static final Setting<java.lang.String> PATH_LOGS_SETTING
-
PATH_REPO_SETTING
public static final Setting<java.util.List<java.lang.String>> PATH_REPO_SETTING
-
PATH_SHARED_DATA_SETTING
public static final Setting<java.lang.String> PATH_SHARED_DATA_SETTING
-
PIDFILE_SETTING
public static final Setting<java.lang.String> PIDFILE_SETTING
-
-
Constructor Detail
-
Environment
public Environment(Settings settings, java.nio.file.Path configPath)
-
-
Method Detail
-
settings
public Settings settings()
The settings used to build this environment.
-
dataFiles
public java.nio.file.Path[] dataFiles()
The data location.
-
sharedDataFile
public java.nio.file.Path sharedDataFile()
The shared data location
-
repoFiles
public java.nio.file.Path[] repoFiles()
The shared filesystem repo locations.
-
resolveRepoFile
public java.nio.file.Path resolveRepoFile(java.lang.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 java.net.URL resolveRepoURL(java.net.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 java.nio.file.Path configFile()
The config directory.
-
pluginsFile
public java.nio.file.Path pluginsFile()
-
binFile
public java.nio.file.Path binFile()
-
libFile
public java.nio.file.Path libFile()
-
modulesFile
public java.nio.file.Path modulesFile()
-
logsFile
public java.nio.file.Path logsFile()
-
pidFile
public java.nio.file.Path pidFile()
The PID file location (can be null if no PID file is configured)
-
tmpFile
public java.nio.file.Path tmpFile()
Path to the default temp directory used by the JDK
-
validateTmpFile
public void validateTmpFile() throws java.io.IOException
Ensure the configured temp directory is a valid directory- Throws:
java.io.IOException
-
getFileStore
public static java.nio.file.FileStore getFileStore(java.nio.file.Path path) throws java.io.IOException
- Throws:
java.io.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)
-
-