本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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);
}
示例5: getBlockCacheColumnFamilySummaries
import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
@Override
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(
Configuration conf) {
throw new UnsupportedOperationException();
}
示例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);
}
示例7: getBlockCacheColumnFamilySummaries
import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; //导入依赖的package包/类
@Override
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(Configuration conf)
throws IOException {
return null;
}