Package com.aerospike.client.policy
Enum Class Replica
- All Implemented Interfaces:
Serializable,Comparable<Replica>,Constable
Defines algorithm used to determine the target node for a command.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUse node containing key's master partition.Distribute reads across nodes containing key's master and replicated partitions in round-robin fashion.Try node on the same rack as the client first.Distribute reads across all nodes in cluster in round-robin fashion.Try node containing master partition first. -
Method Summary
Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
MASTER
Use node containing key's master partition. -
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
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
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
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
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
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 nameNullPointerException- if the argument is null
-