All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmplImpl Maven / Gradle / Ivy

There is a newer version: 3.0.0-beta-1
Show newest version
// Autogenerated Jamon implementation
// /home/apurtell/tmp/RM/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;
// 34, 1
import org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
// 35, 1
import org.apache.hadoop.hbase.io.hfile.AgeSnapshot;
// 36, 1
import org.apache.hadoop.hbase.io.hfile.CachedBlock;
// 37, 1
import org.apache.hadoop.conf.Configuration;
// 38, 1
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
// 39, 1
import org.apache.hadoop.hbase.io.hfile.BlockCache;
// 40, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
// 41, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
// 42, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
// 43, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
// 44, 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;

    // 46, 1
    jamonWriter.write("
\n \n
\n
\n "); // 56, 13 { // 56, 13 __jamon_innerUnit__bc_baseInfo(jamonWriter, bc, bcUrl, bcName); } // 56, 73 jamonWriter.write("\n
\n
\n "); // 59, 13 { // 59, 13 __jamon_innerUnit__bc_config(jamonWriter, cacheConfig ); } // 59, 55 jamonWriter.write("\n
\n
\n "); // 62, 13 { // 62, 13 __jamon_innerUnit__bc_stats(jamonWriter, bc ); } // 62, 36 jamonWriter.write("\n
\n
\n "); // 65, 13 { // 65, 13 __jamon_innerUnit__bc_l(jamonWriter, bcs == null? bc: bcs[0], "L1", evictions); } // 65, 90 jamonWriter.write("\n
\n
\n "); // 68, 13 { // 68, 13 __jamon_innerUnit__bc_l(jamonWriter, bcs == null? null: bcs.length <= 1? null: bcs[1], "L2", evictions); } // 68, 115 jamonWriter.write("\n
\n
\n
\n\n"); } // 73, 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 { // 79, 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(); } } // 98, 1 jamonWriter.write("\n \n \n \n \n \n \n \n \n \n \n \n
AttributeValueDescription
Implementation"); // 107, 35 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bcName), jamonWriter); // 107, 47 jamonWriter.write("Block cache implementing class
\n

See block cache in the HBase Reference Guide for help.

\n"); } // 114, 1 private void __jamon_innerUnit__bc_config(final java.io.Writer jamonWriter, final CacheConfig cacheConfig) throws java.io.IOException { // 118, 1 if (cacheConfig == null ) { // 118, 28 jamonWriter.write("\n

CacheConfig is null

\n"); } // 120, 1 else { // 120, 8 jamonWriter.write("\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
AttributeValueDescription
Cache DATA on Read"); // 129, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataOnRead()), jamonWriter); // 129, 54 jamonWriter.write("True if DATA blocks are cached on read\n (INDEX & BLOOM blocks are always cached)
Cache DATA on Write"); // 135, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataOnWrite()), jamonWriter); // 135, 55 jamonWriter.write("True if DATA blocks are cached on write.
Cache INDEX on Write"); // 140, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheIndexesOnWrite()), jamonWriter); // 140, 58 jamonWriter.write("True if INDEX blocks are cached on write
Cache BLOOM on Write"); // 145, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheBloomsOnWrite()), jamonWriter); // 145, 57 jamonWriter.write("True if BLOOM blocks are cached on write
Evict blocks on Close"); // 150, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldEvictOnClose()), jamonWriter); // 150, 51 jamonWriter.write("True if blocks are evicted from cache when an HFile\n reader is closed
Cache DATA in compressed format"); // 156, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataCompressed()), jamonWriter); // 156, 58 jamonWriter.write("True if DATA blocks are cached in their compressed form
Prefetch on Open"); // 161, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldPrefetchOnOpen()), jamonWriter); // 161, 53 jamonWriter.write("True if blocks are prefetched into cache on open
\n"); } // 165, 7 jamonWriter.write("\n"); } // 263, 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 { // 269, 1 if (bc == null ) { // 269, 19 jamonWriter.write("\n

No "); // 270, 7 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(name), jamonWriter); // 270, 17 jamonWriter.write(" deployed

\n"); } // 271, 1 else { // 271, 8 jamonWriter.write("\n"); // 272, 1 { // 272, 1 __jamon_innerUnit__block_cache(jamonWriter, bc, name, evictions); } // 272, 65 jamonWriter.write("\n"); } // 273, 7 jamonWriter.write("\n"); } // 225, 1 private void __jamon_innerUnit__bc_stats(final java.io.Writer jamonWriter, final BlockCache bc) throws java.io.IOException { // 229, 1 if (bc == null ) { // 229, 19 jamonWriter.write("\n

BlockCache is null

\n"); } // 231, 1 else { // 231, 8 jamonWriter.write("\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "); // 255, 5 { // 255, 5 __jamon_innerUnit__evictions_tmpl(jamonWriter, bc); } // 255, 35 jamonWriter.write("\n "); // 256, 5 { // 256, 5 __jamon_innerUnit__hits_tmpl(jamonWriter, bc); } // 256, 30 jamonWriter.write("\n
AttributeValueDescription
Size"); // 240, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getCurrentSize(), "B", 1)), jamonWriter); // 241, 23 jamonWriter.write("Current size of block cache in use
Free"); // 246, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getFreeSize(), "B", 1)), jamonWriter); // 247, 23 jamonWriter.write("The total free memory currently available to store more cache entries
Count"); // 252, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getBlockCount())), jamonWriter); // 252, 59 jamonWriter.write("Number of blocks in block cache
\n

If 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"); } // 260, 7 jamonWriter.write("\n"); } // 276, 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 { // 282, 1 String bcUrl = "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html"; String bcName = bc.getClass().getSimpleName(); int maxCachedBlocksByFile = BlockCacheUtil.getMaxCachedBlocksByFile(config); boolean bucketCache = bc.getClass().getSimpleName().equals("BucketCache"); BucketCacheStats bucketCacheStats = null; BucketAllocator bucketAllocator = null; if (bucketCache) { bucketCacheStats = (BucketCacheStats)bc.getStats(); bucketAllocator = ((BucketCache)bc).getAllocator(); } // 296, 1 jamonWriter.write("\n \n \n \n \n \n \n \n \n \n \n"); // 307, 1 if (bucketCache ) { // 307, 20 jamonWriter.write("\n \n \n \n \n \n"); } // 313, 7 jamonWriter.write("\n \n \n \n \n \n \n \n \n \n \n"); // 324, 1 if (!bucketCache ) { // 324, 21 jamonWriter.write("\n \n \n \n \n \n"); } // 330, 7 jamonWriter.write("\n \n \n \n \n \n"); // 336, 1 if (!bucketCache ) { // 336, 21 jamonWriter.write("\n \n \n \n \n \n"); } // 342, 7 jamonWriter.write(" \n"); // 343, 1 { // 343, 1 __jamon_innerUnit__evictions_tmpl(jamonWriter, bc); } // 343, 31 jamonWriter.write("\n"); // 344, 1 { // 344, 1 __jamon_innerUnit__hits_tmpl(jamonWriter, bc); } // 344, 26 jamonWriter.write("\n\n"); // 346, 1 if (bucketCache ) { // 346, 20 jamonWriter.write("\n \n \n \n \n \n \n \n \n \n \n"); } // 357, 7 jamonWriter.write("\n
AttributeValueDescription
Implementation"); // 304, 35 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bc.getClass().getSimpleName()), jamonWriter); // 304, 70 jamonWriter.write("Class implementing this block cache Level
Implementation"); // 310, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(((BucketCache)bc).getIoEngine()), jamonWriter); // 310, 50 jamonWriter.write("IOEngine
Cache Size Limit"); // 316, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getMaxSize(), "B", 1)), jamonWriter); // 316, 79 jamonWriter.write("Max size of cache
Block Count"); // 321, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getBlockCount())), jamonWriter); // 321, 59 jamonWriter.write("Count of Blocks
Data Block Count"); // 327, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getDataBlockCount())), jamonWriter); // 327, 63 jamonWriter.write("Count of DATA Blocks
Size of Blocks"); // 333, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getCurrentSize(), "B", 1)), jamonWriter); // 333, 83 jamonWriter.write("Size of Blocks
Size of Data Blocks"); // 339, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bc.getCurrentDataSize(), "B", 1)), jamonWriter); // 339, 87 jamonWriter.write("Size of DATA Blocks
Hits per Second"); // 349, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucketCacheStats.getIOHitsPerSecond()), jamonWriter); // 349, 56 jamonWriter.write("Block gets against this cache per second
Time per Hit"); // 354, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucketCacheStats.getIOTimePerHit()), jamonWriter); // 354, 53 jamonWriter.write("Time per cache hit
\n

\nView block cache as JSON | Block cache as JSON by file\n"); // 362, 1 if (bc.getBlockCount() > maxCachedBlocksByFile ) { // 362, 51 jamonWriter.write("\n
\nNote: JSON view of block cache will be incomplete, because block count "); // 364, 79 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bc.getBlockCount()), jamonWriter); // 364, 103 jamonWriter.write(" is greater than hbase.ui.blockcache.by.file.max value of "); // 364, 168 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(maxCachedBlocksByFile), jamonWriter); // 364, 195 jamonWriter.write(".\nIncrease that value to get a complete picture.\n"); } // 366, 7 jamonWriter.write("\n

\n"); } // 168, 1 private void __jamon_innerUnit__evictions_tmpl(final java.io.Writer jamonWriter, final BlockCache bc) throws java.io.IOException { // 172, 1 AgeSnapshot ageAtEvictionSnapshot = bc.getStats().getAgeAtEvictionSnapshot(); // Only show if non-zero mean and stddev as is the case in combinedblockcache // 176, 5 jamonWriter.write("\n Evicted\n "); // 178, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictedCount())), jamonWriter); // 178, 72 jamonWriter.write("\n The total number of blocks evicted\n \n \n Evictions\n "); // 183, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictionCount())), jamonWriter); // 183, 73 jamonWriter.write("\n The total number of times an eviction has occurred\n \n \n Mean\n "); // 188, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", (long)ageAtEvictionSnapshot.getMean())), jamonWriter); // 188, 78 jamonWriter.write("\n Mean age of Blocks at eviction time (seconds)\n \n"); } // 193, 1 private void __jamon_innerUnit__hits_tmpl(final java.io.Writer jamonWriter, final BlockCache bc) throws java.io.IOException { // 197, 5 jamonWriter.write("\n Hits\n "); // 199, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getHitCount())), jamonWriter); // 199, 68 jamonWriter.write("\n Number requests that were cache hits\n \n \n Hits Caching\n "); // 204, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getHitCachingCount())), jamonWriter); // 204, 75 jamonWriter.write("\n Cache hit block requests but only requests set to cache block if a miss\n \n \n Misses\n "); // 209, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getMissCount())), jamonWriter); // 209, 69 jamonWriter.write("\n Block requests that were cache misses but set to cache missed blocks\n \n \n Misses Caching\n "); // 214, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getMissCachingCount())), jamonWriter); // 214, 76 jamonWriter.write("\n Block requests that were cache misses but only requests set to use block cache\n \n \n Hit Ratio\n "); // 219, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,.2f", bc.getStats().getHitRatio() * 100)), jamonWriter); // 219, 76 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf("%"), jamonWriter); // 219, 85 jamonWriter.write("\n Hit Count divided by total requests count\n \n\n"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy