QuorumPolicy (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je.rep

## Enum QuorumPolicy

- java.lang.Object
- - java.lang.Enum<QuorumPolicy>
  - - com.sleepycat.je.rep.QuorumPolicy

- All Implemented Interfaces:
    Serializable, Comparable<QuorumPolicy>

      public enum QuorumPolicy
      extends Enum<QuorumPolicy>

  The quorum policy determine the number of nodes that must participate to pick the winner of an election, and therefore the master of the group. The default quorum policy during the lifetime of the group is QuorumPolicy.SIMPLE_MAJORITY. The only time that the application needs to specify a specific quorum policy is at node startup time, by passing one to the `ReplicatedEnvironment` constructor.

  Note that `NodeType.SECONDARY` nodes are not counted as part of master election quorums.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ALL` All participants are required to vote.
    `SIMPLE_MAJORITY` A simple majority of participants is required to vote.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `quorumSize(int groupSize)` Returns the minimum number of nodes to needed meet the quorum policy.
    `static QuorumPolicy` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static QuorumPolicy[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### ALL

          public static final QuorumPolicy ALL

      All participants are required to vote.

    - #### SIMPLE_MAJORITY

          public static final QuorumPolicy SIMPLE_MAJORITY

      A simple majority of participants is required to vote.

  - ### Method Detail

    - #### values

          public static QuorumPolicy[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (QuorumPolicy c : QuorumPolicy.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static QuorumPolicy valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### quorumSize

          public int quorumSize(int groupSize)

      Returns the minimum number of nodes to needed meet the quorum policy.
      Parameters:
        `groupSize` - the number of election participants in the replication group
      Returns:
        the number of nodes that are needed for a quorum for a group with `groupSize` number of election participants

Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.