Package org.elasticsearch.discovery
Class FileBasedSeedHostsProvider
- java.lang.Object
-
- org.elasticsearch.discovery.FileBasedSeedHostsProvider
-
- All Implemented Interfaces:
SeedHostsProvider
public class FileBasedSeedHostsProvider extends java.lang.Object implements SeedHostsProvider
An implementation ofSeedHostsProvider
that reads hosts/ports fromUNICAST_HOSTS_FILE
. Each host/port that is part of the discovery process must be listed on a separate line. If the port is left off an entry, we default to the first port in thetransport.port
range. 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.SeedHostsProvider
SeedHostsProvider.HostsResolver
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
UNICAST_HOSTS_FILE
-
Constructor Summary
Constructors Constructor Description FileBasedSeedHostsProvider(java.nio.file.Path configFile)
-
Method Summary
Modifier and Type Method Description java.util.List<TransportAddress>
getSeedAddresses(SeedHostsProvider.HostsResolver hostsResolver)
Returns a list of seed hosts to use for discovery.
-
-
-
Field Detail
-
UNICAST_HOSTS_FILE
public static final java.lang.String UNICAST_HOSTS_FILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSeedAddresses
public java.util.List<TransportAddress> getSeedAddresses(SeedHostsProvider.HostsResolver hostsResolver)
Description copied from interface:SeedHostsProvider
Returns a list of seed hosts to use for discovery. Called repeatedly while discovery is active (i.e. while there is no master) so that this list may be dynamic.- Specified by:
getSeedAddresses
in interfaceSeedHostsProvider
-
-