HDFS-17322. Renames RetryCache#MAX_CAPACITY to be MIN_CAPACITY to fit usage.
This commit is contained in:
parent
d5468d84ba
commit
8c26d4e9e0
@ -46,7 +46,7 @@
|
|||||||
public class RetryCache {
|
public class RetryCache {
|
||||||
public static final Logger LOG = LoggerFactory.getLogger(RetryCache.class);
|
public static final Logger LOG = LoggerFactory.getLogger(RetryCache.class);
|
||||||
private final RetryCacheMetrics retryCacheMetrics;
|
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.
|
* 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) {
|
public RetryCache(String cacheName, double percentage, long expirationTime) {
|
||||||
int capacity = LightWeightGSet.computeCapacity(percentage, cacheName);
|
int capacity = LightWeightGSet.computeCapacity(percentage, cacheName);
|
||||||
capacity = Math.max(capacity, MAX_CAPACITY);
|
capacity = Math.max(capacity, MIN_CAPACITY);
|
||||||
this.set = new LightWeightCache<CacheEntry, CacheEntry>(capacity, capacity,
|
this.set = new LightWeightCache<CacheEntry, CacheEntry>(capacity, capacity,
|
||||||
expirationTime, 0);
|
expirationTime, 0);
|
||||||
this.expirationTime = expirationTime;
|
this.expirationTime = expirationTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user