org.apache.hadoop.hbase.client
Class ConnectionUtils

java.lang.Object
  extended by org.apache.hadoop.hbase.client.ConnectionUtils

@InterfaceAudience.Private
public class ConnectionUtils
extends Object

Utility used by client connections.


Constructor Summary
ConnectionUtils()
           
 
Method Summary
static long addJitter(long pause, float jitter)
          Adds / subs a 10% jitter to a pause time.
static long getPauseTime(long pause, int tries)
          Calculate pause time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionUtils

public ConnectionUtils()
Method Detail

getPauseTime

public static long getPauseTime(long pause,
                                int tries)
Calculate pause time. Built on HConstants.RETRY_BACKOFF.

Parameters:
pause -
tries -
Returns:
How long to wait after tries retries

addJitter

public static long addJitter(long pause,
                             float jitter)
Adds / subs a 10% jitter to a pause time. Minimum is 1.

Parameters:
pause - the expected pause.
jitter - the jitter ratio, between 0 and 1, exclusive.


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.