public abstract class Plugin
extends java.lang.Object
ActionPlugin
AnalysisPlugin
ClusterPlugin
DiscoveryPlugin
IngestPlugin
MapperPlugin
RepositoryPlugin
ScriptPlugin
SearchPlugin
In addition to extension points this class also declares some @Deprecated public final void onModule methods. These
methods should cause any extensions of Plugin that used the pre-5.x style extension syntax to fail to build and point the
plugin author at the new extension syntax. We hope that these make the process of upgrading a plugin from 2.x to 5.x only mildly painful.
| Constructor and Description |
|---|
Plugin() |
| Modifier and Type | Method and Description |
|---|---|
Settings |
additionalSettings()
Additional node settings loaded by the plugin.
|
java.util.Collection<java.lang.Object> |
createComponents(Client client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
ScriptService scriptService,
SearchRequestParsers searchRequestParsers)
Returns components added by this plugin.
|
java.util.Collection<Module> |
createGuiceModules()
Node level guice modules.
|
java.util.function.UnaryOperator<java.util.Map<java.lang.String,MetaData.Custom>> |
getCustomMetaDataUpgrader()
Provides a function to modify global custom meta data on startup.
|
java.util.List<ExecutorBuilder<?>> |
getExecutorBuilders(Settings settings)
Provides the list of this plugin's custom thread pools, empty if
none.
|
java.util.Collection<java.lang.Class<? extends LifecycleComponent>> |
getGuiceServiceClasses()
Node level services that will be automatically started/stopped/closed.
|
java.util.List<NamedWriteableRegistry.Entry> |
getNamedWriteables()
Returns parsers for
NamedWriteable this plugin will use over the transport protocol. |
java.util.List<Setting<?>> |
getSettings()
Returns a list of additional
Setting definitions for this plugin. |
java.util.List<java.lang.String> |
getSettingsFilter()
Returns a list of additional settings filter for this plugin
|
void |
onIndexModule(IndexModule indexModule)
Called before a new index is created on a node.
|
void |
onModule(ActionModule module)
Deprecated.
implement
ActionPlugin instead |
void |
onModule(AnalysisModule module)
Deprecated.
implement
AnalysisPlugin instead |
void |
onModule(IndexModule indexModule)
Deprecated.
use #onIndexModule instead
|
void |
onModule(ScriptModule module)
Deprecated.
implement
ScriptPlugin instead |
void |
onModule(SearchModule module)
Deprecated.
implement
SearchPlugin instead |
void |
onModule(SettingsModule settingsModule)
Deprecated.
use #getSettings and #getSettingsFilter instead
|
public java.util.Collection<Module> createGuiceModules()
public java.util.Collection<java.lang.Class<? extends LifecycleComponent>> getGuiceServiceClasses()
public java.util.Collection<java.lang.Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool, ResourceWatcherService resourceWatcherService, ScriptService scriptService, SearchRequestParsers searchRequestParsers)
LifecycleComponent will have their lifecycle managed.
Note: To aid in the migration away from guice, all objects returned as components will be bound in guice
to themselves.client - A client to make requests to the systemclusterService - A service to allow watching and updating cluster statethreadPool - A service to allow retrieving an executor to run an async actionresourceWatcherService - A service to watch for changes to node local filesscriptService - A service to allow running scripts on the local nodesearchRequestParsers - Parsers for search requests which may be used to templatize search requestspublic Settings additionalSettings()
public java.util.List<NamedWriteableRegistry.Entry> getNamedWriteables()
NamedWriteable this plugin will use over the transport protocol.NamedWriteableRegistrypublic void onIndexModule(IndexModule indexModule)
public java.util.List<Setting<?>> getSettings()
Setting definitions for this plugin.public java.util.List<java.lang.String> getSettingsFilter()
public java.util.function.UnaryOperator<java.util.Map<java.lang.String,MetaData.Custom>> getCustomMetaDataUpgrader()
Plugins should return the input custom map via UnaryOperator.identity() if no upgrade is required.
null. The same or upgraded MetaData.Custom map.java.lang.IllegalStateException - if the node should not start because at least one MetaData.Custom
is unsupportedpublic java.util.List<ExecutorBuilder<?>> getExecutorBuilders(Settings settings)
settings - the current settings@Deprecated public final void onModule(IndexModule indexModule)
@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(SettingsModule settingsModule)
@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(ScriptModule module)
ScriptPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(AnalysisModule module)
AnalysisPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(ActionModule module)
ActionPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(SearchModule module)
SearchPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.