org.apache.hadoop.hbase.io.hfile
Class BlockCacheUtil
java.lang.Object
org.apache.hadoop.hbase.io.hfile.BlockCacheUtil
@InterfaceAudience.Private
public class BlockCacheUtil
- extends Object
Utilty for aggregating counts in CachedBlocks and toString/toJSON CachedBlocks and BlockCaches.
No attempt has been made at making this thread safe.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlockCacheUtil
public BlockCacheUtil()
toString
public static String toString(CachedBlock cb,
long now)
- Parameters:
cb -
- Returns:
- The block content as String.
toJSON
public static String toJSON(String filename,
NavigableSet<CachedBlock> blocks)
throws org.codehaus.jackson.JsonGenerationException,
org.codehaus.jackson.map.JsonMappingException,
IOException
- Parameters:
filename - blocks -
- Returns:
- A JSON String of
filename and counts of blocks
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
IOException
toJSON
public static String toJSON(BlockCacheUtil.CachedBlocksByFile cbsbf)
throws org.codehaus.jackson.JsonGenerationException,
org.codehaus.jackson.map.JsonMappingException,
IOException
- Parameters:
cbsbf -
- Returns:
- JSON string of
cbsf aggregated
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
IOException
toJSON
public static String toJSON(BlockCache bc)
throws org.codehaus.jackson.JsonGenerationException,
org.codehaus.jackson.map.JsonMappingException,
IOException
- Parameters:
bc -
- Returns:
- JSON string of
bc content.
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
IOException
toStringMinusFileName
public static String toStringMinusFileName(CachedBlock cb,
long now)
- Parameters:
cb -
- Returns:
- The block content of
bc as a String minus the filename.
getLoadedCachedBlocksByFile
public static BlockCacheUtil.CachedBlocksByFile getLoadedCachedBlocksByFile(org.apache.hadoop.conf.Configuration conf,
BlockCache bc)
- Get a
BlockCacheUtil.CachedBlocksByFile instance and load it up by iterating content in
BlockCache.
- Parameters:
conf - Used to read configurationsbc - Block Cache to iterate.
- Returns:
- Laoded up instance of CachedBlocksByFile
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.