本文整理汇总了Java中org.apache.hadoop.hbase.io.hfile.BlockType.BlockCategory.expectSpecific方法的典型用法代码示例。如果您正苦于以下问题:Java BlockCategory.expectSpecific方法的具体用法?Java BlockCategory.expectSpecific怎么用?Java BlockCategory.expectSpecific使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.io.hfile.BlockType.BlockCategory
的用法示例。
在下文中一共展示了BlockCategory.expectSpecific方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateOnCacheHit
import org.apache.hadoop.hbase.io.hfile.BlockType.BlockCategory; //导入方法依赖的package包/类
/**
* Updates the number of hits and the total number of block reads on a block
* cache hit.
*/
public void updateOnCacheHit(BlockCategory blockCategory,
boolean isCompaction, long count) {
blockCategory.expectSpecific();
int idx = getCacheHitMetricIndex(blockCategory, isCompaction);
if (this.onHitCacheMetrics.addAndGet(idx, count) > THRESHOLD_METRICS_FLUSH) {
flushCertainOnCacheHitMetrics(blockCategory, isCompaction);
}
if (this != ALL_SCHEMA_METRICS) {
ALL_SCHEMA_METRICS.updateOnCacheHit(blockCategory, isCompaction, count);
}
}
示例2: updateOnCacheMiss
import org.apache.hadoop.hbase.io.hfile.BlockType.BlockCategory; //导入方法依赖的package包/类
/**
* Updates read time, the number of misses, and the total number of block
* reads on a block cache miss.
*/
public void updateOnCacheMiss(BlockCategory blockCategory,
boolean isCompaction, long timeMs) {
blockCategory.expectSpecific();
addToReadTime(blockCategory, isCompaction, timeMs);
incrNumericMetric(blockCategory, isCompaction, BlockMetricType.CACHE_MISS);
incrNumericMetric(blockCategory, isCompaction, BlockMetricType.READ_COUNT);
if (this != ALL_SCHEMA_METRICS) {
ALL_SCHEMA_METRICS.updateOnCacheMiss(blockCategory, isCompaction,
timeMs);
}
}