Enum Class Replica

java.lang.Object
java.lang.Enum<Replica>
com.aerospike.client.policy.Replica
All Implemented Interfaces:
Serializable, Comparable<Replica>, Constable

public enum Replica extends Enum<Replica>
Defines algorithm used to determine the target node for a command.
  • Enum Constant Details

    • MASTER

      public static final Replica MASTER
      Use node containing key's master partition.
    • MASTER_PROLES

      public static final Replica MASTER_PROLES
      Distribute reads across nodes containing key's master and replicated partitions in round-robin fashion. Writes always use node containing key's master partition.
    • SEQUENCE

      public static final Replica SEQUENCE
      Try node containing master partition first. If connection fails, all commands try nodes containing replicated partitions. If socketTimeout is reached, reads also try nodes containing replicated partitions, but writes remain on master node.
    • PREFER_RACK

      public static final Replica PREFER_RACK
      Try node on the same rack as the client first. If timeout or there are no nodes on the same rack, use SEQUENCE instead.

      ClientPolicy.rackAware, ClientPolicy.rackId, and server rack configuration must also be set to enable this functionality.

    • RANDOM

      public static final Replica RANDOM
      Distribute reads across all nodes in cluster in round-robin fashion. Writes always use node containing key's master partition.

      This option is useful when the replication factor equals the number of nodes in the cluster and the overhead of requesting proles is not desired.

  • Method Details

    • values

      public static Replica[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Replica valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null