hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject hadoop git commit: HADOOP-9822. create constant MAX_CAPACITY in RetryCache rather than hard-coding 16 in RetryCache constructor. Contributed by Tsuyoshi Ozawa.
Date Mon, 23 Nov 2015 21:23:22 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 9d303edbf -> 1cdf422ba


HADOOP-9822. create constant MAX_CAPACITY in RetryCache rather than hard-coding 16 in RetryCache
constructor. Contributed by Tsuyoshi Ozawa.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1cdf422b
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1cdf422b
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1cdf422b

Branch: refs/heads/branch-2
Commit: 1cdf422ba828af2f4a8f492ce5de083b20ebb468
Parents: 9d303ed
Author: Haohui Mai <wheat9@apache.org>
Authored: Mon Nov 23 13:22:20 2015 -0800
Committer: Haohui Mai <wheat9@apache.org>
Committed: Mon Nov 23 13:23:14 2015 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt                | 6 ++++++
 .../src/main/java/org/apache/hadoop/ipc/RetryCache.java        | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1cdf422b/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 49a8c17..40c4170 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -731,6 +731,12 @@ Release 2.8.0 - UNRELEASED
 
     HADOOP-8419. Fixed GzipCode NPE reset for IBM JDK. (Yu Li via eyang)
 
+    HADOOP-11149. TestZKFailoverController times out. (Steve Loughran
+    via ozawa)
+
+    HADOOP-9822. Create constant MAX_CAPACITY in RetryCache rather than
+    hard-coding 16 in RetryCache constructor. (Tsuyoshi Ozawa via wheat9)
+
   OPTIMIZATIONS
 
     HADOOP-12051. ProtobufRpcEngine.invoke() should use Exception.toString()

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1cdf422b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RetryCache.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RetryCache.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RetryCache.java
index d35ed95..7b85286 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RetryCache.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RetryCache.java
@@ -46,6 +46,7 @@ import com.google.common.base.Preconditions;
 public class RetryCache {
   public static final Log LOG = LogFactory.getLog(RetryCache.class);
   private final RetryCacheMetrics retryCacheMetrics;
+  private static final int MAX_CAPACITY = 16;
 
   /**
    * CacheEntry is tracked using unique client ID and callId of the RPC request
@@ -194,7 +195,7 @@ public class RetryCache {
    */
   public RetryCache(String cacheName, double percentage, long expirationTime) {
     int capacity = LightWeightGSet.computeCapacity(percentage, cacheName);
-    capacity = capacity > 16 ? capacity : 16;
+    capacity = capacity > MAX_CAPACITY ? capacity : MAX_CAPACITY;
     this.set = new LightWeightCache<CacheEntry, CacheEntry>(capacity, capacity,
         expirationTime, 0);
     this.expirationTime = expirationTime;


Mime
View raw message