public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder
When TCP discovery starts this finder sends multicast request and waits
for some time when others nodes reply to this request with messages containing
their addresses (time IP finder waits for response and number of attempts to
re-send multicast request in case if no replies are received can be configured,
see setResponseWaitTime(int) and setAddressRequestAttempts(int)).
In addition to address received via multicast this finder can work with pre-configured
list of addresses specified via TcpDiscoveryVmIpFinder.setAddresses(Collection) method.
setMulticastGroup(String)).setMulticastPort(int)).setResponseWaitTime(int)).setAddressRequestAttempts(int)).TcpDiscoveryVmIpFinder.setAddresses(Collection))setLocalAddress(String))| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_ADDR_REQ_ATTEMPTS
Default number of attempts to send multicast address request (value is
2). |
static String |
DFLT_MCAST_GROUP
Default multicast IP address (value is
228.1.2.4). |
static int |
DFLT_MCAST_PORT
Default multicast port number (value is
47400). |
static int |
DFLT_RES_WAIT_TIME
Default time IP finder waits for reply to multicast address request (value is
500). |
ignite| Constructor and Description |
|---|
TcpDiscoveryMulticastIpFinder()
Constructs new IP finder.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this IP finder and releases any system resources associated with it.
|
int |
getAddressRequestAttempts()
Gets number of attempts to send multicast address request.
|
String |
getLocalAddress()
Gets local address that multicast IP finder uses.
|
String |
getMulticastGroup()
Gets IP address of multicast group.
|
int |
getMulticastPort()
Gets port number which multicast messages are sent to.
|
Collection<InetSocketAddress> |
getRegisteredAddresses()
Gets all addresses registered in this finder.
|
int |
getResponseWaitTime()
Gets time in milliseconds IP finder waits for reply to
multicast address request.
|
int |
getTimeToLive()
Set the default time-to-live for multicast packets sent out on this
IP finder.
|
void |
initializeLocalAddresses(Collection<InetSocketAddress> addrs)
Initializes addresses discovery SPI binds to.
|
void |
onSpiContextInitialized(IgniteSpiContext spiCtx)
Callback invoked when SPI context is initialized after
TcpDiscoverySpi.spiStart(String)
method is completed, SPI context can be stored for future access. |
void |
setAddressRequestAttempts(int addrReqAttempts)
Sets number of attempts to send multicast address request.
|
void |
setLocalAddress(String locAddr)
Sets local host address used by this IP finder.
|
void |
setMulticastGroup(String mcastGrp)
Sets IP address of multicast group.
|
void |
setMulticastPort(int mcastPort)
Sets port number which multicast messages are sent to.
|
void |
setResponseWaitTime(int resWaitTime)
Sets time in milliseconds IP finder waits for reply to
multicast address request.
|
void |
setTimeToLive(int ttl)
Set the default time-to-live for multicast packets sent out on this
IP finder in order to control the scope of the multicast.
|
String |
toString() |
registerAddresses, setAddresses, unregisterAddressesdiscoveryClientMode, isShared, onSpiContextDestroyed, setShared, spiContextpublic static final String DFLT_MCAST_GROUP
228.1.2.4).public static final int DFLT_MCAST_PORT
47400).public static final int DFLT_RES_WAIT_TIME
500).public static final int DFLT_ADDR_REQ_ATTEMPTS
2).public TcpDiscoveryMulticastIpFinder()
@IgniteSpiConfiguration(optional=true) public void setMulticastGroup(String mcastGrp)
If not provided, default value is DFLT_MCAST_GROUP.
mcastGrp - Multicast IP address.public String getMulticastGroup()
@IgniteSpiConfiguration(optional=true) public void setMulticastPort(int mcastPort)
If not provided, default value is DFLT_MCAST_PORT.
mcastPort - Multicast port number.public int getMulticastPort()
@IgniteSpiConfiguration(optional=true) public void setResponseWaitTime(int resWaitTime)
If not provided, default value is DFLT_RES_WAIT_TIME.
resWaitTime - Time IP finder waits for reply to multicast address request.public int getResponseWaitTime()
@IgniteSpiConfiguration(optional=true) public void setAddressRequestAttempts(int addrReqAttempts)
If not provided, default value is DFLT_ADDR_REQ_ATTEMPTS.
addrReqAttempts - Number of attempts to send multicast address request.public int getAddressRequestAttempts()
@IgniteSpiConfiguration(optional=true) public void setLocalAddress(String locAddr)
If not provided then this property is initialized by the local address set in TcpDiscoverySpi
configuration.
locAddr - Local host address.TcpDiscoverySpi.setLocalAddress(String)public String getLocalAddress()
@IgniteSpiConfiguration(optional=true) public void setTimeToLive(int ttl)
The TTL has to be in the range 0 <= TTL <= 255.
If TTL is 0, packets are not transmitted on the network,
but may be delivered locally.
ttl - Time to live.public int getTimeToLive()
public void initializeLocalAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException
initializeLocalAddresses in interface TcpDiscoveryIpFinderinitializeLocalAddresses in class TcpDiscoveryIpFinderAdapteraddrs - Addresses discovery SPI binds to.IgniteSpiException - In case of error.public void onSpiContextInitialized(IgniteSpiContext spiCtx) throws IgniteSpiException
TcpDiscoverySpi.spiStart(String)
method is completed, SPI context can be stored for future access.onSpiContextInitialized in interface TcpDiscoveryIpFinderonSpiContextInitialized in class TcpDiscoveryIpFinderAdapterspiCtx - Spi context.IgniteSpiException - In case of error.public Collection<InetSocketAddress> getRegisteredAddresses()
getRegisteredAddresses in interface TcpDiscoveryIpFindergetRegisteredAddresses in class TcpDiscoveryVmIpFindernull.public void close()
close in interface TcpDiscoveryIpFinderclose in class TcpDiscoveryIpFinderAdapterpublic String toString()
toString in class TcpDiscoveryVmIpFinder
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016