Skip to content

Commit 0d54fd2

Browse files
committed
javadocs
1 parent e4cec9a commit 0d54fd2

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

server/src/main/java/org/elasticsearch/discovery/zen/SettingsBasedHostsProvider.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@
3030

3131
import static java.util.Collections.emptyList;
3232

33+
/**
34+
* An implementation of {@link UnicastHostsProvider} that reads hosts/ports
35+
* from the "discovery.zen.ping.unicast.hosts" node setting. If the port is
36+
* left off an entry, a default port of 9300 is assumed.
37+
*
38+
* An example unicast hosts setting might look as follows:
39+
* [67.81.244.10, 67.81.244.11:9305, 67.81.244.15:9400]
40+
*/
3341
public class SettingsBasedHostsProvider extends AbstractComponent implements UnicastHostsProvider {
3442

3543
public static final Setting<List<String>> DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING =
36-
Setting.listSetting("discovery.zen.ping.unicast.hosts", emptyList(), Function.identity(),
37-
Setting.Property.NodeScope);
44+
Setting.listSetting("discovery.zen.ping.unicast.hosts", emptyList(), Function.identity(), Setting.Property.NodeScope);
3845

3946
// these limits are per-address
4047
public static final int LIMIT_FOREIGN_PORTS_COUNT = 1;
@@ -49,7 +56,7 @@ public SettingsBasedHostsProvider(Settings settings, TransportService transportS
4956

5057
if (DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING.exists(settings)) {
5158
configuredHosts = DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING.get(settings);
52-
// we only limit to 1 addresses, makes no sense to ping 100 ports
59+
// we only limit to 1 address, makes no sense to ping 100 ports
5360
limitPortCounts = LIMIT_FOREIGN_PORTS_COUNT;
5461
} else {
5562
// if unicast hosts are not specified, fill with simple defaults on the local machine

server/src/main/java/org/elasticsearch/discovery/zen/UnicastHostsProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public interface UnicastHostsProvider {
3333
*/
3434
List<TransportAddress> buildDynamicHosts(HostsResolver hostsResolver);
3535

36+
/**
37+
* Helper object that allows to resolve a list of hosts to a list of transport addresses.
38+
* Each host is resolved into a transport address (or a collection of addresses if the
39+
* number of ports is greater than one)
40+
*/
3641
interface HostsResolver {
3742
List<TransportAddress> resolveHosts(List<String> hosts, int limitPortCounts);
3843
}

server/src/main/java/org/elasticsearch/discovery/zen/UnicastZenPing.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ public UnicastZenPing(Settings settings, ThreadPool threadPool, TransportService
150150
}
151151

152152
/**
153-
* Resolves a list of hosts to a list of discovery nodes. Each host is resolved into a transport address (or a collection of addresses
154-
* if the number of ports is greater than one) and the transport addresses are used to created discovery nodes. Host lookups are done
155-
* in parallel using specified executor service up to the specified resolve timeout.
153+
* Resolves a list of hosts to a list of transport addresses. Each host is resolved into a transport address (or a collection of
154+
* addresses if the number of ports is greater than one). Host lookups are done in parallel using specified executor service up
155+
* to the specified resolve timeout.
156156
*
157157
* @param executorService the executor service used to parallelize hostname lookups
158158
* @param logger logger used for logging messages regarding hostname lookups

0 commit comments

Comments
 (0)