You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2015/03/23 23:23:23 UTC
[38/44] hbase git commit: HBASE-13286 Minimum timeout for a rpc call
could be 1 ms instead of 2 seconds
HBASE-13286 Minimum timeout for a rpc call could be 1 ms instead of 2 seconds
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6d446034
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6d446034
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6d446034
Branch: refs/heads/hbase-12439
Commit: 6d4460341e0d44bfb574180369748e17fbe5f5a1
Parents: 34347a3
Author: Nicolas Liochon <nk...@apache.org>
Authored: Fri Mar 20 19:09:43 2015 +0100
Committer: Nicolas Liochon <nk...@apache.org>
Committed: Fri Mar 20 19:09:43 2015 +0100
----------------------------------------------------------------------
.../hadoop/hbase/client/RpcRetryingCallerImpl.java | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/6d446034/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
index 1d037bc..03138ec 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
@@ -54,10 +54,7 @@ public class RpcRetryingCallerImpl<T> implements RpcRetryingCaller<T> {
* When we started making calls.
*/
private long globalStartTime;
- /**
- * Start and end times for a single call.
- */
- private final static int MIN_RPC_TIMEOUT = 2000;
+
/** How many retries are allowed before we start to log */
private final int startLogErrorsCnt;
@@ -87,11 +84,11 @@ public class RpcRetryingCallerImpl<T> implements RpcRetryingCaller<T> {
if (callTimeout == Integer.MAX_VALUE) return Integer.MAX_VALUE;
int remainingTime = (int) (callTimeout -
(EnvironmentEdgeManager.currentTime() - this.globalStartTime));
- if (remainingTime < MIN_RPC_TIMEOUT) {
+ if (remainingTime < 1) {
// If there is no time left, we're trying anyway. It's too late.
// 0 means no timeout, and it's not the intent here. So we secure both cases by
// resetting to the minimum.
- remainingTime = MIN_RPC_TIMEOUT;
+ remainingTime = 1;
}
return remainingTime;
}
@@ -222,7 +219,7 @@ public class RpcRetryingCallerImpl<T> implements RpcRetryingCaller<T> {
}
// Don't let ServiceException out; its rpc specific.
t = cause;
- // t could be a RemoteException so go aaround again.
+ // t could be a RemoteException so go around again.
translateException(t);
} else if (t instanceof DoNotRetryIOException) {
throw (DoNotRetryIOException)t;