public class IcmpFailureDetectorConfig extends Object
This failure detector is based on InetAddress.isReachable(). When the JVM process has enough permissions to create RAW sockets, the implementation will choose to rely on ICMP Echo requests. This is preferred. However, if there are not enough permissions, it can be configured to fallback on attempting a TCP Echo on port 7. In the latter case, both a successful connection or an explicit rejection will be treated as "Host is Reachable". This is not preferred as each call creates a heavyweight socket and moreover the Echo service is typically disabled.
For the Ping Failure Detector to rely only on ICMP (RAW sockets) Echo requests, there are some criteria that need to be met. Please consult the Hazelcast Reference Manual on how to configure and what the OS requirements are.
Constructor and Description |
---|
IcmpFailureDetectorConfig() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getIntervalMilliseconds() |
int |
getMaxAttempts() |
int |
getTimeoutMilliseconds() |
int |
getTtl() |
int |
hashCode() |
boolean |
isEnabled() |
boolean |
isFailFastOnStartup() |
boolean |
isParallelMode() |
IcmpFailureDetectorConfig |
setEnabled(boolean enabled)
Set whether the ICMP failure detector should be enabled or not.
|
IcmpFailureDetectorConfig |
setFailFastOnStartup(boolean failFastOnStartup)
Sets whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS.
|
IcmpFailureDetectorConfig |
setIntervalMilliseconds(int intervalMilliseconds)
Sets the time in milliseconds between each ping
This value can not be smaller than 1000 milliseconds
|
IcmpFailureDetectorConfig |
setMaxAttempts(int maxAttempts)
Set the max ping attempts before suspecting a member
|
IcmpFailureDetectorConfig |
setParallelMode(boolean mode)
Set the ICMP detector to run in parallel mode, independent from the other failure detectors.
|
IcmpFailureDetectorConfig |
setTimeoutMilliseconds(int timeoutMilliseconds)
Sets the timeout in Milliseconds before declaring a failed ping
This cannot be more than the interval value.
|
IcmpFailureDetectorConfig |
setTtl(int ttl)
Sets the maximum number of times the IP Datagram (ping) can be forwarded, in most cases
all Hazelcast cluster members would be within one network switch/router therefore
|
String |
toString() |
public int getTimeoutMilliseconds()
public IcmpFailureDetectorConfig setTimeoutMilliseconds(int timeoutMilliseconds)
timeoutMilliseconds
- the timeout for each ping in millisIcmpFailureDetectorConfig
instancepublic int getIntervalMilliseconds()
public IcmpFailureDetectorConfig setIntervalMilliseconds(int intervalMilliseconds)
intervalMilliseconds
- the interval millis between each pingIcmpFailureDetectorConfig
instancepublic boolean isFailFastOnStartup()
public IcmpFailureDetectorConfig setFailFastOnStartup(boolean failFastOnStartup)
failFastOnStartup
- the fail-fast flagIcmpFailureDetectorConfig
instancepublic int getTtl()
public IcmpFailureDetectorConfig setTtl(int ttl)
ttl
- the new time-to-live valueIcmpFailureDetectorConfig
instancepublic int getMaxAttempts()
public IcmpFailureDetectorConfig setMaxAttempts(int maxAttempts)
maxAttempts
- the max attempts before suspecting a memberIcmpFailureDetectorConfig
instancepublic boolean isEnabled()
public IcmpFailureDetectorConfig setEnabled(boolean enabled)
public boolean isParallelMode()
false
).public IcmpFailureDetectorConfig setParallelMode(boolean mode)
mode
- the mode representing whether the detector should work in parallel or notIcmpFailureDetectorConfig
instanceCopyright © 2024 Hazelcast, Inc.. All rights reserved.