Package net.spy.memcached
Enum FailureMode
- java.lang.Object
-
- java.lang.Enum<FailureMode>
-
- net.spy.memcached.FailureMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<FailureMode>
public enum FailureMode extends java.lang.Enum<FailureMode>
Failure modes for node failures.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description Cancel
Automatically cancel all operations heading towards a downed node.Redistribute
Move on to functional nodes when nodes fail.Retry
Continue to retry a failing node until it comes back up.
-
Constructor Summary
Constructors Modifier Constructor Description private
FailureMode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FailureMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FailureMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Redistribute
public static final FailureMode Redistribute
Move on to functional nodes when nodes fail.In this failure mode, the failure of a node will cause its current queue and future requests to move to the next logical node in the cluster for a given key.
-
Retry
public static final FailureMode Retry
Continue to retry a failing node until it comes back up.This failure mode is appropriate when you have a rare short downtime of a memcached node that will be back quickly, and your app is written to not wait very long for async command completion.
-
Cancel
public static final FailureMode Cancel
Automatically cancel all operations heading towards a downed node.
-
-
Method Detail
-
values
public static FailureMode[] 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 (FailureMode c : FailureMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FailureMode valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-