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


Java BlockCacheColumnFamilySummary类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary的典型用法代码示例。如果您正苦于以下问题:Java BlockCacheColumnFamilySummary类的具体用法?Java BlockCacheColumnFamilySummary怎么用?Java BlockCacheColumnFamilySummary使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testBlockCacheSummary

import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
/**
 * This test inserts data into multiple tables and then reads both tables to ensure
 * they are in the block cache.
 *
 * @throws Exception exception
 */
@Test
public void testBlockCacheSummary() throws Exception {
  HTable ht = TEST_UTIL.createTable(Bytes.toBytes(TEST_TABLE), FAMILY);
  addRows(ht, FAMILY);

  HTable ht2 = TEST_UTIL.createTable(Bytes.toBytes(TEST_TABLE2), FAMILY);
  addRows(ht2, FAMILY);

  TEST_UTIL.flush();
  
  scan(ht, FAMILY);
  scan(ht2, FAMILY);
     
  BlockCache bc =
    new CacheConfig(TEST_UTIL.getConfiguration()).getBlockCache();
  List<BlockCacheColumnFamilySummary> bcs = 
    bc.getBlockCacheColumnFamilySummaries(TEST_UTIL.getConfiguration());
  LOG.info("blockCacheSummary: " + bcs);

  assertEquals("blockCache summary has entries", 3, bcs.size());
  
  BlockCacheColumnFamilySummary e = bcs.get(0);
  assertEquals("table", "-ROOT-", e.getTable());
  assertEquals("cf", "info", e.getColumnFamily());

  e = bcs.get(1);
  assertEquals("table", TEST_TABLE, e.getTable());
  assertEquals("cf", TEST_CF, e.getColumnFamily());

  e = bcs.get(2);
  assertEquals("table", TEST_TABLE2, e.getTable());
  assertEquals("cf", TEST_CF, e.getColumnFamily());

  ht.close();
  ht2.close();
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:43,代码来源:TestStoreFileBlockCacheSummary.java

示例2: testBlockCacheSummary

import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
/**
 * This test inserts data into multiple tables and then reads both tables to ensure
 * they are in the block cache.
 *
 * @throws Exception exception
 */
@Test
public void testBlockCacheSummary() throws Exception {
  HTable ht = TEST_UTIL.createTable(Bytes.toBytes(TEST_TABLE), FAMILY);
  addRows(ht, FAMILY);

  HTable ht2 = TEST_UTIL.createTable(Bytes.toBytes(TEST_TABLE2), FAMILY);
  addRows(ht2, FAMILY);

  TEST_UTIL.flush();
  
  scan(ht, FAMILY);
  scan(ht2, FAMILY);
     
  BlockCache bc =
    new CacheConfig(TEST_UTIL.getConfiguration()).getBlockCache();
  List<BlockCacheColumnFamilySummary> bcs = 
    bc.getBlockCacheColumnFamilySummaries(TEST_UTIL.getConfiguration());
  LOG.info("blockCacheSummary: " + bcs);

  assertTrue("blockCache summary has " + bcs.size() + " entries", bcs.size() >= 2);

  BlockCacheColumnFamilySummary e = bcs.get(bcs.size()-2);
  assertEquals("table", TEST_TABLE, e.getTable());
  assertEquals("cf", TEST_CF, e.getColumnFamily());

  e = bcs.get(bcs.size()-1);
  assertEquals("table", TEST_TABLE2, e.getTable());
  assertEquals("cf", TEST_CF, e.getColumnFamily());

  ht.close();
  ht2.close();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:39,代码来源:TestStoreFileBlockCacheSummary.java

示例3: getBlockCacheColumnFamilySummaries

import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
@Override
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(Configuration conf) throws IOException {

  Map<String, Path> sfMap = FSUtils.getTableStoreFilePathMap(
      FileSystem.get(conf),
      FSUtils.getRootDir(conf));

  // quirky, but it's a compound key and this is a shortcut taken instead of
  // creating a class that would represent only a key.
  Map<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary> bcs =
    new HashMap<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary>();

  for (CachedBlock cb : map.values()) {
    String sf = cb.getCacheKey().getHfileName();
    Path path = sfMap.get(sf);
    if ( path != null) {
      BlockCacheColumnFamilySummary lookup =
        BlockCacheColumnFamilySummary.createFromStoreFilePath(path);
      BlockCacheColumnFamilySummary bcse = bcs.get(lookup);
      if (bcse == null) {
        bcse = BlockCacheColumnFamilySummary.create(lookup);
        bcs.put(lookup,bcse);
      }
      bcse.incrementBlocks();
      bcse.incrementHeapSize(cb.heapSize());
    }
  }
  List<BlockCacheColumnFamilySummary> list =
      new ArrayList<BlockCacheColumnFamilySummary>(bcs.values());
  Collections.sort( list );
  return list;
}
 
开发者ID:VladRodionov,项目名称:bigbase,代码行数:33,代码来源:OnHeapBlockCache.java

示例4: getBlockCacheColumnFamilySummaries

import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
@Override
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries()
    throws IOException {
  BlockCache c = new CacheConfig(this.conf).getBlockCache();
  return c.getBlockCacheColumnFamilySummaries(this.conf);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:7,代码来源:HRegionServer.java

示例5: getBlockCacheColumnFamilySummaries

import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
@Override
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(
    Configuration conf) {
  throw new UnsupportedOperationException();
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:6,代码来源:SingleSizeCache.java

示例6: getBlockCacheColumnFamilySummaries

import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
@Override
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries() throws IOException {
  BlockCache c = new CacheConfig(this.conf).getBlockCache();
  return c.getBlockCacheColumnFamilySummaries(this.conf);
}
 
开发者ID:wanhao,项目名称:IRIndex,代码行数:6,代码来源:HRegionServer.java

示例7: getBlockCacheColumnFamilySummaries

import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
@Override
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(Configuration conf)
    throws IOException {
  return null;
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:6,代码来源:TestHeapMemoryManager.java


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