Package org.apache.solr.packagemanager
Class PackageManager
- java.lang.Object
- 
- org.apache.solr.packagemanager.PackageManager
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable
 
 public class PackageManager extends Object implements Closeable Handles most of the management of packages that are already installed in Solr.
- 
- 
Constructor SummaryConstructors Constructor Description PackageManager(HttpSolrClient solrClient, String solrBaseUrl, String zkHost)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddeploy(String packageName, String version, String[] collections, boolean shouldInstallClusterPlugins, String[] parameters, boolean isUpdate, boolean noprompt)Deploys a version of a package to a list of collections.List<SolrPackageInstance>fetchInstalledPackageInstances()Map<String,String>getDeployedCollections(String packageName)Given a package, return a map of collections where this package is installed to the installed version (which can bePackageLoader.LATEST)SolrPackageInstancegetPackageInstance(String packageName, String version)Get the installed instance of a specific version of a package.Map<String,SolrPackageInstance>getPackagesDeployed(String collection)Map<String,SolrPackageInstance>getPackagesDeployedAsClusterLevelPlugins()Get a map of packages (key: package name, value: package instance) that have their plugins deployed as cluster level plugins.voidundeploy(String packageName, String[] collections, boolean shouldUndeployClusterPlugins)Undeploys a package from given collections.voiduninstall(String packageName, String version)booleanverify(SolrPackageInstance pkg, List<String> collections, boolean shouldDeployClusterPlugins, String[] overrides)Given a package and list of collections, verify if the package is installed in those collections.
 
- 
- 
- 
Constructor Detail- 
PackageManagerpublic PackageManager(HttpSolrClient solrClient, String solrBaseUrl, String zkHost) 
 
- 
 - 
Method Detail- 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
fetchInstalledPackageInstancespublic List<SolrPackageInstance> fetchInstalledPackageInstances() throws SolrException - Throws:
- SolrException
 
 - 
getPackagesDeployedpublic Map<String,SolrPackageInstance> getPackagesDeployed(String collection) 
 - 
getPackagesDeployedAsClusterLevelPluginspublic Map<String,SolrPackageInstance> getPackagesDeployedAsClusterLevelPlugins() Get a map of packages (key: package name, value: package instance) that have their plugins deployed as cluster level plugins. The returned packages also contain the "pluginMeta" from "clusterprops.json" as custom data.
 - 
verifypublic boolean verify(SolrPackageInstance pkg, List<String> collections, boolean shouldDeployClusterPlugins, String[] overrides) Given a package and list of collections, verify if the package is installed in those collections. It uses the verify command of every plugin in the package (if defined).- Parameters:
- overrides- are needed only when shouldDeployClusterPlugins is true, since collection level plugins will get their overrides from ZK (collection params API)
 
 - 
getPackageInstancepublic SolrPackageInstance getPackageInstance(String packageName, String version) Get the installed instance of a specific version of a package. If version is null, PackageUtils.LATEST or PackagePluginHolder.LATEST, then it returns the highest version available in the system for the package.
 - 
deploypublic void deploy(String packageName, String version, String[] collections, boolean shouldInstallClusterPlugins, String[] parameters, boolean isUpdate, boolean noprompt) throws SolrException Deploys a version of a package to a list of collections.- Parameters:
- version- If null, the most recent version is deployed. EXPERT FEATURE: If version is PackageUtils.LATEST, this collection will be auto updated whenever a newer version of this package is installed.
- isUpdate- Is this a fresh deployment or is it an update (i.e. there is already a version of this package deployed on this collection)
- noprompt- If true, don't prompt before executing setup commands.
- Throws:
- SolrException
 
 - 
undeploypublic void undeploy(String packageName, String[] collections, boolean shouldUndeployClusterPlugins) throws SolrException Undeploys a package from given collections.- Throws:
- SolrException
 
 - 
getDeployedCollectionspublic Map<String,String> getDeployedCollections(String packageName) Given a package, return a map of collections where this package is installed to the installed version (which can bePackageLoader.LATEST)
 
- 
 
-