Class RetryableThriftCall<T>
- java.lang.Object
-
- org.apache.accumulo.server.compaction.RetryableThriftCall<T>
-
public class RetryableThriftCall<T> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RetryableThriftCall.RetriesExceededException
-
Field Summary
Fields Modifier and Type Field Description static long
MAX_WAIT_TIME
-
Constructor Summary
Constructors Constructor Description RetryableThriftCall(long start, long maxWaitTime, int maxNumRetries, RetryableThriftFunction<T> function)
RetryableThriftCall constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
run()
Attempts to call the function, waiting and retrying when TException is thrown.
-
-
-
Field Detail
-
MAX_WAIT_TIME
public static final long MAX_WAIT_TIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RetryableThriftCall
public RetryableThriftCall(long start, long maxWaitTime, int maxNumRetries, RetryableThriftFunction<T> function)
RetryableThriftCall constructor- Parameters:
start
- initial wait timemaxWaitTime
- max wait timemaxNumRetries
- number of times to retry, 0 to retry foreverfunction
- function to execute
-
-
Method Detail
-
run
public T run() throws RetryableThriftCall.RetriesExceededException
Attempts to call the function, waiting and retrying when TException is thrown. Wait time is initially set to the start time and doubled each time, up to the maximum wait time. If maxNumRetries is 0, then this will retry forever. If maxNumRetries is non-zero, then a RuntimeException is thrown when it has exceeded he maxNumRetries parameter.- Returns:
- T
- Throws:
RetryableThriftCall.RetriesExceededException
- when maximum number of retries has been exceeded and the cause is set to the last TException
-
-