Class PluginsUtils

java.lang.Object
org.elasticsearch.plugins.PluginsUtils

public class PluginsUtils extends Object
Utility methods for loading plugin information from disk and for sorting lists of plugins
  • Method Details

    • findPluginDirs

      public static List<Path> findPluginDirs(Path rootPath) throws IOException
      Extracts all installed plugin directories from the provided rootPath.
      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

      public static void verifyCompatibility(PluginDescriptor info)
      Verify the given plugin is compatible with the current Elasticsearch installation.
    • checkForFailedPluginRemovals

      public static void checkForFailedPluginRemovals(Path pluginsDirectory) throws IOException
      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
    • 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 the checkBundleJarHell(Set, PluginBundle, Map).
      Parameters:
      candidateInfo - Candidate for installation
      candidateDir - Directory containing the candidate plugin files
      pluginsDir - Directory containing already-installed plugins
      modulesDir - Directory containing Elasticsearch modules
      classpath - Set of URLs to use for a classpath
      Throws:
      IOException - on failed plugin reads