|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.basho.riak.client.cap.DefaultRetrier
public class DefaultRetrier
A basic retrier implementation that attempts *n* times before throwing a
UnresolvedConflictException.
Construct it with the number of times a Callable should be attempted.
When attempt is called with a Callable then
Callable.call() is run attempts times before throwing a
RiakRetryFailedException. It is important to note that there is no
backoff between attempts.
| Constructor Summary | |
|---|---|
DefaultRetrier(int attempts)
|
|
| Method Summary | ||
|---|---|---|
|
attempt(Callable<T> command)
Called by RiakOperation execute methods to give some measure of fault tolerance. |
|
static
|
attempt(Callable<T> command,
int times)
Calls Callable.call() times before giving up and
throwing a RiakRetryFailedException There is no back off. |
|
static Retrier |
attempts(int attempts)
Static factory method to create a default retrier |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultRetrier(int attempts)
attempts - how many times the retrier should attempt the call before
throwing a RiakRetryFailedException| Method Detail |
|---|
public <T> T attempt(Callable<T> command)
throws RiakRetryFailedException
RetrierRiakOperation execute methods to give some measure of fault tolerance.
attempt in interface RetrierT - the Type the Callable.call() returnscommand - the Callable
Callable.call()
RiakRetryFailedException - if the retrier exceeds its bounds.
public static <T> T attempt(Callable<T> command,
int times)
throws RiakRetryFailedException
Callable.call() times before giving up and
throwing a RiakRetryFailedException There is no back off.
T - the Callable's return type.command - the Callable to attempttimes - how many times to try before we throw
RiakRetryFailedException - if the Callable throws an exception times timespublic static Retrier attempts(int attempts)
attempts - how many times the DefaultRetrier will attempt to call
a Callable supplied to
Retrier.attempt(Callable)
DefaultRetrier configured for attempts
retries
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||