org.apache.hadoop.hbase.util
Class RetryCounter

java.lang.Object
  extended by org.apache.hadoop.hbase.util.RetryCounter

@InterfaceAudience.Private
public class RetryCounter
extends Object


Nested Class Summary
static class RetryCounter.BackoffPolicy
          Policy for calculating sleeping intervals between retry attempts
static class RetryCounter.ExponentialBackoffPolicy
           
static class RetryCounter.ExponentialBackoffPolicyWithLimit
           
static class RetryCounter.RetryConfig
          Configuration for a retry counter
 
Constructor Summary
RetryCounter(int maxAttempts, long sleepInterval, TimeUnit timeUnit)
           
RetryCounter(RetryCounter.RetryConfig retryConfig)
           
 
Method Summary
 int getAttemptTimes()
           
 int getMaxAttempts()
           
 boolean isRetry()
           
 boolean shouldRetry()
           
 void sleepUntilNextRetry()
          Sleep for a back off time as supplied by the backoff policy, and increases the attempts
 void useRetry()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryCounter

public RetryCounter(int maxAttempts,
                    long sleepInterval,
                    TimeUnit timeUnit)

RetryCounter

public RetryCounter(RetryCounter.RetryConfig retryConfig)
Method Detail

getMaxAttempts

public int getMaxAttempts()

sleepUntilNextRetry

public void sleepUntilNextRetry()
                         throws InterruptedException
Sleep for a back off time as supplied by the backoff policy, and increases the attempts

Throws:
InterruptedException

shouldRetry

public boolean shouldRetry()

useRetry

public void useRetry()

isRetry

public boolean isRetry()

getAttemptTimes

public int getAttemptTimes()


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.