@InterfaceAudience.Private public final class ConnectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.hbase.client.ScanResultCache |
createScanResultCache(Scan scan) |
static long |
getPauseTime(long pause,
int tries)
Calculate pause time.
|
static NonceGenerator |
injectNonceGeneratorForTesting(ClusterConnection conn,
NonceGenerator cnm)
Inject a nonce generator for testing.
|
static void |
setServerSideHConnectionRetriesConfig(org.apache.hadoop.conf.Configuration c,
String sn,
org.slf4j.Logger log)
Changes the configuration to set the number of retries needed when using Connection internally,
e.g.
|
static void |
setupMasterlessConnection(org.apache.hadoop.conf.Configuration conf)
Setup the connection class, so that it will not depend on master being online.
|
public static long getPauseTime(long pause, int tries)
HConstants.RETRY_BACKOFF
.pause
- time to pausetries
- amount of triestries
retriespublic static NonceGenerator injectNonceGeneratorForTesting(ClusterConnection conn, NonceGenerator cnm)
conn
- The connection for which to replace the generator.cnm
- Replaces the nonce generator used, for testing.public static void setServerSideHConnectionRetriesConfig(org.apache.hadoop.conf.Configuration c, String sn, org.slf4j.Logger log)
c
- The Configuration instance to set the retries into.log
- Used to log what we set in here.public static void setupMasterlessConnection(org.apache.hadoop.conf.Configuration conf)
conf
- configuration to setpublic static org.apache.hadoop.hbase.client.ScanResultCache createScanResultCache(Scan scan)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.