当前位置: 首页>>代码示例>>Java>>正文


Java CacheTestUtils类代码示例

本文整理汇总了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());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:28,代码来源:TestBucketCache.java

示例2: testCacheSimple

import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testCacheSimple() throws Exception {
  CacheTestUtils.testCacheSimple(cache, BLOCK_SIZE, NUM_QUERIES);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:TestBucketCache.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:TestBucketCache.java

示例4: testHeapSizeChanges

import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testHeapSizeChanges() throws Exception {
  cache.stopWriterThreads();
  CacheTestUtils.testHeapSizeChanges(cache, BLOCK_SIZE);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:6,代码来源:TestBucketCache.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:6,代码来源:TestSlabCache.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:5,代码来源:TestSlabCache.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:5,代码来源:TestSlabCache.java

示例8: testHeapSizeChanges

import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; //导入依赖的package包/类
@Test
public void testHeapSizeChanges(){
  CacheTestUtils.testHeapSizeChanges(cache, BLOCK_SIZE);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:5,代码来源:TestSlabCache.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:6,代码来源:TestSingleSizeCache.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:5,代码来源:TestSingleSizeCache.java


注:本文中的org.apache.hadoop.hbase.io.hfile.CacheTestUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。