Package org.elasticsearch.discovery.zen
Class FileBasedUnicastHostsProvider
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.discovery.zen.FileBasedUnicastHostsProvider
-
- All Implemented Interfaces:
UnicastHostsProvider
public class FileBasedUnicastHostsProvider extends AbstractComponent implements UnicastHostsProvider
An implementation ofUnicastHostsProvider
that reads hosts/ports fromUNICAST_HOSTS_FILE
. Each unicast host/port that is part of the discovery process must be listed on a separate line. If the port is left off an entry, a default port of 9300 is assumed. An example unicast hosts file could read: 67.81.244.10 67.81.244.11:9305 67.81.244.15:9400
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.discovery.zen.UnicastHostsProvider
UnicastHostsProvider.HostsResolver
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
UNICAST_HOSTS_FILE
-
Constructor Summary
Constructors Constructor Description FileBasedUnicastHostsProvider(java.nio.file.Path configFile)
-
Method Summary
Modifier and Type Method Description java.util.List<TransportAddress>
buildDynamicHosts(UnicastHostsProvider.HostsResolver hostsResolver)
Builds the dynamic list of unicast hosts to be used for unicast discovery.
-
-
-
Field Detail
-
UNICAST_HOSTS_FILE
public static final java.lang.String UNICAST_HOSTS_FILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
buildDynamicHosts
public java.util.List<TransportAddress> buildDynamicHosts(UnicastHostsProvider.HostsResolver hostsResolver)
Description copied from interface:UnicastHostsProvider
Builds the dynamic list of unicast hosts to be used for unicast discovery.- Specified by:
buildDynamicHosts
in interfaceUnicastHostsProvider
-
-