Java 类org.apache.hadoop.hbase.io.hfile.CachedBlock.BlockPriority 实例源码

项目:HIndex    文件:LruBlockCache.java   
/**
 * Evict the block, and it will be cached by the victim handler if exists &&
 * block may be read again later
 * @param block
 * @param evictedByEvictionProcess true if the given block is evicted by
 *          EvictionThread
 * @return the heap size of evicted block
 */
protected long evictBlock(CachedBlock block, boolean evictedByEvictionProcess) {
  map.remove(block.getCacheKey());
  updateSizeMetrics(block, true);
  elements.decrementAndGet();
  stats.evicted();
  if (evictedByEvictionProcess && victimHandler != null) {
    boolean wait = getCurrentSize() < acceptableSize();
    boolean inMemory = block.getPriority() == BlockPriority.MEMORY;
    victimHandler.cacheBlockWithWait(block.getCacheKey(), block.getBuffer(),
        inMemory, wait);
  }
  return block.heapSize();
}
项目:PyroDB    文件:LruBlockCache.java   
/**
 * Evict the block, and it will be cached by the victim handler if exists &&
 * block may be read again later
 * @param block
 * @param evictedByEvictionProcess true if the given block is evicted by
 *          EvictionThread
 * @return the heap size of evicted block
 */
protected long evictBlock(CachedBlock block, boolean evictedByEvictionProcess) {
  map.remove(block.getCacheKey());
  updateSizeMetrics(block, true);
  elements.decrementAndGet();
  stats.evicted();
  if (evictedByEvictionProcess && victimHandler != null) {
    boolean wait = getCurrentSize() < acceptableSize();
    boolean inMemory = block.getPriority() == BlockPriority.MEMORY;
    victimHandler.cacheBlockWithWait(block.getCacheKey(), block.getBuffer(),
        inMemory, wait);
  }
  return block.heapSize();
}
项目:c5    文件:LruBlockCache.java   
/**
 * Evict the block, and it will be cached by the victim handler if exists &&
 * block may be read again later
 * @param block
 * @param evictedByEvictionProcess true if the given block is evicted by
 *          EvictionThread
 * @return the heap size of evicted block
 */
protected long evictBlock(CachedBlock block, boolean evictedByEvictionProcess) {
  map.remove(block.getCacheKey());
  updateSizeMetrics(block, true);
  elements.decrementAndGet();
  stats.evicted();
  if (evictedByEvictionProcess && victimHandler != null) {
    boolean wait = getCurrentSize() < acceptableSize();
    boolean inMemory = block.getPriority() == BlockPriority.MEMORY;
    victimHandler.cacheBlockWithWait(block.getCacheKey(), block.getBuffer(),
        inMemory, wait);
  }
  return block.heapSize();
}
项目:DominoHBase    文件:LruBlockCache.java   
/**
 * Evict the block, and it will be cached by the victim handler if exists &&
 * block may be read again later
 * @param block
 * @param evictedByEvictionProcess true if the given block is evicted by
 *          EvictionThread
 * @return the heap size of evicted block
 */
protected long evictBlock(CachedBlock block, boolean evictedByEvictionProcess) {
  map.remove(block.getCacheKey());
  updateSizeMetrics(block, true);
  elements.decrementAndGet();
  stats.evicted();
  if (evictedByEvictionProcess && victimHandler != null) {
    boolean wait = getCurrentSize() < acceptableSize();
    boolean inMemory = block.getPriority() == BlockPriority.MEMORY;
    victimHandler.cacheBlockWithWait(block.getCacheKey(), block.getBuffer(),
        inMemory, wait);
  }
  return block.heapSize();
}