Durability.ReplicaAckPolicy (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je

## Enum Durability.ReplicaAckPolicy

- java.lang.Object
- - java.lang.Enum<Durability.ReplicaAckPolicy>
  - - com.sleepycat.je.Durability.ReplicaAckPolicy

- All Implemented Interfaces:
    Serializable, Comparable<Durability.ReplicaAckPolicy>
  Enclosing class:
    Durability

      public static enum Durability.ReplicaAckPolicy
      extends Enum<Durability.ReplicaAckPolicy>

  A replicated environment makes it possible to increase an application's transaction commit guarantees by committing changes to its replicas on the network. ReplicaAckPolicy defines the policy for how such network commits are handled.

  The choice of a ReplicaAckPolicy must be consistent across all the replicas in a replication group, to ensure that the policy is consistently enforced in the event of an election.

  Note that SECONDARY nodes are not included in the set of replicas that must acknowledge transaction commits.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ALL` All ELECTABLE replicas must acknowledge that they have committed the transaction.
    `NONE` No transaction commit acknowledgments are required and the master will never wait for replica acknowledgments.
    `SIMPLE_MAJORITY` A simple majority of ELECTABLE replicas must acknowledge that they have committed the transaction.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `minAckNodes(int groupSize)` Returns the minimum number of ELECTABLE replicas required to implement the ReplicaAckPolicy for a given replication group size.
    `static Durability.ReplicaAckPolicy` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static Durability.ReplicaAckPolicy[]` | `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 Durability.ReplicaAckPolicy ALL

      All ELECTABLE replicas must acknowledge that they have committed the transaction. This policy should be selected only if your replication group has a small number of ELECTABLE replicas, and those replicas are on extremely reliable networks and servers.

    - #### NONE

          public static final Durability.ReplicaAckPolicy NONE

      No transaction commit acknowledgments are required and the master will never wait for replica acknowledgments. In this case, transaction durability is determined entirely by the type of commit that is being performed on the master.

    - #### SIMPLE_MAJORITY

          public static final Durability.ReplicaAckPolicy SIMPLE_MAJORITY

      A simple majority of ELECTABLE replicas must acknowledge that they have committed the transaction. This acknowledgment policy, in conjunction with an election policy which requires at least a simple majority, ensures that the changes made by the transaction remains durable if a new election is held.

      This is the default.

  - ### Method Detail

    - #### values

          public static Durability.ReplicaAckPolicy[] 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 (Durability.ReplicaAckPolicy c : Durability.ReplicaAckPolicy.values())
              System.out.println(c);

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

    - #### valueOf

          public static Durability.ReplicaAckPolicy 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

    - #### minAckNodes

          public int minAckNodes(int groupSize)

      Returns the minimum number of ELECTABLE replicas required to implement the ReplicaAckPolicy for a given replication group size.
      Parameters:
        `groupSize` - the number of ELECTABLE replicas in the replication group
      Returns:
        the number of ELECTABLE replicas needed

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