public interface DiscoveryPlugin
An additional extension point for
Plugin
s that extends Elasticsearch's discovery functionality. To add an additional
NetworkService.CustomNameResolver
just implement the interface and implement the getCustomNameResolver(Settings)
method:
public class MyDiscoveryPlugin extends Plugin implements DiscoveryPlugin {
@Override
public NetworkService.CustomNameResolver getCustomNameResolver(Settings settings) {
return new YourCustomNameResolverInstance(settings);
}
}
-
Method Summary
Modifier and TypeMethodDescriptiongetCustomNameResolver
(Settings settings) Override to add additionalNetworkService.CustomNameResolver
s.default Map
<String, Supplier<SeedHostsProvider>> getSeedHostProviders
(TransportService transportService, NetworkService networkService) Returns providers of seed hosts for discovery.
-
Method Details
-
getCustomNameResolver
Override to add additionalNetworkService.CustomNameResolver
s. This can be handy if you want to provide your own Network interface name like _mycard_ and implement by yourself the logic to get an actual IP address/hostname based on this name. For example: you could call a third party service (an API) to resolve _mycard_. Then you could define in elasticsearch.yml settings like:network.host: _mycard_
-
getSeedHostProviders
default Map<String,Supplier<SeedHostsProvider>> getSeedHostProviders(TransportService transportService, NetworkService networkService) Returns providers of seed hosts for discovery. The key of the returned map is the name of the host provider (seeDiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING
), and the value is a supplier to construct the host provider when it is selected for use.- Parameters:
transportService
- Use to form theTransportAddress
portion of aDiscoveryNode
networkService
- Use to find the publish host address of the current node
-