Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test case for hbase-27995 #5343

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,15 @@ public void testReaderWithLruCombinedBlockCache() throws Exception {
testReaderCombinedCache("LRU");
}

/**
* Tet case for HBASE-27995
*/
@Test
public void testReaderWithAdaptiveLruCombinedBlockCacheWithHardCapacityLimit() throws Exception {
conf.setDouble(LruAdaptiveBlockCache.LRU_HARD_CAPACITY_LIMIT_FACTOR_CONFIG_NAME, -0.4921875);
testReaderWithAdaptiveLruCombinedBlockCache();
}

private void testReaderCombinedCache(final String l1CachePolicy) throws Exception {
int bufCount = 1024;
int blockSize = 64 * 1024;
Expand Down Expand Up @@ -1049,7 +1058,9 @@ private void testReaderCombinedCache(final String l1CachePolicy) throws Exceptio
Assert.assertFalse(hfb.isSharedMem());
}
} finally {
cachedBlock.release();
if (null != cachedBlock) {
cachedBlock.release();
}
}
block.release(); // return back the ByteBuffer back to allocator.
}
Expand Down