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
// /Users/enis/projects/git-repos/hbase/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon

package org.apache.hadoop.hbase.tmpl.regionserver;

// 37, 1
import java.util.Map;
// 38, 1
import org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
// 39, 1
import org.apache.hadoop.hbase.io.hfile.AgeSnapshot;
// 40, 1
import org.apache.hadoop.hbase.io.hfile.CachedBlock;
// 41, 1
import org.apache.hadoop.conf.Configuration;
// 42, 1
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
// 43, 1
import org.apache.hadoop.hbase.io.hfile.BlockCache;
// 44, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
// 45, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
// 46, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
// 47, 1
import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
// 48, 1
import org.apache.hadoop.util.StringUtils;

public class BlockCacheTmplImpl
  extends org.jamon.AbstractTemplateImpl
  implements org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl.Intf

{
  private final CacheConfig cacheConfig;
  private final Configuration config;
  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();
  }
  
  public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 24, 1
    
  BlockCache bc = cacheConfig == null? null: cacheConfig.getBlockCache();
  String bcUrl = null;
  String bcName = null;
  if (bc != null) {
    bcUrl = "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html";
    bcName = bc.getClass().getSimpleName();
  }
  BlockCache [] bcs = cacheConfig == null? null: cacheConfig.getBlockCache() == null? null: cacheConfig.getBlockCache().getBlockCaches();
  // If more than one bc, show evictions in each bc listing so can compare
  boolean evictions = bcs != null && bcs.length > 1;

    // 50, 1
    jamonWriter.write("
\n \n
\n
\n "); // 60, 13 { // 60, 13 __jamon_innerUnit__bc_baseInfo(jamonWriter, cacheConfig, bcUrl, bcName); } // 60, 91 jamonWriter.write("\n
\n
\n "); // 63, 13 { // 63, 13 __jamon_innerUnit__bc_config(jamonWriter, cacheConfig ); } // 63, 55 jamonWriter.write("\n
\n
\n "); // 66, 13 { // 66, 13 __jamon_innerUnit__bc_stats(jamonWriter, cacheConfig ); } // 66, 54 jamonWriter.write("\n
\n
\n "); // 69, 13 { // 69, 13 __jamon_innerUnit__bc_l(jamonWriter, bcs == null? bc: bcs[0], "L1", evictions); } // 69, 90 jamonWriter.write("\n
\n
\n "); // 72, 13 { // 72, 13 __jamon_innerUnit__bc_l(jamonWriter, bcs == null? null: bcs.length <= 1? null: bcs[1], "L2", evictions); } // 72, 115 jamonWriter.write("\n
\n
\n
\n\n"); } // 209, 1 private void __jamon_innerUnit__bc_stats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final CacheConfig cacheConfig) throws java.io.IOException { // 213, 1 if (cacheConfig == null || cacheConfig.getBlockCache() == null ) { // 213, 67 jamonWriter.write("\n

CacheConfig is null

\n"); } // 215, 1 else { // 215, 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 "); // 237, 5 { // 237, 5 __jamon_innerUnit__evictions_tmpl(jamonWriter, cacheConfig.getBlockCache()); } // 237, 60 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
AttributeValueDescription
Size"); // 224, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(cacheConfig.getBlockCache().getCurrentSize())), jamonWriter); // 224, 93 jamonWriter.write("Current size of block cache in use (bytes)
Free"); // 229, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(cacheConfig.getBlockCache().getFreeSize())), jamonWriter); // 229, 90 jamonWriter.write("The total free memory currently available to store more cache entries (bytes)
Count"); // 234, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", cacheConfig.getBlockCache().getBlockCount())), jamonWriter); // 234, 84 jamonWriter.write("Number of blocks in block cache
Hits"); // 240, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", cacheConfig.getBlockCache().getStats().getHitCount())), jamonWriter); // 240, 93 jamonWriter.write("Number requests that were cache hits
Hits Caching"); // 245, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", cacheConfig.getBlockCache().getStats().getHitCachingCount())), jamonWriter); // 245, 100 jamonWriter.write("Cache hit block requests but only requests set to cache block if a miss
Misses"); // 250, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", cacheConfig.getBlockCache().getStats().getMissCount())), jamonWriter); // 250, 94 jamonWriter.write("Block requests that were cache misses but set to cache missed blocks
Misses Caching"); // 255, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", cacheConfig.getBlockCache().getStats().getMissCount())), jamonWriter); // 255, 94 jamonWriter.write("Block requests that were cache misses but only requests set to use block cache
Hit Ratio"); // 260, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,.2f", cacheConfig.getBlockCache().getStats().getHitRatio() * 100)), jamonWriter); // 260, 101 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf("%"), jamonWriter); // 260, 110 jamonWriter.write("Hit Count divided by total requests count
\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"); } // 266, 7 jamonWriter.write("\n"); } // 119, 1 private void __jamon_innerUnit__bc_config(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final CacheConfig cacheConfig) throws java.io.IOException { // 123, 1 if (cacheConfig == null ) { // 123, 28 jamonWriter.write("\n

CacheConfig is null

\n"); } // 125, 1 else { // 125, 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"); // 134, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataOnRead()), jamonWriter); // 134, 54 jamonWriter.write("True if DATA blocks are cached on read\n (INDEX & BLOOM blocks are always cached)
Cache DATA on Write"); // 140, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataOnWrite()), jamonWriter); // 140, 55 jamonWriter.write("True if DATA blocks are cached on write.
Cache INDEX on Write"); // 145, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheIndexesOnWrite()), jamonWriter); // 145, 58 jamonWriter.write("True if INDEX blocks are cached on write
Cache BLOOM on Write"); // 150, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheBloomsOnWrite()), jamonWriter); // 150, 57 jamonWriter.write("True if BLOOM blocks are cached on write
Evict blocks on Close"); // 155, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldEvictOnClose()), jamonWriter); // 155, 51 jamonWriter.write("True if blocks are evicted from cache when an HFile\n reader is closed
Cache DATA in compressed format"); // 161, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldCacheDataCompressed()), jamonWriter); // 161, 58 jamonWriter.write("True if DATA blocks are cached in their compressed form
Prefetch on Open"); // 166, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cacheConfig.shouldPrefetchOnOpen()), jamonWriter); // 166, 53 jamonWriter.write("True if blocks are prefetched into cache on open
\n"); } // 170, 7 jamonWriter.write("\n"); } // 77, 1 private void __jamon_innerUnit__bc_baseInfo(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final CacheConfig cacheConfig, final String bcUrl, final String bcName) throws java.io.IOException { // 83, 1 BlockCache bc = cacheConfig == null? null: cacheConfig.getBlockCache(); 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(); } } // 103, 1 jamonWriter.write("\n \n \n \n \n \n \n \n \n \n \n \n
AttributeValueDescription
Implementation"); // 112, 35 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bcName), jamonWriter); // 112, 47 jamonWriter.write("Block cache implementing class
\n

See block cache in the HBase Reference Guide for help.

\n"); } // 282, 1 private void __jamon_innerUnit__block_cache(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final BlockCache bc, final String name, final boolean evictions) throws java.io.IOException { // 288, 1 final long nanosPerSecond = 1000000000; 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; Bucket [] buckets = null; if (bucketCache) { bucketCacheStats = (BucketCacheStats)bc.getStats(); bucketAllocator = ((BucketCache)bc).getAllocator(); buckets = bucketAllocator.getBuckets(); } // 307, 1 if (cbsbf.isFull() ) { // 307, 23 jamonWriter.write("\n

Statistics below is based on sampling first "); // 308, 51 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(cbsbfSnapshot.getMax()), jamonWriter); // 308, 79 jamonWriter.write(" blocks only (hbase.ui.blockcache.by.file.max)

\n"); } // 309, 7 jamonWriter.write("\n\n \n \n \n \n \n \n \n \n \n \n"); // 321, 1 if (bucketCache ) { // 321, 20 jamonWriter.write("\n \n \n \n \n \n"); } // 327, 7 jamonWriter.write("\n \n \n \n \n \n"); // 333, 1 if (!bucketCache ) { // 333, 21 jamonWriter.write("\n \n \n \n \n \n"); } // 339, 7 jamonWriter.write("\n \n \n \n \n \n"); // 345, 1 if (!bucketCache ) { // 345, 21 jamonWriter.write("\n \n \n \n \n \n"); } // 351, 7 jamonWriter.write(" \n"); // 352, 1 if (evictions ) { // 352, 18 { // 352, 18 __jamon_innerUnit__evictions_tmpl(jamonWriter, bc); } } // 352, 54 jamonWriter.write(" \n"); // 353, 1 if (bucketCache ) { // 353, 20 jamonWriter.write("\n \n \n \n \n \n \n \n \n \n \n"); } // 364, 7 jamonWriter.write("\n
AttributeValueDescription
Implementation"); // 318, 35 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bc.getClass().getSimpleName()), jamonWriter); // 318, 70 jamonWriter.write("Class implementing this block cache Level
Implementation"); // 324, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(((BucketCache)bc).getIoEngine()), jamonWriter); // 324, 50 jamonWriter.write("IOEngine
Count"); // 330, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", cbsbf.getCount())), jamonWriter); // 330, 57 jamonWriter.write("Count of Blocks
Count"); // 336, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", cbsbf.getDataCount())), jamonWriter); // 336, 61 jamonWriter.write("Count of DATA Blocks
Size"); // 342, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(cbsbf.getSize())), jamonWriter); // 342, 64 jamonWriter.write("Size of Blocks
Size"); // 348, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(cbsbf.getDataSize())), jamonWriter); // 348, 68 jamonWriter.write("Size of DATA Blocks
Hits per Second"); // 356, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucketCacheStats.getIOHitsPerSecond()), jamonWriter); // 356, 56 jamonWriter.write("Block gets against this cache per second
Time per Hit"); // 361, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucketCacheStats.getIOTimePerHit()), jamonWriter); // 361, 53 jamonWriter.write("Time per cache hit
\n

View block cache as JSON | Block cache as JSON by file

\n"); // 368, 1 if (bucketCache ) { // 368, 20 jamonWriter.write("\n

BucketCache does not discern between DATA and META blocks so we do not show DATA counts (If deploy is using CombinedBlockCache, BucketCache is only DATA blocks

\n

BucketCache Buckets

\n\n \n \n \n \n \n \n"); // 378, 1 for (Bucket bucket: buckets ) { // 378, 32 jamonWriter.write("\n \n \n \n \n \n \n"); } // 385, 8 jamonWriter.write("\n
Bucket OffsetAllocation SizeFree BytesUsed Bytes
"); // 380, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucket.getBaseOffset()), jamonWriter); // 380, 41 jamonWriter.write(""); // 381, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucket.getItemAllocationSize()), jamonWriter); // 381, 49 jamonWriter.write(""); // 382, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucket.getFreeBytes()), jamonWriter); // 382, 40 jamonWriter.write(""); // 383, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bucket.getUsedBytes()), jamonWriter); // 383, 40 jamonWriter.write("
\n"); } // 387, 7 jamonWriter.write("\n"); // 388, 1 cbsbf = null; } // 269, 1 private void __jamon_innerUnit__bc_l(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final BlockCache bc, final String name, final boolean evictions) throws java.io.IOException { // 275, 1 if (bc == null ) { // 275, 19 jamonWriter.write("\n

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

\n"); } // 277, 1 else { // 277, 8 jamonWriter.write("\n"); // 278, 1 { // 278, 1 __jamon_innerUnit__block_cache(jamonWriter, bc, name, evictions); } // 278, 65 jamonWriter.write("\n"); } // 279, 7 jamonWriter.write("\n"); } // 173, 1 private void __jamon_innerUnit__evictions_tmpl(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final BlockCache bc) throws java.io.IOException { // 177, 1 AgeSnapshot ageAtEvictionSnapshot = bc.getStats().getAgeAtEvictionSnapshot(); // Only show if non-zero mean and stddev as is the case in combinedblockcache double mean = ageAtEvictionSnapshot.getMean(); double stddev = ageAtEvictionSnapshot.getStdDev(); // 183, 5 jamonWriter.write("\n Evicted\n "); // 185, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictedCount())), jamonWriter); // 185, 72 jamonWriter.write("\n The total number of blocks evicted\n \n \n Evictions\n "); // 190, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictionCount())), jamonWriter); // 190, 73 jamonWriter.write("\n The total number of times an eviction has occurred\n \n"); // 193, 1 if (mean > 0 ) { // 193, 17 jamonWriter.write("\n \n Mean\n "); // 196, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", (long)(ageAtEvictionSnapshot.getMean()/(1000000 * 1000)))), jamonWriter); // 196, 97 jamonWriter.write("\n Mean age of Blocks at eviction time (seconds)\n \n"); } // 199, 7 jamonWriter.write("\n"); // 200, 1 if (stddev > 0 ) { // 200, 19 jamonWriter.write("\n \n StdDev\n "); // 203, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", (long)(ageAtEvictionSnapshot.getStdDev()/1000000))), jamonWriter); // 203, 90 jamonWriter.write("\n Standard Deviation for age of Blocks at eviction time\n \n"); } // 206, 7 jamonWriter.write("\n"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy