java.lang.Object
org.elasticsearch.plugins.Plugin
- All Implemented Interfaces:
- Closeable,- AutoCloseable
An extension point allowing to plug in custom functionality. This class has a number of extension points that are available to all
 plugins, in addition you can implement any of the following interfaces to further customize Elasticsearch:
 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdditional node settings loaded by the plugin.voidclose()Close the resources opened by this plugin.createComponents(Client client, ClusterService clusterService, ThreadPool threadPool, ResourceWatcherService resourceWatcherService, ScriptService scriptService, NamedXContentRegistry xContentRegistry, Environment environment, NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry, IndexNameExpressionResolver indexNameExpressionResolver, Supplier<RepositoriesService> repositoriesServiceSupplier, Tracer tracer) Returns components added by this plugin.AnIndexSettingProviderallows hooking in to parts of an index lifecycle to provide explicit default settings for newly created indices.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.List<ExecutorBuilder<?>>getExecutorBuilders(Settings settings) Provides the list of this plugin's custom thread pools, empty if none.Provides a function to modify index template meta data on startup.Returns parsers forNamedWriteablethis plugin will use over the transport protocol.Returns parsers for named objects this plugin will parse fromXContentParser.namedObject(Class, String, Object).Returns a list of additionalSettingdefinitions for this plugin.Returns a list of additional settings filter for this pluginList<SettingUpgrader<?>>Get the setting upgraders provided by this plugin.voidonIndexModule(IndexModule indexModule) Called before a new index is created on a node.
- 
Constructor Details- 
Pluginpublic Plugin()
 
- 
- 
Method Details- 
createComponentspublic Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool, ResourceWatcherService resourceWatcherService, ScriptService scriptService, NamedXContentRegistry xContentRegistry, Environment environment, NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry, IndexNameExpressionResolver indexNameExpressionResolver, Supplier<RepositoriesService> repositoriesServiceSupplier, Tracer tracer) Returns components added by this plugin.Any components returned that implement LifecycleComponentwill 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.- Parameters:
- client- A client to make requests to the system
- clusterService- A service to allow watching and updating cluster state
- threadPool- A service to allow retrieving an executor to run an async action
- resourceWatcherService- A service to watch for changes to node local files
- scriptService- A service to allow running scripts on the local node
- xContentRegistry- the registry for extensible xContent parsing
- environment- the environment for path and setting configurations
- nodeEnvironment- the node environment used coordinate access to the data paths
- namedWriteableRegistry- the registry for- NamedWriteableobject parsing
- indexNameExpressionResolver- A service that resolves expression to index and alias names
- repositoriesServiceSupplier- A supplier for the service that manages snapshot repositories; will return null when this method is called, but will return the repositories service once the node is initialized.
- tracer- An interface for distributed tracing
 
- 
additionalSettingsAdditional node settings loaded by the plugin. Note that settings that are explicit in the nodes settings can't be overwritten with the additional settings. These settings added if they don't exist.
- 
getNamedWriteablesReturns parsers forNamedWriteablethis plugin will use over the transport protocol.- See Also:
 
- 
getNamedXContentReturns parsers for named objects this plugin will parse fromXContentParser.namedObject(Class, String, Object).- See Also:
 
- 
onIndexModuleCalled before a new index is created on a node. The given module can be used to register index-level extensions.
- 
getSettingsReturns a list of additionalSettingdefinitions for this plugin.
- 
getSettingsFilterReturns a list of additional settings filter for this plugin
- 
getSettingUpgradersGet the setting upgraders provided by this plugin.- Returns:
- the settings upgraders
 
- 
getIndexTemplateMetadataUpgraderProvides a function to modify index template meta data on startup.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. - Returns:
- Never null. The same or upgradedIndexTemplateMetadatamap.
- Throws:
- IllegalStateException- if the node should not start because at least one- IndexTemplateMetadatacannot be upgraded
 
- 
getExecutorBuildersProvides the list of this plugin's custom thread pools, empty if none.- Parameters:
- settings- the current settings
- Returns:
- executors builders for this plugin's custom thread pools
 
- 
getBootstrapChecksReturns 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. In this case we assume the node is running in production and all bootstrap checks must pass. This allows plugins to provide a better out of the box experience by pre-configuring otherwise (in production) mandatory settings or to enforce certain configurations like OS settings or 3rd party resources.
- 
closeClose the resources opened by this plugin.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException- if the plugin failed to close its resources
 
- 
getAdditionalIndexSettingProviderspublic Collection<IndexSettingProvider> getAdditionalIndexSettingProviders(IndexSettingProvider.Parameters parameters) AnIndexSettingProviderallows hooking in to parts of an index lifecycle to provide explicit default settings for newly created indices. Rather than changing the default values for an index-level setting, these act as though the setting has been set explicitly, but still allow the setting to be overridden by a template or creation request body.
 
-