public class FailoverPolicy<E extends Throwable> extends Object
| Modifier and Type | Field and Description |
|---|---|
Set<Class<E>> |
dontRetry
Optional set of classes representing Exceptions/Errors for which retry should not happen.
|
static FailoverPolicy |
FAIL_FAST
On communication failure, just return the error to the client and don't retry
|
int |
numRetries |
static FailoverPolicy |
ON_FAIL_TRY_ALL_AVAILABLE
On communication error try all known servers before giving up
|
static FailoverPolicy |
ON_FAIL_TRY_ONE_NEXT_AVAILABLE
On communication error try one more server before giving up
|
int |
sleepBetweenHostsMilli |
| Constructor and Description |
|---|
FailoverPolicy(int numRetries,
int sleepBwHostsMilli) |
FailoverPolicy(int numRetries,
int sleepBwHostsMilli,
Class<E> dontRetryForType) |
FailoverPolicy(int numRetries,
int sleepBwHostsMilli,
Set<Class<E>> dontRetryForTypes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldRetryFor(Class<E> candidate)
Determines if a given class is an exception or error that this FailoverPolicy supports retry for.
|
public static FailoverPolicy FAIL_FAST
public static FailoverPolicy ON_FAIL_TRY_ONE_NEXT_AVAILABLE
public static FailoverPolicy ON_FAIL_TRY_ALL_AVAILABLE
public final int numRetries
public final int sleepBetweenHostsMilli
public FailoverPolicy(int numRetries,
int sleepBwHostsMilli)
public FailoverPolicy(int numRetries,
int sleepBwHostsMilli,
Class<E> dontRetryForType)
public boolean shouldRetryFor(Class<E> candidate)
HConnectionManager.Copyright © 2014. All Rights Reserved.