From 0d39107035e7e8671623ac7b82a66d1505085854 Mon Sep 17 00:00:00 2001 From: MOMO Date: Tue, 13 Aug 2019 12:53:59 +0800 Subject: [PATCH] MemcachedBlockCache Bug Fix --- .../hadoop/hbase/io/hfile/MemcachedBlockCache.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java b/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java index f4e9621d20..460abbb3db 100644 --- a/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java +++ b/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java @@ -52,9 +52,8 @@ import java.util.concurrent.ExecutionException; public class MemcachedBlockCache implements BlockCache { private static final Log LOG = LogFactory.getLog(MemcachedBlockCache.class.getName()); - // Some memcache versions won't take more than 1024 * 1024. So set the limit below - // that just in case this client is used with those versions. - public static final int MAX_SIZE = 1020 * 1024; + // 0 means never expire. + public static final int EXPIRATION = 0; // Config key for what memcached servers to use. // They should be specified in a comma sperated list with ports. @@ -115,7 +114,7 @@ public class MemcachedBlockCache implements BlockCache { @Override public void cacheBlock(BlockCacheKey cacheKey, Cacheable buf) { if (buf instanceof HFileBlock) { - client.add(cacheKey.toString(), MAX_SIZE, (HFileBlock) buf, tc); + client.add(cacheKey.toString(), EXPIRATION, (HFileBlock) buf, tc); } else { if (LOG.isDebugEnabled()) { LOG.debug("MemcachedBlockCache can not cache Cacheable's of type " @@ -279,7 +278,7 @@ public class MemcachedBlockCache implements BlockCache { @Override public int getMaxSize() { - return MAX_SIZE; + return CachedData.MAX_SIZE; } } -- 2.17.2 (Apple Git-113)