Class AddressReachabilityDetector

    • Constructor Detail

      • AddressReachabilityDetector

        public AddressReachabilityDetector​(String address)
        Constructs new instance with the default timeout value (=3000).
        Parameters:
        address - Address in a form of <host>:<port> (f.e. 192.168.39.41:10012).
      • AddressReachabilityDetector

        public AddressReachabilityDetector​(String address,
                                           int timeout)
        Constructs new instance.
        Parameters:
        address - Address in a form of <host>:<port> (f.e. 192.168.39.41:10012).
        timeout - Connect timeout in milliseconds (see Socket.connect(SocketAddress, int)).
    • Method Detail

      • address

        public InetSocketAddress address()
        Address to check.
        Returns:
        Address 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.