org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmplImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbase-server Show documentation
Show all versions of hbase-server Show documentation
Server functionality for HBase
// Autogenerated Jamon implementation
// /Users/andrewpurtell/src/WORK-hbase/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
package org.apache.hadoop.hbase.tmpl.regionserver;
// 32, 1
import java.util.Map;
// 33, 1
import org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
// 34, 1
import org.apache.hadoop.hbase.io.hfile.AgeSnapshot;
// 35, 1
import org.apache.hadoop.hbase.io.hfile.CachedBlock;
// 36, 1
import org.apache.hadoop.conf.Configuration;
// 37, 1
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
// 38, 1
import org.apache.hadoop.hbase.io.hfile.BlockCache;
// 39, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
// 40, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
// 41, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
// 42, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
// 43, 1
import org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
public class BlockCacheTmplImpl
extends org.jamon.AbstractTemplateImpl
implements org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl.Intf
{
private final CacheConfig cacheConfig;
private final Configuration config;
private final BlockCache bc;
protected static org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl.ImplData p_implData)
{
return p_implData;
}
public BlockCacheTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl.ImplData p_implData)
{
super(p_templateManager, __jamon_setOptionalArguments(p_implData));
cacheConfig = p_implData.getCacheConfig();
config = p_implData.getConfig();
bc = p_implData.getBc();
}
@Override public void renderNoFlush(final java.io.Writer jamonWriter)
throws java.io.IOException
{
// 25, 1
String bcUrl = bc == null ? null : "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html";
String bcName = bc == null ? null : bc.getClass().getSimpleName();
BlockCache [] bcs = bc == null ? null : bc.getBlockCaches();
boolean evictions = bcs != null && bcs.length > 1;
// 45, 1
jamonWriter.write("\n \n \n \n ");
// 55, 13
{
// 55, 13
__jamon_innerUnit__bc_baseInfo(jamonWriter, bc, bcUrl, bcName);
}
// 55, 73
jamonWriter.write("\n \n \n ");
// 58, 13
{
// 58, 13
__jamon_innerUnit__bc_config(jamonWriter, cacheConfig );
}
// 58, 55
jamonWriter.write("\n \n \n ");
// 61, 13
{
// 61, 13
__jamon_innerUnit__bc_stats(jamonWriter, bc );
}
// 61, 36
jamonWriter.write("\n \n \n ");
// 64, 13
{
// 64, 13
__jamon_innerUnit__bc_l(jamonWriter, bcs == null? bc: bcs[0], "L1", evictions);
}
// 64, 90
jamonWriter.write("\n \n \n ");
// 67, 13
{
// 67, 13
__jamon_innerUnit__bc_l(jamonWriter, bcs == null? null: bcs.length <= 1? null: bcs[1], "L2", evictions);
}
// 67, 115
jamonWriter.write("\n \n \n\n\n");
}
// 72, 1
private void __jamon_innerUnit__bc_baseInfo(final java.io.Writer jamonWriter, final BlockCache bc, final String bcUrl, final String bcName)
throws java.io.IOException
{
// 78, 1
BlockCache [] bcs = bc == null? null: bc.getBlockCaches();
String bcl1Url = null;
String bcl1Name = null;
String bcl2Url = null;
String bcl2Name = null;
if (bcs != null) {
BlockCache bcl1 = bcs[0];
if (bcl1 != null) {
bcl1Url = "http://hbase.apache.org/devapidocs/" + bcl1.getClass().getName().replaceAll("\\.", "/") + ".html";
bcl1Name = bcl1.getClass().getSimpleName();
}
if (bcs.length == 2) {
BlockCache bcl2 = bcs[1];
bcl2Url = "http://hbase.apache.org/devapidocs/" + bcl2.getClass().getName().replaceAll("\\.", "/") + ".html";
bcl2Name = bcl2.getClass().getSimpleName();
}
}
// 97, 1
jamonWriter.write("\n \n Attribute \n Value \n Description \n \n \n \n Implementation \n ");
// 106, 35
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bcName), jamonWriter);
// 106, 47
jamonWriter.write(" \n Block cache implementing class \n \n
\nSee block cache in the HBase Reference Guide for help.
\n");
}
// 113, 1
private void __jamon_innerUnit__bc_config(final java.io.Writer jamonWriter, final CacheConfig cacheConfig)
throws java.io.IOException
{
// 117, 1
if (cacheConfig == null )
{
// 117, 28
jamonWriter.write("\nCacheConfig is null
\n");
}
// 119, 1
else
{
// 119, 8
jamonWriter.write("\n\n \n Attribute \n Value \n Description \n \n \n Cache DATA on Read \n ");
// 128, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataOnRead()), jamonWriter);
// 128, 54
jamonWriter.write(" \n True if DATA blocks are cached on read\n (INDEX & BLOOM blocks are always cached) \n \n \n Cache DATA on Write \n ");
// 134, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataOnWrite()), jamonWriter);
// 134, 55
jamonWriter.write(" \n True if DATA blocks are cached on write. \n \n \n Cache INDEX on Write \n ");
// 139, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheIndexesOnWrite()), jamonWriter);
// 139, 58
jamonWriter.write(" \n True if INDEX blocks are cached on write \n \n \n Cache BLOOM on Write \n ");
// 144, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheBloomsOnWrite()), jamonWriter);
// 144, 57
jamonWriter.write(" \n True if BLOOM blocks are cached on write \n \n \n Evict blocks on Close \n ");
// 149, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldEvictOnClose()), jamonWriter);
// 149, 51
jamonWriter.write(" \n True if blocks are evicted from cache when an HFile\n reader is closed \n \n \n Cache DATA in compressed format \n ");
// 155, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataCompressed()), jamonWriter);
// 155, 58
jamonWriter.write(" \n True if DATA blocks are cached in their compressed form \n \n \n Prefetch on Open \n ");
// 160, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldPrefetchOnOpen()), jamonWriter);
// 160, 53
jamonWriter.write(" \n True if blocks are prefetched into cache on open \n \n
\n");
}
// 164, 7
jamonWriter.write("\n");
}
// 262, 1
private void __jamon_innerUnit__bc_l(final java.io.Writer jamonWriter, final BlockCache bc, final String name, final boolean evictions)
throws java.io.IOException
{
// 268, 1
if (bc == null )
{
// 268, 19
jamonWriter.write("\nNo ");
// 269, 7
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(name), jamonWriter);
// 269, 17
jamonWriter.write(" deployed
\n");
}
// 270, 1
else
{
// 270, 8
jamonWriter.write("\n");
// 271, 1
{
// 271, 1
__jamon_innerUnit__block_cache(jamonWriter, bc, name, evictions);
}
// 271, 65
jamonWriter.write("\n");
}
// 272, 7
jamonWriter.write("\n");
}
// 224, 1
private void __jamon_innerUnit__bc_stats(final java.io.Writer jamonWriter, final BlockCache bc)
throws java.io.IOException
{
// 228, 1
if (bc == null )
{
// 228, 19
jamonWriter.write("\nBlockCache is null
\n");
}
// 230, 1
else
{
// 230, 8
jamonWriter.write("\n\n \n Attribute \n Value \n Description \n \n \n Size \n ");
// 239, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getCurrentSize(),
"B", 1)), jamonWriter);
// 240, 23
jamonWriter.write(" \n Current size of block cache in use \n \n \n Free \n ");
// 245, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getFreeSize(),
"B", 1)), jamonWriter);
// 246, 23
jamonWriter.write(" \n The total free memory currently available to store more cache entries \n \n \n Count \n ");
// 251, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getBlockCount())), jamonWriter);
// 251, 59
jamonWriter.write(" \n Number of blocks in block cache \n \n ");
// 254, 5
{
// 254, 5
__jamon_innerUnit__evictions_tmpl(jamonWriter, bc);
}
// 254, 35
jamonWriter.write("\n ");
// 255, 5
{
// 255, 5
__jamon_innerUnit__hits_tmpl(jamonWriter, bc);
}
// 255, 30
jamonWriter.write("\n
\nIf block cache is made up of more than one cache -- i.e. a L1 and a L2 -- then the above\nare combined counts. Request count is sum of hits and misses.
\n");
}
// 259, 7
jamonWriter.write("\n");
}
// 275, 1
private void __jamon_innerUnit__block_cache(final java.io.Writer jamonWriter, final BlockCache bc, final String name, final boolean evictions)
throws java.io.IOException
{
// 281, 1
String bcUrl = "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html";
String bcName = bc.getClass().getSimpleName();
org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile cbsbf =
org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.getLoadedCachedBlocksByFile(config, bc);
AgeSnapshot cbsbfSnapshot = cbsbf.getAgeInCacheSnapshot();
boolean bucketCache = bc.getClass().getSimpleName().equals("BucketCache");
BucketCacheStats bucketCacheStats = null;
BucketAllocator bucketAllocator = null;
if (bucketCache) {
bucketCacheStats = (BucketCacheStats)bc.getStats();
bucketAllocator = ((BucketCache)bc).getAllocator();
}
// 297, 1
if (cbsbf.isFull() )
{
// 297, 23
jamonWriter.write("\n\n
\nThe stats below are incomplete! We ran into our accounting limit of ");
// 300, 86
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cbsbf.getCount()), jamonWriter);
// 300, 108
jamonWriter.write(" blocks. Up the configuration hbase.ui.blockcache.by.file.max.\n\n \n");
}
// 303, 7
jamonWriter.write("\n\n \n Attribute \n Value \n Description \n \n \n Implementation \n ");
// 312, 35
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bc.getClass().getSimpleName()), jamonWriter);
// 312, 70
jamonWriter.write(" \n Class implementing this block cache Level \n \n");
// 315, 1
if (bucketCache )
{
// 315, 20
jamonWriter.write("\n \n Implementation \n ");
// 318, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(((BucketCache)bc).getIoEngine()), jamonWriter);
// 318, 50
jamonWriter.write(" \n IOEngine \n \n");
}
// 321, 7
jamonWriter.write("\n \n Cache Size Limit \n ");
// 324, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getMaxSize(), "B", 1)), jamonWriter);
// 324, 79
jamonWriter.write(" \n Max size of cache \n \n \n Block Count \n ");
// 329, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getBlockCount())), jamonWriter);
// 329, 59
jamonWriter.write(" \n Count of Blocks \n \n");
// 332, 1
if (!bucketCache )
{
// 332, 21
jamonWriter.write("\n \n Data Block Count \n ");
// 335, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getDataBlockCount())), jamonWriter);
// 335, 63
jamonWriter.write(" \n Count of DATA Blocks \n \n");
}
// 338, 7
jamonWriter.write("\n \n Size of Blocks \n ");
// 341, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getCurrentSize(), "B", 1)), jamonWriter);
// 341, 83
jamonWriter.write(" \n Size of Blocks \n \n");
// 344, 1
if (!bucketCache )
{
// 344, 21
jamonWriter.write("\n \n Size of Data Blocks \n ");
// 347, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getCurrentDataSize(), "B", 1)), jamonWriter);
// 347, 87
jamonWriter.write(" \n Size of DATA Blocks \n \n");
}
// 350, 7
jamonWriter.write(" \n");
// 351, 1
{
// 351, 1
__jamon_innerUnit__evictions_tmpl(jamonWriter, bc);
}
// 351, 31
jamonWriter.write("\n");
// 352, 1
{
// 352, 1
__jamon_innerUnit__hits_tmpl(jamonWriter, bc);
}
// 352, 26
jamonWriter.write("\n\n");
// 354, 1
if (bucketCache )
{
// 354, 20
jamonWriter.write("\n \n Hits per Second \n ");
// 357, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucketCacheStats.getIOHitsPerSecond()), jamonWriter);
// 357, 56
jamonWriter.write(" \n Block gets against this cache per second \n \n \n Time per Hit \n ");
// 362, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucketCacheStats.getIOTimePerHit()), jamonWriter);
// 362, 53
jamonWriter.write(" \n Time per cache hit \n \n");
}
// 365, 7
jamonWriter.write("\n
\nView block cache as JSON | Block cache as JSON by file
\n");
// 369, 1
cbsbf = null;
}
// 167, 1
private void __jamon_innerUnit__evictions_tmpl(final java.io.Writer jamonWriter, final BlockCache bc)
throws java.io.IOException
{
// 171, 1
AgeSnapshot ageAtEvictionSnapshot = bc.getStats().getAgeAtEvictionSnapshot();
// Only show if non-zero mean and stddev as is the case in combinedblockcache
// 175, 5
jamonWriter.write("\n Evicted \n ");
// 177, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictedCount())), jamonWriter);
// 177, 72
jamonWriter.write(" \n The total number of blocks evicted \n \n \n Evictions \n ");
// 182, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictionCount())), jamonWriter);
// 182, 73
jamonWriter.write(" \n The total number of times an eviction has occurred \n \n \n Mean \n ");
// 187, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", (long)ageAtEvictionSnapshot.getMean())), jamonWriter);
// 187, 78
jamonWriter.write(" \n Mean age of Blocks at eviction time (seconds) \n \n");
}
// 192, 1
private void __jamon_innerUnit__hits_tmpl(final java.io.Writer jamonWriter, final BlockCache bc)
throws java.io.IOException
{
// 196, 5
jamonWriter.write("\n Hits \n ");
// 198, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getHitCount())), jamonWriter);
// 198, 68
jamonWriter.write(" \n Number requests that were cache hits \n \n \n Hits Caching \n ");
// 203, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getHitCachingCount())), jamonWriter);
// 203, 75
jamonWriter.write(" \n Cache hit block requests but only requests set to cache block if a miss \n \n \n Misses \n ");
// 208, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getMissCount())), jamonWriter);
// 208, 69
jamonWriter.write(" \n Block requests that were cache misses but set to cache missed blocks \n \n \n Misses Caching \n ");
// 213, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getMissCount())), jamonWriter);
// 213, 69
jamonWriter.write(" \n Block requests that were cache misses but only requests set to use block cache \n \n \n Hit Ratio \n ");
// 218, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,.2f", bc.getStats().getHitRatio() * 100)), jamonWriter);
// 218, 76
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf("%"), jamonWriter);
// 218, 85
jamonWriter.write(" \n Hit Count divided by total requests count \n \n\n");
}
}