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.lang.String>NODE_PIDFILE_SETTINGstatic Setting<java.util.List<java.lang.String>>PATH_DATA_SETTINGstatic Setting<java.lang.String>PATH_HOME_SETTINGstatic Setting<java.lang.String>PATH_LOGS_SETTINGstatic Setting<java.util.List<java.lang.String>>PATH_REPO_SETTINGstatic Setting<java.lang.String>PATH_SHARED_DATA_SETTINGstatic Setting<java.lang.String>PIDFILE_SETTING -
Constructor Summary
Constructors Constructor Description Environment(Settings settings, java.nio.file.Path configPath)Environment(Settings settings, java.nio.file.Path configPath, boolean nodeLocalStorage) -
Method Summary
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)java.nio.file.PathbinFile()java.nio.file.PathconfigFile()The config directory.java.nio.file.Path[]dataFiles()The data location.static java.nio.file.FileStoregetFileStore(java.nio.file.Path path)static longgetUsableSpace(java.nio.file.Path path)java.nio.file.PathlibFile()java.nio.file.PathlogsFile()java.nio.file.PathmodulesFile()java.nio.file.PathpidFile()The PID file location (can be null if no PID file is configured)java.nio.file.PathpluginsFile()java.nio.file.Path[]repoFiles()The shared filesystem repo locations.java.nio.file.PathresolveRepoFile(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.URLresolveRepoURL(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.Settingssettings()The settings used to build this environment.java.nio.file.PathsharedDataFile()The shared data locationjava.nio.file.PathtmpFile()Path to the default temp directory used by the JDKvoidvalidateTmpFile()Ensure the configured temp directory is a valid directoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
PATH_HOME_SETTING
-
PATH_DATA_SETTING
-
PATH_LOGS_SETTING
-
PATH_REPO_SETTING
-
PATH_SHARED_DATA_SETTING
-
PIDFILE_SETTING
-
NODE_PIDFILE_SETTING
-
-
Constructor Details
-
Environment
-
Environment
-
-
Method Details
-
settings
The settings used to build this environment. -
dataFiles
public java.nio.file.Path[] dataFiles()The 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.IOExceptionEnsure 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
-
getUsableSpace
public static long getUsableSpace(java.nio.file.Path path) throws java.io.IOException- Throws:
java.io.IOException
-
assertEquivalent
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)
-