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


Java ClassSize.CONCURRENT_HASHMAP_SEGMENT属性代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.util.ClassSize.CONCURRENT_HASHMAP_SEGMENT属性的典型用法代码示例。如果您正苦于以下问题:Java ClassSize.CONCURRENT_HASHMAP_SEGMENT属性的具体用法?Java ClassSize.CONCURRENT_HASHMAP_SEGMENT怎么用?Java ClassSize.CONCURRENT_HASHMAP_SEGMENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hbase.util.ClassSize的用法示例。


在下文中一共展示了ClassSize.CONCURRENT_HASHMAP_SEGMENT属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculateOverhead

public static long calculateOverhead(long maxSize, long blockSize, int concurrency){
  // FindBugs ICAST_INTEGER_MULTIPLY_CAST_TO_LONG
  return CACHE_FIXED_OVERHEAD + ClassSize.CONCURRENT_HASHMAP +
      ((long)Math.ceil(maxSize*1.2/blockSize)
          * ClassSize.CONCURRENT_HASHMAP_ENTRY) +
      (concurrency * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:LruBlockCache.java

示例2: calculateOverhead

public static long calculateOverhead(long maxSize, long blockSize, int concurrency){
  // FindBugs ICAST_INTEGER_MULTIPLY_CAST_TO_LONG
  return CACHE_FIXED_OVERHEAD + ClassSize.CONCURRENT_HASHMAP +
      ((long)Math.ceil(maxSize*1.2/blockSize)
          * ClassSize.CONCURRENT_HASHMAP_ENTRY) +
      ((long)concurrency * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:LruBlockCache.java

示例3: calculateBlockSize

private long calculateBlockSize(long maxSize, int numBlocks) {
  long roughBlockSize = maxSize / numBlocks;
  int numEntries = (int)Math.ceil((1.2)*maxSize/roughBlockSize);
  long totalOverhead = LruBlockCache.CACHE_FIXED_OVERHEAD +
      ClassSize.CONCURRENT_HASHMAP +
      (numEntries * ClassSize.CONCURRENT_HASHMAP_ENTRY) +
      (LruBlockCache.DEFAULT_CONCURRENCY_LEVEL * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
  long negateBlockSize = (long)(totalOverhead/numEntries);
  negateBlockSize += LruCachedBlock.PER_BLOCK_OVERHEAD;
  return ClassSize.align((long)Math.floor((roughBlockSize - negateBlockSize)*0.99f));
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:TestLruBlockCache.java

示例4: calculateBlockSizeDefault

private long calculateBlockSizeDefault(long maxSize, int numBlocks) {
  long roughBlockSize = maxSize / numBlocks;
  int numEntries = (int)Math.ceil((1.2)*maxSize/roughBlockSize);
  long totalOverhead = LruBlockCache.CACHE_FIXED_OVERHEAD +
      ClassSize.CONCURRENT_HASHMAP +
      (numEntries * ClassSize.CONCURRENT_HASHMAP_ENTRY) +
      (LruBlockCache.DEFAULT_CONCURRENCY_LEVEL * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
  long negateBlockSize = totalOverhead / numEntries;
  negateBlockSize += LruCachedBlock.PER_BLOCK_OVERHEAD;
  return ClassSize.align((long)Math.floor((roughBlockSize - negateBlockSize)*
      LruBlockCache.DEFAULT_ACCEPTABLE_FACTOR));
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:TestLruBlockCache.java

示例5: calculateBlockSize

private long calculateBlockSize(long maxSize, int numBlocks) {
  long roughBlockSize = maxSize / numBlocks;
  int numEntries = (int)Math.ceil((1.2)*maxSize/roughBlockSize);
  long totalOverhead = LruBlockCache.CACHE_FIXED_OVERHEAD +
      ClassSize.CONCURRENT_HASHMAP +
      (numEntries * ClassSize.CONCURRENT_HASHMAP_ENTRY) +
      (LruBlockCache.DEFAULT_CONCURRENCY_LEVEL * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
  long negateBlockSize = (long)(totalOverhead/numEntries);
  negateBlockSize += CachedBlock.PER_BLOCK_OVERHEAD;
  return ClassSize.align((long)Math.floor((roughBlockSize - negateBlockSize)*0.99f));
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:11,代码来源:TestLruBlockCache.java

示例6: calculateBlockSizeDefault

private long calculateBlockSizeDefault(long maxSize, int numBlocks) {
  long roughBlockSize = maxSize / numBlocks;
  int numEntries = (int)Math.ceil((1.2)*maxSize/roughBlockSize);
  long totalOverhead = LruBlockCache.CACHE_FIXED_OVERHEAD +
      ClassSize.CONCURRENT_HASHMAP +
      (numEntries * ClassSize.CONCURRENT_HASHMAP_ENTRY) +
      (LruBlockCache.DEFAULT_CONCURRENCY_LEVEL * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
  long negateBlockSize = totalOverhead / numEntries;
  negateBlockSize += CachedBlock.PER_BLOCK_OVERHEAD;
  return ClassSize.align((long)Math.floor((roughBlockSize - negateBlockSize)*
      LruBlockCache.DEFAULT_ACCEPTABLE_FACTOR));
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:12,代码来源:TestLruBlockCache.java

示例7: calculateOverhead

private static long calculateOverhead(long maxSize, long blockSize, int concurrency) {
  // FindBugs ICAST_INTEGER_MULTIPLY_CAST_TO_LONG
  return CACHE_FIXED_OVERHEAD + ClassSize.CONCURRENT_HASHMAP
         + ((long) Math.ceil(maxSize * 1.2 / blockSize) * ClassSize.CONCURRENT_HASHMAP_ENTRY)
         + ((long) concurrency * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
}
 
开发者ID:apache,项目名称:hbase,代码行数:6,代码来源:LruBlockCache.java

示例8: calculateOverhead

/**
 * Calculate overhead.
 *
 * @param maxSize the max size
 * @param blockSize the block size
 * @param concurrency the concurrency
 * @return the long
 */
public static long calculateOverhead(long maxSize, long blockSize, int concurrency){
  // FindBugs ICAST_INTEGER_MULTIPLY_CAST_TO_LONG
  return CACHE_FIXED_OVERHEAD + ClassSize.CONCURRENT_HASHMAP +
      ((long)Math.ceil(maxSize*1.2/blockSize)
          * ClassSize.CONCURRENT_HASHMAP_ENTRY) +
      (concurrency * ClassSize.CONCURRENT_HASHMAP_SEGMENT);
}
 
开发者ID:VladRodionov,项目名称:bigbase,代码行数:15,代码来源:OnHeapBlockCache.java


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