本文整理汇总了Java中org.apache.hadoop.hbase.io.hfile.CacheTestUtils类的典型用法代码示例。如果您正苦于以下问题:Java CacheTestUtils类的具体用法?Java CacheTestUtils怎么用?Java CacheTestUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CacheTestUtils类属于org.apache.hadoop.hbase.io.hfile包,在下文中一共展示了CacheTestUtils类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMemoryLeak
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testMemoryLeak() throws Exception {
final BlockCacheKey cacheKey = new BlockCacheKey("dummy", 1L);
cacheAndWaitUntilFlushedToBucket(cache, cacheKey, new CacheTestUtils.ByteArrayCacheable(
new byte[10]));
long lockId = cache.backingMap.get(cacheKey).offset();
ReentrantReadWriteLock lock = cache.offsetLock.getLock(lockId);
lock.writeLock().lock();
Thread evictThread = new Thread("evict-block") {
@Override
public void run() {
cache.evictBlock(cacheKey);
}
};
evictThread.start();
cache.offsetLock.waitForWaiters(lockId, 1);
cache.blockEvicted(cacheKey, cache.backingMap.remove(cacheKey), true);
cacheAndWaitUntilFlushedToBucket(cache, cacheKey, new CacheTestUtils.ByteArrayCacheable(
new byte[10]));
lock.writeLock().unlock();
evictThread.join();
assertEquals(1L, cache.getBlockCount());
assertTrue(cache.getCurrentSize() > 0L);
assertTrue("We should have a block!", cache.iterator().hasNext());
}
示例2: testCacheSimple
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheSimple() throws Exception {
CacheTestUtils.testCacheSimple(cache, BLOCK_SIZE, NUM_QUERIES);
}
示例3: testCacheMultiThreadedSingleKey
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheMultiThreadedSingleKey() throws Exception {
CacheTestUtils.hammerSingleKey(cache, BLOCK_SIZE, 2 * NUM_THREADS, 2 * NUM_QUERIES);
}
示例4: testHeapSizeChanges
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testHeapSizeChanges() throws Exception {
cache.stopWriterThreads();
CacheTestUtils.testHeapSizeChanges(cache, BLOCK_SIZE);
}
示例5: testCacheMultiThreaded
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheMultiThreaded() throws Exception {
CacheTestUtils.testCacheMultiThreaded(cache, BLOCK_SIZE, NUM_THREADS,
NUM_QUERIES, 0.80);
}
示例6: testCacheMultiThreadedSingleKey
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheMultiThreadedSingleKey() throws Exception {
CacheTestUtils.hammerSingleKey(cache, BLOCK_SIZE, NUM_THREADS, NUM_QUERIES);
}
示例7: testCacheMultiThreadedEviction
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheMultiThreadedEviction() throws Exception {
CacheTestUtils.hammerEviction(cache, BLOCK_SIZE, 10, NUM_QUERIES);
}
示例8: testHeapSizeChanges
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testHeapSizeChanges(){
CacheTestUtils.testHeapSizeChanges(cache, BLOCK_SIZE);
}
示例9: testCacheMultiThreaded
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheMultiThreaded() throws Exception {
CacheTestUtils.testCacheMultiThreaded(cache, BLOCK_SIZE,
NUM_THREADS, NUM_QUERIES, 0.80);
}
示例10: testCacheMultiThreadedEviction
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheMultiThreadedEviction() throws Exception {
CacheTestUtils.hammerEviction(cache, BLOCK_SIZE, NUM_THREADS, NUM_QUERIES);
}