java.lang.Object
org.elasticsearch.plugins.PluginsUtils
Utility methods for loading plugin information from disk and for sorting
lists of plugins
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckForFailedPluginRemovals(Path pluginsDirectory) Check for the existence of a marker file that indicates any plugins are in a garbage state from a failed attempt to remove the plugin.findPluginDirs(Path rootPath) Extracts all installed plugin directories from the providedrootPath.getDependencyMapView(Path pluginsDirectory) A convenience method for analyzing plugin dependenciesstatic Set<PluginBundle> getModuleBundles(Path modulesDirectory) Get bundles for plugins installed in the given modules directory.static Set<PluginBundle> getPluginBundles(Path pluginsDirectory) Get bundles for plugins installed in the given plugins directory.static voidpreInstallJarHellCheck(PluginDescriptor candidateInfo, Path candidateDir, Path pluginsDir, Path modulesDir, Set<URL> classpath) Given a plugin that we would like to install, perform a series of "jar hell checks to make sure that we don't have any classname conflicts.static voidVerify the given plugin is compatible with the current Elasticsearch installation.
-
Method Details
-
findPluginDirs
Extracts all installed plugin directories from the providedrootPath.- Parameters:
rootPath- the path where the plugins are installed- Returns:
- a list of all plugin paths installed in the
rootPath - Throws:
IOException- if an I/O exception occurred reading the directories
-
verifyCompatibility
Verify the given plugin is compatible with the current Elasticsearch installation. -
checkForFailedPluginRemovals
Check for the existence of a marker file that indicates any plugins are in a garbage state from a failed attempt to remove the plugin.- Parameters:
pluginsDirectory- Path to plugins directory- Throws:
IOException- if there is an error reading from the filesystem
-
getModuleBundles
Get bundles for plugins installed in the given modules directory.- Throws:
IOException
-
getPluginBundles
Get bundles for plugins installed in the given plugins directory.- Throws:
IOException
-
getDependencyMapView
public static Map<String,List<String>> getDependencyMapView(Path pluginsDirectory) throws IOException A convenience method for analyzing plugin dependencies- Parameters:
pluginsDirectory- Directory of plugins to scan- Returns:
- a map of plugin names to a list of names of any plugins that they extend
- Throws:
IOException- if there is an error reading the plugins
-
preInstallJarHellCheck
public static void preInstallJarHellCheck(PluginDescriptor candidateInfo, Path candidateDir, Path pluginsDir, Path modulesDir, Set<URL> classpath) throws IOException Given a plugin that we would like to install, perform a series of "jar hell checks to make sure that we don't have any classname conflicts. Some of these checks are unique to the "pre-installation" scenario, but we also call thecheckBundleJarHell(Set, PluginBundle, Map).- Parameters:
candidateInfo- Candidate for installationcandidateDir- Directory containing the candidate plugin filespluginsDir- Directory containing already-installed pluginsmodulesDir- Directory containing Elasticsearch modulesclasspath- Set of URLs to use for a classpath- Throws:
IOException- on failed plugin reads
-