|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object voldemort.cluster.failuredetector.FailureDetectorConfig
public class FailureDetectorConfig
FailureDetectorConfig simply holds all the data that was available to it upon
construction. A FailureDetectorConfig is usually passed to
FailureDetectorUtils
's create
method to create a full-blown FailureDetector
instance.
Field Summary | |
---|---|
protected long |
asyncRecoveryInterval
|
protected long |
bannagePeriod
|
protected java.util.List<java.lang.String> |
catastrophicErrorTypes
|
static long |
DEFAULT_ASYNC_RECOVERY_INTERVAL
|
static long |
DEFAULT_BANNAGE_PERIOD
|
static java.util.List<java.lang.String> |
DEFAULT_CATASTROPHIC_ERROR_TYPES
|
static java.lang.String |
DEFAULT_IMPLEMENTATION_CLASS_NAME
|
static int |
DEFAULT_MAX_TOLERABLE_FATAL_FAILURES
|
static long |
DEFAULT_REQUEST_LENGTH_THRESHOLD
|
static int |
DEFAULT_THRESHOLD
|
static int |
DEFAULT_THRESHOLD_COUNT_MINIMUM
|
static long |
DEFAULT_THRESHOLD_INTERVAL
|
protected java.lang.String |
implementationClassName
|
protected int |
maximumTolerableFatalFailures
|
protected java.util.Collection<Node> |
nodes
|
protected long |
requestLengthThreshold
|
protected StoreVerifier |
storeVerifier
|
protected int |
threshold
|
protected int |
thresholdCountMinimum
|
protected long |
thresholdInterval
|
protected Time |
time
|
Constructor Summary | |
---|---|
FailureDetectorConfig()
Constructs a new FailureDetectorConfig using all the defaults. |
|
FailureDetectorConfig(ClientConfig config)
Constructs a new FailureDetectorConfig from a client perspective (via ClientConfig ). |
|
FailureDetectorConfig(VoldemortConfig config)
Constructs a new FailureDetectorConfig from a server perspective (via VoldemortConfig ). |
Method Summary | |
---|---|
void |
addNode(Node node)
|
long |
getAsyncRecoveryInterval()
Returns the interval of time (in milliseconds) that the thread will wait before checking if a given node has recovered. |
long |
getBannagePeriod()
Returns the node bannage period (in milliseconds) as defined by the client or server configuration. |
java.util.List<java.lang.String> |
getCatastrophicErrorTypes()
Returns the list of Java Exception types that are considered catastrophic. |
Cluster |
getCluster()
Returns a reference to the cluster object |
java.lang.String |
getImplementationClassName()
Returns the fully-qualified class name of the FailureDetector implementation. |
int |
getMaximumTolerableFatalFailures()
|
java.util.Collection<Node> |
getNodes()
Deprecated. |
long |
getRequestLengthThreshold()
Returns the maximum time (in milliseconds) that a request (get, put, delete, etc.) can take before a given successful event is considered as a failure because the requests are--while successful--considered to be taking too long to complete. |
StoreVerifier |
getStoreVerifier()
|
int |
getThreshold()
Returns the success threshold percentage with an integer value between 0 and 100. |
int |
getThresholdCountMinimum()
Returns the minimum number of failures that must occur before the success ratio is calculated to compare against the success threshold percentage. |
long |
getThresholdInterval()
Returns the interval of time for each the success ratio is valid. |
Time |
getTime()
|
void |
removeNode(Node node)
|
FailureDetectorConfig |
setAsyncRecoveryInterval(long asyncRecoveryInterval)
Assigns the interval of time (in milliseconds) that the thread will wait before checking if a given node has recovered. |
FailureDetectorConfig |
setBannagePeriod(long bannagePeriod)
Assigns the node bannage period (in milliseconds) as defined by the client or server configuration. |
FailureDetectorConfig |
setCatastrophicErrorTypes(java.util.List<java.lang.String> catastrophicErrorTypes)
Assigns the list of Java Exception types that are considered catastrophic. |
FailureDetectorConfig |
setCluster(Cluster cluster)
Assigns a cluster which determines the source of truth for the topology |
FailureDetectorConfig |
setImplementationClassName(java.lang.String implementationClassName)
Assigns the fully-qualified class name of the FailureDetector implementation. |
FailureDetectorConfig |
setMaximumTolerableFatalFailures(int maximumTolerableFatalFailures)
Sets the maximum number of Fatal failures (connectivity failures) acceptable before the node is marked as unavailable (in case of ThresholdFailureDetector). |
FailureDetectorConfig |
setNodes(java.util.Collection<Node> nodes)
Deprecated. |
FailureDetectorConfig |
setRequestLengthThreshold(long requestLengthThreshold)
Assigns the value for the maximum time (in milliseconds) that a request (get, put, delete, etc.) can take before a given successful event is considered as a failure because the requests are--while successful--considered to be taking too long to complete. |
FailureDetectorConfig |
setStoreVerifier(StoreVerifier storeVerifier)
|
FailureDetectorConfig |
setThreshold(int threshold)
Assigns the success threshold percentage with an integer value between 0 and 100. |
FailureDetectorConfig |
setThresholdCountMinimum(int thresholdCountMinimum)
Assigns the minimum number of failures that must occur before the success ratio is calculated to compare against the success threshold percentage. |
FailureDetectorConfig |
setThresholdInterval(long thresholdInterval)
Assigns the interval of time for each the success ratio is valid. |
FailureDetectorConfig |
setTime(Time time)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_IMPLEMENTATION_CLASS_NAME
public static final long DEFAULT_BANNAGE_PERIOD
public static final long DEFAULT_THRESHOLD_INTERVAL
public static final int DEFAULT_THRESHOLD
public static final int DEFAULT_THRESHOLD_COUNT_MINIMUM
public static final long DEFAULT_ASYNC_RECOVERY_INTERVAL
public static final java.util.List<java.lang.String> DEFAULT_CATASTROPHIC_ERROR_TYPES
public static final long DEFAULT_REQUEST_LENGTH_THRESHOLD
public static final int DEFAULT_MAX_TOLERABLE_FATAL_FAILURES
protected java.lang.String implementationClassName
protected long bannagePeriod
protected int threshold
protected int thresholdCountMinimum
protected long thresholdInterval
protected long asyncRecoveryInterval
protected java.util.List<java.lang.String> catastrophicErrorTypes
protected long requestLengthThreshold
protected java.util.Collection<Node> nodes
protected StoreVerifier storeVerifier
protected Time time
protected int maximumTolerableFatalFailures
Constructor Detail |
---|
public FailureDetectorConfig()
setNodes(Collection)
and
setStoreVerifier(StoreVerifier)
methods must be called to ensure
complete configuration.
public FailureDetectorConfig(VoldemortConfig config)
VoldemortConfig
).
Note: the setNodes(Collection)
and
setStoreVerifier(StoreVerifier)
methods must be called to ensure
complete configuration.
config
- VoldemortConfig
instancepublic FailureDetectorConfig(ClientConfig config)
ClientConfig
).
Note: the setNodes(Collection)
and
setStoreVerifier(StoreVerifier)
methods must be called to ensure
complete configuration.
config
- ClientConfig
instanceMethod Detail |
---|
public java.lang.String getImplementationClassName()
VoldemortConfig.getFailureDetectorImplementation()
,
ClientConfig.getFailureDetectorImplementation()
public FailureDetectorConfig setImplementationClassName(java.lang.String implementationClassName)
implementationClassName
- Class name to instantiate for the
FailureDetectorVoldemortConfig.getFailureDetectorImplementation()
,
ClientConfig.getFailureDetectorImplementation()
public long getBannagePeriod()
BannagePeriodFailureDetector
implementation.
BannagePeriodFailureDetector
,
VoldemortConfig.getFailureDetectorBannagePeriod()
,
ClientConfig.getFailureDetectorBannagePeriod()
public FailureDetectorConfig setBannagePeriod(long bannagePeriod)
BannagePeriodFailureDetector
implementation.
bannagePeriod
- Period of bannage of a node, in millisecondsBannagePeriodFailureDetector
,
VoldemortConfig.getFailureDetectorBannagePeriod()
,
ClientConfig.getFailureDetectorBannagePeriod()
public int getThreshold()
ThresholdFailureDetector
implementation.
ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorThreshold()
,
ClientConfig.getFailureDetectorThreshold()
public FailureDetectorConfig setThreshold(int threshold)
ThresholdFailureDetector
implementation.
threshold
- Integer percentage representing success threshold
java.lang.IllegalArgumentException
- Thrown if the threshold parameter is
outside the range [0..100]ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorThreshold()
,
ClientConfig.getFailureDetectorThreshold()
public int getThresholdCountMinimum()
ThresholdFailureDetector
implementation.
ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorThreshold()
,
ClientConfig.getFailureDetectorThreshold()
public FailureDetectorConfig setThresholdCountMinimum(int thresholdCountMinimum)
ThresholdFailureDetector
implementation.
thresholdCountMinimum
- Integer representing the minimum number of
failures (per node) that must be processed before the threshold is
checked
java.lang.IllegalArgumentException
- Thrown if the thresholdCountMinimum
parameter is outside the range [0..Integer.MAX_VALUE]ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorThreshold()
,
ClientConfig.getFailureDetectorThreshold()
public long getThresholdInterval()
ThresholdFailureDetector
implementation.
ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorThresholdInterval()
,
ClientConfig.getFailureDetectorThresholdInterval()
public FailureDetectorConfig setThresholdInterval(long thresholdInterval)
ThresholdFailureDetector
implementation.
thresholdInterval
- Millisecond interval for the success ratio
java.lang.IllegalArgumentException
- Thrown if the thresholdInterval
parameter is less than or equal to 0ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorThresholdInterval()
,
ClientConfig.getFailureDetectorThresholdInterval()
public long getAsyncRecoveryInterval()
AsyncRecoveryFailureDetector
and ThresholdFailureDetector
implementations.
AsyncRecoveryFailureDetector
,
ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorAsyncRecoveryInterval()
,
ClientConfig.getFailureDetectorAsyncRecoveryInterval()
public FailureDetectorConfig setAsyncRecoveryInterval(long asyncRecoveryInterval)
AsyncRecoveryFailureDetector
and ThresholdFailureDetector
implementations.
asyncRecoveryInterval
- Number of milliseconds to wait between
recovery attempts
java.lang.IllegalArgumentException
- Thrown if the thresholdInterval
parameter is less than or equal to 0AsyncRecoveryFailureDetector
,
ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorAsyncRecoveryInterval()
,
ClientConfig.getFailureDetectorAsyncRecoveryInterval()
public java.util.List<java.lang.String> getCatastrophicErrorTypes()
ThresholdFailureDetector
implementation.
ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorCatastrophicErrorTypes()
,
ClientConfig.getFailureDetectorCatastrophicErrorTypes()
public FailureDetectorConfig setCatastrophicErrorTypes(java.util.List<java.lang.String> catastrophicErrorTypes)
ThresholdFailureDetector
implementation.
catastrophicErrorTypes
- List of fully-qualified Java Exception
class names against which to check the exception provided to
recordException; this list should be immutable and non-nullThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorCatastrophicErrorTypes()
,
ClientConfig.getFailureDetectorCatastrophicErrorTypes()
public long getRequestLengthThreshold()
ThresholdFailureDetector
implementation.
ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorRequestLengthThreshold()
,
ClientConfig.getFailureDetectorRequestLengthThreshold()
public FailureDetectorConfig setRequestLengthThreshold(long requestLengthThreshold)
ThresholdFailureDetector
implementation.
requestLengthThreshold
- Number of milliseconds representing maximum
amount of time the request should take before being considered as
a failure
java.lang.IllegalArgumentException
- Thrown if the requestLengthThreshold
parameter is less than 0ThresholdFailureDetector
,
VoldemortConfig.getFailureDetectorRequestLengthThreshold()
,
ClientConfig.getFailureDetectorRequestLengthThreshold()
public Cluster getCluster()
public FailureDetectorConfig setCluster(Cluster cluster)
cluster
- The Cluster object retrieved during bootstrap; must be
non-null@Deprecated public java.util.Collection<Node> getNodes()
@Deprecated public FailureDetectorConfig setNodes(java.util.Collection<Node> nodes)
nodes
- Collection of Node instances, usually determined from the
Cluster; must be non-nullpublic void addNode(Node node)
public void removeNode(Node node)
public StoreVerifier getStoreVerifier()
public FailureDetectorConfig setStoreVerifier(StoreVerifier storeVerifier)
public Time getTime()
public FailureDetectorConfig setTime(Time time)
public FailureDetectorConfig setMaximumTolerableFatalFailures(int maximumTolerableFatalFailures)
maximumTolerableFatalFailures
- #fatal failures acceptable before
node is marked as unavailablepublic int getMaximumTolerableFatalFailures()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |