Class HostReachabilityDetector

    • Constructor Detail

      • HostReachabilityDetector

        public HostReachabilityDetector​(String host)
        Constructs new instance with the default timeout value (=3000).
        Parameters:
        host - Host to be checked for reachability.
      • HostReachabilityDetector

        public HostReachabilityDetector​(String host,
                                        int timeout)
        Constructs new instance.
        Parameters:
        host - Host to be checked for reachability.
        timeout - Timeout in milliseconds for host reachability checking (see InetAddress.isReachable(int)).
    • Method Detail

      • host

        public String host()
        Host to check.
        Returns:
        Host to check.
      • timeout

        public int timeout()
        Check timeout in milliseconds.
        Returns:
        Timeout in milliseconds.
      • isValid

        public boolean isValid​(ClusterNode localNode)
        Description copied from interface: SplitBrainDetector
        Performs a split-brain check and returns true if local node can reach other members of the cluster.

        If this method returns false then HekateFatalErrorPolicy will be applied with ClusterSplitBrainException as a cause.

        Specified by:
        isValid in interface SplitBrainDetector
        Parameters:
        localNode - Local node (where the check is performed).
        Returns:
        true if local node can reach other members of the cluster.