java.io.Closeable
, java.lang.AutoCloseable
public abstract class Plugin
extends java.lang.Object
implements java.io.Closeable
ActionPlugin
AnalysisPlugin
ClusterPlugin
DiscoveryPlugin
IngestPlugin
MapperPlugin
NetworkPlugin
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 | Description |
---|---|
Plugin() |
Modifier and Type | Method | Description |
---|---|---|
Settings |
additionalSettings() |
Additional node settings loaded by the plugin.
|
void |
close() |
Close the resources opened by this plugin.
|
java.util.Collection<java.lang.Object> |
createComponents(Client client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
ScriptService scriptService,
NamedXContentRegistry xContentRegistry,
Environment environment,
NodeEnvironment nodeEnvironment,
NamedWriteableRegistry namedWriteableRegistry) |
Returns components added by this plugin.
|
java.util.Collection<Module> |
createGuiceModules() |
Node level guice modules.
|
java.util.List<BootstrapCheck> |
getBootstrapChecks() |
Returns a list of checks that are enforced when a node starts up once a node has the transport protocol bound to a non-loopback
interface.
|
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.
|
protected java.util.Optional<java.lang.String> |
getFeature() |
A feature exposed by the plugin.
|
java.util.Collection<java.lang.Class<? extends LifecycleComponent>> |
getGuiceServiceClasses() |
Node level services that will be automatically started/stopped/closed.
|
java.util.function.UnaryOperator<IndexMetaData> |
getIndexMetaDataUpgrader() |
Provides a function to modify index meta data when an index is introduced into the cluster state for the first time.
|
java.util.function.UnaryOperator<java.util.Map<java.lang.String,IndexTemplateMetaData>> |
getIndexTemplateMetaDataUpgrader() |
Provides a function to modify index template meta data on startup.
|
java.util.List<NamedWriteableRegistry.Entry> |
getNamedWriteables() |
Returns parsers for
NamedWriteable this plugin will use over the transport protocol. |
java.util.List<NamedXContentRegistry.Entry> |
getNamedXContent() |
Returns parsers for named objects this plugin will parse from
XContentParser.namedObject(Class, String, Object) . |
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(ClusterModule module) |
Deprecated.
implement
ClusterPlugin instead |
void |
onModule(NetworkModule module) |
Deprecated.
implement
NetworkPlugin instead |
void |
onModule(SettingsModule settingsModule) |
Deprecated.
use #getSettings and #getSettingsFilter instead
|
void |
onModule(DiscoveryModule module) |
Deprecated.
implement
DiscoveryPlugin instead |
void |
onModule(IndexModule indexModule) |
Deprecated.
use #onIndexModule instead
|
void |
onModule(AnalysisModule module) |
Deprecated.
implement
AnalysisPlugin instead |
void |
onModule(RepositoriesModule module) |
Deprecated.
implement
RepositoryPlugin instead |
void |
onModule(ScriptModule module) |
Deprecated.
implement
ScriptPlugin instead |
void |
onModule(SearchModule module) |
Deprecated.
implement
SearchPlugin instead |
protected java.util.Optional<java.lang.String> getFeature()
ClusterState.Custom
or MetaData.Custom
; see
also ClusterState.FeatureAware
.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, NamedXContentRegistry xContentRegistry, Environment environment, NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry)
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 nodexContentRegistry
- the registry for extensible xContent parsingenvironment
- the environment for path and setting configurationsnodeEnvironment
- the node environment used coordinate access to the data pathsnamedWriteableRegistry
- the registry for NamedWriteable
object parsingpublic Settings additionalSettings()
public java.util.List<NamedWriteableRegistry.Entry> getNamedWriteables()
NamedWriteable
this plugin will use over the transport protocol.NamedWriteableRegistry
public java.util.List<NamedXContentRegistry.Entry> getNamedXContent()
XContentParser.namedObject(Class, String, Object)
.NamedWriteableRegistry
public 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.
The order of custom meta data upgraders calls is undefined and can change between runs so, it is expected that plugins will modify only data owned by them to avoid conflicts.
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.function.UnaryOperator<java.util.Map<java.lang.String,IndexTemplateMetaData>> getIndexTemplateMetaDataUpgrader()
Plugins should return the input template map via UnaryOperator.identity()
if no upgrade is required.
The order of the template upgrader calls is undefined and can change between runs so, it is expected that plugins will modify only templates owned by them to avoid conflicts.
null
. The same or upgraded IndexTemplateMetaData
map.java.lang.IllegalStateException
- if the node should not start because at least one IndexTemplateMetaData
cannot be upgradedpublic java.util.function.UnaryOperator<IndexMetaData> getIndexMetaDataUpgrader()
Plugins should return the input index metadata via UnaryOperator.identity()
if no upgrade is required.
The order of the index upgrader calls for the same index is undefined and can change between runs so, it is expected that plugins will modify only indices owned by them to avoid conflicts.
null
. The same or upgraded IndexMetaData
.java.lang.IllegalStateException
- if the node should not start because the index is unsupportedpublic java.util.List<ExecutorBuilder<?>> getExecutorBuilders(Settings settings)
settings
- the current settingspublic java.util.List<BootstrapCheck> getBootstrapChecks()
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
java.io.IOException
- if the plugin failed to close its resources@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.@Deprecated public final void onModule(NetworkModule module)
NetworkPlugin
instead@Deprecated
and final
to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(RepositoriesModule module)
RepositoryPlugin
instead@Deprecated
and final
to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(ClusterModule module)
ClusterPlugin
instead@Deprecated
and final
to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(DiscoveryModule module)
DiscoveryPlugin
instead@Deprecated
and final
to act as a signpost for plugin authors upgrading
from 2.x.