@InterfaceAudience.Private public class BlockCacheUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BlockCacheUtil.CachedBlocksByFile
Use one of these to keep a running account of cached blocks by file.
|
Modifier and Type | Field and Description |
---|---|
static long |
NANOS_PER_SECOND |
Constructor and Description |
---|
BlockCacheUtil() |
Modifier and Type | Method and Description |
---|---|
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 . |
static String |
toJSON(BlockCache bc) |
static String |
toJSON(BlockCacheUtil.CachedBlocksByFile cbsbf) |
static String |
toJSON(String filename,
NavigableSet<CachedBlock> blocks) |
static String |
toString(CachedBlock cb,
long now) |
static String |
toStringMinusFileName(CachedBlock cb,
long now) |
public static final long NANOS_PER_SECOND
public static String toString(CachedBlock cb, long now)
cb
- public static String toJSON(String filename, NavigableSet<CachedBlock> blocks) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, IOException
filename
- blocks
- filename
and counts of blocks
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
IOException
public static String toJSON(BlockCacheUtil.CachedBlocksByFile cbsbf) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, IOException
cbsbf
- cbsf
aggregatedorg.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
IOException
public static String toJSON(BlockCache bc) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, IOException
bc
- bc
content.org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
IOException
public static String toStringMinusFileName(CachedBlock cb, long now)
cb
- bc
as a String minus the filename.public static BlockCacheUtil.CachedBlocksByFile getLoadedCachedBlocksByFile(org.apache.hadoop.conf.Configuration conf, BlockCache bc)
BlockCacheUtil.CachedBlocksByFile
instance and load it up by iterating content in
BlockCache
.conf
- Used to read configurationsbc
- Block Cache to iterate.Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.