-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26809: Report client backoff time for server overloaded #4786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
140878e
30aa833
45ad745
5b1835e
d362c48
76c763d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,17 +33,20 @@ public class RpcRetryingCallerFactory { | |
| private final ConnectionConfiguration connectionConf; | ||
| private final RetryingCallerInterceptor interceptor; | ||
| private final int startLogErrorsCnt; | ||
| private final MetricsConnection metrics; | ||
|
|
||
| public RpcRetryingCallerFactory(Configuration conf) { | ||
| this(conf, RetryingCallerInterceptorFactory.NO_OP_INTERCEPTOR); | ||
| this(conf, RetryingCallerInterceptorFactory.NO_OP_INTERCEPTOR, null); | ||
| } | ||
|
|
||
| public RpcRetryingCallerFactory(Configuration conf, RetryingCallerInterceptor interceptor) { | ||
| public RpcRetryingCallerFactory(Configuration conf, RetryingCallerInterceptor interceptor, | ||
| MetricsConnection metrics) { | ||
| this.conf = conf; | ||
| this.connectionConf = new ConnectionConfiguration(conf); | ||
| startLogErrorsCnt = conf.getInt(AsyncProcess.START_LOG_ERRORS_AFTER_COUNT_KEY, | ||
| AsyncProcess.DEFAULT_START_LOG_ERRORS_AFTER_COUNT); | ||
| this.interceptor = interceptor; | ||
| this.metrics = metrics; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -54,7 +57,7 @@ public <T> RpcRetryingCaller<T> newCaller(int rpcTimeout) { | |
| // is cheap as it does not require parsing a complex structure. | ||
| return new RpcRetryingCallerImpl<>(connectionConf.getPauseMillis(), | ||
| connectionConf.getPauseMillisForServerOverloaded(), connectionConf.getRetriesNumber(), | ||
| interceptor, startLogErrorsCnt, rpcTimeout); | ||
| interceptor, startLogErrorsCnt, rpcTimeout, metrics); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -65,26 +68,29 @@ public <T> RpcRetryingCaller<T> newCaller() { | |
| // is cheap as it does not require parsing a complex structure. | ||
| return new RpcRetryingCallerImpl<>(connectionConf.getPauseMillis(), | ||
| connectionConf.getPauseMillisForServerOverloaded(), connectionConf.getRetriesNumber(), | ||
| interceptor, startLogErrorsCnt, connectionConf.getRpcTimeout()); | ||
| interceptor, startLogErrorsCnt, connectionConf.getRpcTimeout(), metrics); | ||
| } | ||
|
|
||
| public static RpcRetryingCallerFactory instantiate(Configuration configuration) { | ||
|
||
| return instantiate(configuration, RetryingCallerInterceptorFactory.NO_OP_INTERCEPTOR, null); | ||
| return instantiate(configuration, RetryingCallerInterceptorFactory.NO_OP_INTERCEPTOR, null, | ||
| null); | ||
| } | ||
|
|
||
| public static RpcRetryingCallerFactory instantiate(Configuration configuration, | ||
| ServerStatisticTracker stats) { | ||
| return instantiate(configuration, RetryingCallerInterceptorFactory.NO_OP_INTERCEPTOR, stats); | ||
| return instantiate(configuration, RetryingCallerInterceptorFactory.NO_OP_INTERCEPTOR, stats, | ||
| null); | ||
| } | ||
|
|
||
| public static RpcRetryingCallerFactory instantiate(Configuration configuration, | ||
| RetryingCallerInterceptor interceptor, ServerStatisticTracker stats) { | ||
| RetryingCallerInterceptor interceptor, ServerStatisticTracker stats, | ||
| MetricsConnection metrics) { | ||
| String clazzName = RpcRetryingCallerFactory.class.getName(); | ||
| String rpcCallerFactoryClazz = | ||
| configuration.get(RpcRetryingCallerFactory.CUSTOM_CALLER_CONF_KEY, clazzName); | ||
| RpcRetryingCallerFactory factory; | ||
| if (rpcCallerFactoryClazz.equals(clazzName)) { | ||
| factory = new RpcRetryingCallerFactory(configuration, interceptor); | ||
| factory = new RpcRetryingCallerFactory(configuration, interceptor, metrics); | ||
| } else { | ||
| factory = ReflectionUtils.instantiateWithCustomCtor(rpcCallerFactoryClazz, | ||
| new Class[] { Configuration.class }, new Object[] { configuration }); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.