HBASE-8547. Fix java.lang.RuntimeException: Cached an already cached block (Addendum3 to remove assertion)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1484032 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Enis Soztutar 2013-05-18 00:03:48 +00:00
parent aec1857b37
commit 2a5c92c084
2 changed files with 0 additions and 12 deletions

View File

@ -302,7 +302,6 @@ public class LruBlockCache implements BlockCache, HeapSize {
String msg = "Cached an already cached block: " + cacheKey + " cb:" + cb.getCacheKey(); String msg = "Cached an already cached block: " + cacheKey + " cb:" + cb.getCacheKey();
msg += ". This is harmless and can happen in rare cases (see HBASE-8547)"; msg += ". This is harmless and can happen in rare cases (see HBASE-8547)";
LOG.warn(msg); LOG.warn(msg);
assert false : msg;
return; return;
} }
cb = new CachedBlock(cacheKey, buf, count.incrementAndGet(), inMemory); cb = new CachedBlock(cacheKey, buf, count.incrementAndGet(), inMemory);

View File

@ -118,17 +118,6 @@ public class TestLruBlockCache {
assertEquals(buf.heapSize(), block.heapSize()); assertEquals(buf.heapSize(), block.heapSize());
} }
// Re-add same blocks and ensure nothing has changed
for (CachedItem block : blocks) {
try {
cache.cacheBlock(block.cacheKey, block);
assertTrue("Cache should not allow re-caching a block", false);
} catch(AssertionError re) {
// expected
assertTrue(re.getMessage().contains("Cached an already cached block"));
}
}
// Verify correctly calculated cache heap size // Verify correctly calculated cache heap size
assertEquals(expectedCacheSize, cache.heapSize()); assertEquals(expectedCacheSize, cache.heapSize());