Fix comments and method name
This commit is contained in:
parent
fb9bad23de
commit
9cb1e79e84
|
@ -296,7 +296,7 @@ public class Node implements Closeable {
|
|||
final SettingsModule settingsModule = new SettingsModule(this.settings, additionalSettings, additionalSettingsFilter);
|
||||
resourcesToClose.add(resourceWatcherService);
|
||||
final NetworkService networkService = new NetworkService(settings,
|
||||
generateCustomNameResolvers(pluginsService.filterPlugins(DiscoveryPlugin.class)));
|
||||
getCustomNameResolvers(pluginsService.filterPlugins(DiscoveryPlugin.class)));
|
||||
final ClusterService clusterService = new ClusterService(settings, settingsModule.getClusterSettings(), threadPool);
|
||||
clusterService.add(scriptModule.getScriptService());
|
||||
resourcesToClose.add(clusterService);
|
||||
|
@ -725,10 +725,10 @@ public class Node implements Closeable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Generate Custom Name Resolvers list based on a Discovery Plugins list
|
||||
* Get Custom Name Resolvers list based on a Discovery Plugins list
|
||||
* @param discoveryPlugins Discovery plugins list
|
||||
*/
|
||||
private List<NetworkService.CustomNameResolver> generateCustomNameResolvers(List<DiscoveryPlugin> discoveryPlugins) {
|
||||
private List<NetworkService.CustomNameResolver> getCustomNameResolvers(List<DiscoveryPlugin> discoveryPlugins) {
|
||||
List<NetworkService.CustomNameResolver> customNameResolvers = new ArrayList<>();
|
||||
for (DiscoveryPlugin discoveryPlugin : discoveryPlugins) {
|
||||
NetworkService.CustomNameResolver customNameResolver = discoveryPlugin.getCustomNameResolver(settings);
|
||||
|
|
|
@ -38,6 +38,16 @@ import org.elasticsearch.common.settings.Settings;
|
|||
public interface DiscoveryPlugin {
|
||||
/**
|
||||
* Override to add additional {@link NetworkService.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:
|
||||
*
|
||||
* <pre>{@code
|
||||
* network.host: _mycard_
|
||||
* }</pre>
|
||||
*/
|
||||
default NetworkService.CustomNameResolver getCustomNameResolver(Settings settings) {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue