Class IcmpFailureDetectorConfig
It operates at Layer 3 of the OSI protocol, and provides much quicker and more deterministic detection of hardware
and other lower level events. This detector may be configured to perform an extra check after a member is suspected by one
of the other detectors, or it can work in parallel, which is the default. This way hardware and network level issues
will be detected more quickly.
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanintintintintgetTtl()final inthashCode()booleanbooleanbooleansetEnabled(boolean enabled) Set whether the ICMP failure detector should be enabled or not.setFailFastOnStartup(boolean failFastOnStartup) Sets whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS.setIntervalMilliseconds(int intervalMilliseconds) Sets the time in milliseconds between each ping This value can not be smaller than 1000 millisecondssetMaxAttempts(int maxAttempts) Set the max ping attempts before suspecting a membersetParallelMode(boolean mode) Set the ICMP detector to run in parallel mode, independent from the other failure detectors.setTimeoutMilliseconds(int timeoutMilliseconds) Sets the timeout in Milliseconds before declaring a failed ping This cannot be more than the interval value.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 thereforetoString()
- 
Constructor Details- 
IcmpFailureDetectorConfigpublic IcmpFailureDetectorConfig()
 
- 
- 
Method Details- 
getTimeoutMillisecondspublic int getTimeoutMilliseconds()- Returns:
- the timeout in Milliseconds before declaring a failed ping
 
- 
setTimeoutMillisecondsSets the timeout in Milliseconds before declaring a failed ping This cannot be more than the interval value. Should always be smaller.- Parameters:
- timeoutMilliseconds- the timeout for each ping in millis
- Returns:
- this IcmpFailureDetectorConfiginstance
 
- 
getIntervalMillisecondspublic int getIntervalMilliseconds()- Returns:
- the time in milliseconds between each ping
 
- 
setIntervalMillisecondsSets the time in milliseconds between each ping This value can not be smaller than 1000 milliseconds- Parameters:
- intervalMilliseconds- the interval millis between each ping
- Returns:
- this IcmpFailureDetectorConfiginstance
 
- 
isFailFastOnStartuppublic boolean isFailFastOnStartup()- Returns:
- whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS.
 
- 
setFailFastOnStartupSets whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS. Failure is usually due to OS level restrictions.- Parameters:
- failFastOnStartup- the fail-fast flag
- Returns:
- this IcmpFailureDetectorConfiginstance
 
- 
getTtlpublic int getTtl()- Returns:
- the maximum number of times the IP Datagram (ping) can be forwarded
 
- 
setTtlSets 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- Parameters:
- ttl- the new time-to-live value
- Returns:
- this IcmpFailureDetectorConfiginstance
 
- 
getMaxAttemptspublic int getMaxAttempts()- Returns:
- max ping attempts before suspecting a member
 
- 
setMaxAttemptsSet the max ping attempts before suspecting a member- Parameters:
- maxAttempts- the max attempts before suspecting a member
- Returns:
- this IcmpFailureDetectorConfiginstance
 
- 
isEnabledpublic boolean isEnabled()- Returns:
- whether the ICMP detector is enabled or not.
 
- 
setEnabledSet whether the ICMP failure detector should be enabled or not. When set to true, this member will use icmp ping failure detector to detect unavailable members
- 
isParallelModepublic boolean isParallelMode()- Returns:
- whether the ICMP detector is set in parallel mode, or in legacy (flag value = false).
 
- 
setParallelModeSet the ICMP detector to run in parallel mode, independent from the other failure detectors. If set to false (default) then the detector runs in legacy mode, with similar behavior as to Hazelcast version less than 3.9.- Parameters:
- mode- the mode representing whether the detector should work in parallel or not
- Returns:
- this IcmpFailureDetectorConfiginstance
 
- 
toString
- 
equals
- 
hashCodepublic final int hashCode()
 
-