From 8c26d4e9e086d0d1277039224c92eec2adefedf3 Mon Sep 17 00:00:00 2001 From: hfutatzhanghb Date: Fri, 5 Jan 2024 06:31:53 +0800 Subject: [PATCH] HDFS-17322. Renames RetryCache#MAX_CAPACITY to be MIN_CAPACITY to fit usage. --- .../src/main/java/org/apache/hadoop/ipc/RetryCache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 624cc08ac2..83c0c94032 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,7 +46,7 @@ public class RetryCache { public static final Logger LOG = LoggerFactory.getLogger(RetryCache.class); private final RetryCacheMetrics retryCacheMetrics; - private static final int MAX_CAPACITY = 16; + private static final int MIN_CAPACITY = 16; /** * CacheEntry is tracked using unique client ID and callId of the RPC request. @@ -195,7 +195,7 @@ public Object getPayload() { */ public RetryCache(String cacheName, double percentage, long expirationTime) { int capacity = LightWeightGSet.computeCapacity(percentage, cacheName); - capacity = Math.max(capacity, MAX_CAPACITY); + capacity = Math.max(capacity, MIN_CAPACITY); this.set = new LightWeightCache(capacity, capacity, expirationTime, 0); this.expirationTime = expirationTime;