com.hazelcast.config

## Class QuorumConfig

- java.lang.Object
- - com.hazelcast.config.QuorumConfig

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

      public class QuorumConfig
      extends Object
      implements IdentifiedDataSerializable

  Configuration for cluster quorum, a means to protect consistency of data from network partitions. In this context, quorum does not refer to an implementation of a consensus protocol, it refers to the count of members in the cluster required for an operation to succeed.

  Since Hazelcast 3.5, the default built-in quorum implementation keeps track of the number of members in the cluster, as determined by Hazelcast's cluster membership management.

  Since Hazelcast 3.10, two additional built-in quorum implementations, decoupled from the existing cluster membership management, are provided:

  - Probabilistic quorum: in this mode, member heartbeats are tracked and an adaptive failure detector determines for each member the suspicion level. Additionally, when the Hazelcast member is configured with the ICMP ping failure detector enabled and operating in parallel mode, ping information is also used to detect member failures early.

    To create a `QuorumConfig` for probabilistic quorum, use `newProbabilisticQuorumConfigBuilder(String, int)` to configure and build the `QuorumConfig`.

  - Recently-active quorum: in this mode, for a member to be considered present for quorum, a heartbeat must be received within the configured time-window since now. Additionally, when the Hazelcast member is configured with the ICMP ping failure detector enabled and operating in parallel mode, ping information is also used to detect member failures early.

    To create a `QuorumConfig` for recently-active quorum, use `newRecentlyActiveQuorumConfigBuilder(String, int, int)` to configure and build the `QuorumConfig`.

  See Also:
    `QuorumFunction`, `ProbabilisticQuorumFunction`, `RecentlyActiveQuorumFunction`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QuorumConfig()`
    `QuorumConfig(QuorumConfig quorumConfig)`
    `QuorumConfig(String name, boolean enabled)`
    `QuorumConfig(String name, boolean enabled, int size)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `QuorumConfig` | `addListenerConfig(QuorumListenerConfig listenerConfig)`
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `List<QuorumListenerConfig>` | `getListenerConfigs()`
    `String` | `getName()`
    `String` | `getQuorumFunctionClassName()`
    `QuorumFunction` | `getQuorumFunctionImplementation()`
    `int` | `getSize()`
    `QuorumType` | `getType()`
    `boolean` | `isEnabled()`
    `static ProbabilisticQuorumConfigBuilder` | `newProbabilisticQuorumConfigBuilder(String name, int size)` Returns a builder for `QuorumConfig` with the given `name` using a probabilistic quorum function, for the given quorum `size` that is enabled by default.
    `static RecentlyActiveQuorumConfigBuilder` | `newRecentlyActiveQuorumConfigBuilder(String name, int size, int toleranceMillis)` Returns a builder for a `QuorumConfig` with the given `name` using a recently-active quorum function for the given quorum `size` that is enabled by default.
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `QuorumConfig` | `setEnabled(boolean enabled)`
    `QuorumConfig` | `setListenerConfigs(List<QuorumListenerConfig> listenerConfigs)`
    `QuorumConfig` | `setName(String name)`
    `QuorumConfig` | `setQuorumFunctionClassName(String quorumFunctionClassName)`
    `QuorumConfig` | `setQuorumFunctionImplementation(QuorumFunction quorumFunctionImplementation)`
    `QuorumConfig` | `setSize(int size)`
    `QuorumConfig` | `setType(QuorumType type)`
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### QuorumConfig

          public QuorumConfig()

    - #### QuorumConfig

          public QuorumConfig(String name,
                              boolean enabled)

    - #### QuorumConfig

          public QuorumConfig(String name,
                              boolean enabled,
                              int size)

    - #### QuorumConfig

          public QuorumConfig(QuorumConfig quorumConfig)

  - ### Method Detail

    - #### getName

          public String getName()

    - #### setName

          public QuorumConfig setName(String name)

    - #### isEnabled

          public boolean isEnabled()

    - #### setEnabled

          public QuorumConfig setEnabled(boolean enabled)

    - #### getSize

          public int getSize()

    - #### setSize

          public QuorumConfig setSize(int size)

    - #### getType

          public QuorumType getType()

    - #### setType

          public QuorumConfig setType(QuorumType type)

    - #### getListenerConfigs

          public List<QuorumListenerConfig> getListenerConfigs()

    - #### setListenerConfigs

          public QuorumConfig setListenerConfigs(List<QuorumListenerConfig> listenerConfigs)

    - #### addListenerConfig

          public QuorumConfig addListenerConfig(QuorumListenerConfig listenerConfig)

    - #### getQuorumFunctionClassName

          public String getQuorumFunctionClassName()

    - #### setQuorumFunctionClassName

          public QuorumConfig setQuorumFunctionClassName(String quorumFunctionClassName)

    - #### getQuorumFunctionImplementation

          public QuorumFunction getQuorumFunctionImplementation()

    - #### setQuorumFunctionImplementation

          public QuorumConfig setQuorumFunctionImplementation(QuorumFunction quorumFunctionImplementation)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### newProbabilisticQuorumConfigBuilder

          public static ProbabilisticQuorumConfigBuilder newProbabilisticQuorumConfigBuilder(String name,
                                                                                             int size)

      Returns a builder for `QuorumConfig` with the given `name` using a probabilistic quorum function, for the given quorum `size` that is enabled by default.
      Parameters:
        `name` - the quorum's name
        `size` - minimum count of members for quorum to be considered present
      See Also:
        `ProbabilisticQuorumFunction`

    - #### newRecentlyActiveQuorumConfigBuilder

          public static RecentlyActiveQuorumConfigBuilder newRecentlyActiveQuorumConfigBuilder(String name,
                                                                                               int size,
                                                                                               int toleranceMillis)

      Returns a builder for a `QuorumConfig` with the given `name` using a recently-active quorum function for the given quorum `size` that is enabled by default.
      Parameters:
        `name` - the quorum's name
        `size` - minimum count of members for quorum to be considered present
        `toleranceMillis` - maximum amount of milliseconds that may have passed since last heartbeat was received for a member to be considered present for quorum.
      See Also:
        `RecentlyActiveQuorumFunction`

Copyright © 2018. All rights reserved.