Interface TcpDiscoveryIpFinder
-
- All Known Implementing Classes:
TcpDiscoveryIpFinderAdapter,TcpDiscoveryJdbcIpFinder,TcpDiscoveryKubernetesIpFinder,TcpDiscoveryMulticastIpFinder,TcpDiscoverySharedFsIpFinder,TcpDiscoveryVmIpFinder
public interface TcpDiscoveryIpFinderIP finder interface forTcpDiscoverySpi.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes this IP finder and releases any system resources associated with it.Collection<InetSocketAddress>getRegisteredAddresses()Gets all addresses registered in this finder.voidinitializeLocalAddresses(Collection<InetSocketAddress> addrs)Initializes addresses discovery SPI binds to.booleanisShared()Checks whether IP finder is shared or not.voidonSpiContextDestroyed()Callback invoked prior to stopping grid before SPI context is destroyed.voidonSpiContextInitialized(IgniteSpiContext spiCtx)Callback invoked when SPI context is initialized afterTcpDiscoverySpi.spiStart(String)method is completed, SPI context can be stored for future access.voidregisterAddresses(Collection<InetSocketAddress> addrs)Registers new addresses.voidunregisterAddresses(Collection<InetSocketAddress> addrs)Unregisters provided addresses.
-
-
-
Method Detail
-
onSpiContextInitialized
void onSpiContextInitialized(IgniteSpiContext spiCtx) throws IgniteSpiException
Callback invoked when SPI context is initialized afterTcpDiscoverySpi.spiStart(String)method is completed, SPI context can be stored for future access.- Parameters:
spiCtx- Spi context.- Throws:
IgniteSpiException- In case of error.
-
onSpiContextDestroyed
void onSpiContextDestroyed()
Callback invoked prior to stopping grid before SPI context is destroyed. Note that invoking SPI context after this callback is complete is considered illegal and may produce unknown results.
-
initializeLocalAddresses
void initializeLocalAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException
Initializes addresses discovery SPI binds to.- Parameters:
addrs- Addresses discovery SPI binds to.- Throws:
IgniteSpiException- In case of error.
-
getRegisteredAddresses
Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException
Gets all addresses registered in this finder.- Returns:
- All known addresses, potentially empty, but never
null. - Throws:
IgniteSpiException- In case of error.
-
isShared
boolean isShared()
Checks whether IP finder is shared or not.If this property is set to
truethen IP finder allows to add and remove addresses in runtime and this is how, for example, IP finder should work in Amazon EC2 environment or any other environment where IPs may not be known beforehand.If this property is set to
falsethen IP finder is immutable and all the addresses should be listed in configuration before Ignite start. This is the most use case for IP finders local to current VM. Since, usually such IP finders are created per each Ignite instance and all the known IPs are listed right away, but there is also an option to make such IP finders shared by setting this property totrueand literally share it between local VM Ignite instances. This way user does not have to list any IPs before start, instead all starting nodes add their addresses to the finder, then get the registered addresses and continue with discovery procedure.- Returns:
trueif IP finder is shared.
-
registerAddresses
void registerAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException
Registers new addresses.Implementation should accept duplicates quietly, but should not register address if it is already registered.
- Parameters:
addrs- Addresses to register. Notnulland not empty.- Throws:
IgniteSpiException- In case of error.
-
unregisterAddresses
void unregisterAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException
Unregisters provided addresses.Implementation should accept addresses that are currently not registered quietly (just no-op).
- Parameters:
addrs- Addresses to unregister. Notnulland not empty.- Throws:
IgniteSpiException- In case of error.
-
close
void close()
Closes this IP finder and releases any system resources associated with it.
-
-