org.apache.hadoop.hbase.io.hfile
Class BlockCacheUtil.CachedBlocksByFile

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile
Enclosing class:
BlockCacheUtil

public static class BlockCacheUtil.CachedBlocksByFile
extends Object

Use one of these to keep a running account of cached blocks by file. Throw it away when done. This is different than metrics in that it is stats on current state of a cache.

See Also:
getLoadedCachedBlocksByFile

Field Summary
static int DEFAULT_MAX
           
 
Method Summary
 BlockCacheUtil.AgeSnapshot getAgeSnapshot()
           
 NavigableMap<String,NavigableSet<CachedBlock>> getCachedBlockStatsByFile()
           
 int getCount()
           
 int getDataCount()
           
 long getDataSize()
           
 long getSize()
           
 boolean isFull()
           
 String toString()
           
 boolean update(CachedBlock cb)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MAX

public static final int DEFAULT_MAX
See Also:
Constant Field Values
Method Detail

update

public boolean update(CachedBlock cb)
Parameters:
cb -
Returns:
True if full.... if we won't be adding any more.

isFull

public boolean isFull()
Returns:
True if full; i.e. there are more items in the cache but we only loaded up the maximum set in configuration hbase.ui.blockcache.by.file.max (Default: DEFAULT_MAX).

getCachedBlockStatsByFile

public NavigableMap<String,NavigableSet<CachedBlock>> getCachedBlockStatsByFile()

getCount

public int getCount()
Returns:
count of blocks in the cache

getDataCount

public int getDataCount()

getSize

public long getSize()
Returns:
size of blocks in the cache

getDataSize

public long getDataSize()
Returns:
Size of data.

getAgeSnapshot

public BlockCacheUtil.AgeSnapshot getAgeSnapshot()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.