Fix comments and method name

This commit is contained in:
David Pilato 2016-07-27 13:35:58 +02:00
parent fb9bad23de
commit 9cb1e79e84
2 changed files with 13 additions and 3 deletions

View File

@ -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);

View File

@ -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;