Class DefaultFailureDetectorConfig

    • Constructor Detail

      • DefaultFailureDetectorConfig

        public DefaultFailureDetectorConfig()
    • Method Detail

      • getHeartbeatInterval

        public long getHeartbeatInterval()
        Returns the heartbeat sending interval in milliseconds (see setHeartbeatInterval(long)).
        Returns:
        Time interval in milliseconds.
      • setHeartbeatInterval

        public void setHeartbeatInterval​(long heartbeatInterval)
        Sets the heartbeat sending interval in milliseconds.

        Value of this parameter must be above zero. Default value is 500.

        Parameters:
        heartbeatInterval - Time interval in milliseconds.
      • getHeartbeatLossThreshold

        public int getHeartbeatLossThreshold()
        Returns the amount of heartbeats that can be lost before considering a node failure (see setHeartbeatLossThreshold(int)).
        Returns:
        Heartbeat loss threshold.
      • setHeartbeatLossThreshold

        public void setHeartbeatLossThreshold​(int heartbeatLossThreshold)
        Sets the amount of heartbeats that can be lost before considering a node failure.

        Value of this parameter must be above zero. Default value is 6.

        Parameters:
        heartbeatLossThreshold - Heartbeat loss threshold.
      • getFailureDetectionQuorum

        public int getFailureDetectionQuorum()
        Returns the amount of nodes that should agree on some particular node failure before removing such a suspected node from the cluster (see setFailureDetectionQuorum(int)).
        Returns:
        Amount of nodes that should agree on some particular node failure before removing such a suspected node from the cluster.
      • setFailureDetectionQuorum

        public void setFailureDetectionQuorum​(int failureDetectionQuorum)
        Sets the amount of nodes that should agree on some particular node failure before removing such a suspected node from the cluster.

        Value of this parameter must be above 1. Default value is 2.

        Parameters:
        failureDetectionQuorum - Amount of nodes that should agree on some particular node failure before removing such suspected node from the cluster.
        See Also:
        FailureDetector.failureQuorum()
      • withFailureDetectionQuorum

        public DefaultFailureDetectorConfig withFailureDetectionQuorum​(int failureDetectionQuorum)
        Fluent-style version of setFailureDetectionQuorum(int).
        Parameters:
        failureDetectionQuorum - Amount of nodes that should agree on some particular node failure before removing such suspected node from the cluster.
        Returns:
        This instance.
      • isFailFast

        public boolean isFailFast()
        Sets the flag that controls the failure detection behavior in case of network connectivity issues between the cluster nodes (see setFailFast(boolean).
        Returns:
        true if fast-fail failure detection mode is enabled.
      • setFailFast

        public void setFailFast​(boolean failFast)
        Sets the flag that controls the failure detection behavior in case of network connectivity issues between the cluster nodes.

        If this flag is set to true then cluster node will be immediately treated as failed in case of a ConnectException while sending a gossip message to that node. If set to false then failure detector will wait for all setHeartbeatLossThreshold(int) attempts before treating such a node as failed.

        Default value of this parameter is true.

        Parameters:
        failFast - true to speed up failure detection.