Package org.elasticsearch.env
Class Environment
- java.lang.Object
-
- org.elasticsearch.env.Environment
-
public class Environment extends Object
The environment of where things exists.
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<String>NODE_PIDFILE_SETTINGstatic Setting<List<String>>PATH_DATA_SETTINGstatic Setting<String>PATH_HOME_SETTINGstatic Setting<String>PATH_LOGS_SETTINGstatic Setting<List<String>>PATH_REPO_SETTINGstatic Setting<String>PATH_SHARED_DATA_SETTINGstatic Setting<String>PIDFILE_SETTING
-
Constructor Summary
Constructors Constructor Description Environment(Settings settings, Path configPath)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidassertEquivalent(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)PathbinFile()PathconfigFile()The config directory.Path[]dataFiles()The data location.static FileStoregetFileStore(Path path)PathlibFile()PathlogsFile()PathmodulesFile()PathpidFile()The PID file location (can be null if no PID file is configured)PathpluginsFile()Path[]repoFiles()The shared filesystem repo locations.PathresolveRepoFile(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.URLresolveRepoURL(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.Settingssettings()The settings used to build this environment.PathsharedDataFile()The shared data locationPathtmpFile()Path to the default temp directory used by the JDKvoidvalidateTmpFile()Ensure the configured temp directory is a valid directory
-
-
-
Method Detail
-
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 IOExceptionEnsure the configured temp directory is a valid directory- Throws:
IOException
-
getFileStore
public static FileStore getFileStore(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)
-
-