|
@@ -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;
|