Package org.elasticsearch.env
Class Environment
- java.lang.Object
-
- org.elasticsearch.env.Environment
-
public class Environment extends java.lang.ObjectThe environment of where things exists.
-
-
Field Summary
Fields Modifier and Type Field Description static 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated 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)java.nio.file.PathbinFile()java.nio.file.PathconfigFile()The config directory.java.nio.file.Path[]dataFiles()The data location.java.nio.file.Path[]dataWithClusterFiles()Deprecated.Used to upgrade old data paths to new ones that do not include the cluster name, should not be used to write files to and will be removed in ES 6.0static java.nio.file.FileStoregetFileStore(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 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
-
dataWithClusterFiles
@Deprecated public java.nio.file.Path[] dataWithClusterFiles()
Deprecated.Used to upgrade old data paths to new ones that do not include the cluster name, should not be used to write files to and will be removed in ES 6.0The data location with the cluster name as a sub directory.
-
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
-
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)
-
-