@InterfaceAudience.Private public class BlockCacheUtil extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
BlockCacheUtil.CachedBlockCountsPerFile
Little data structure to hold counts for a file.
|
static class |
BlockCacheUtil.CachedBlocksByFile
Use one of these to keep a running account of cached blocks by file.
|
Modifier and Type | Field and Description |
---|---|
private static org.codehaus.jackson.map.ObjectMapper |
MAPPER
Needed generating JSON.
|
private static com.yammer.metrics.core.MetricsRegistry |
METRICS
Needed making histograms.
|
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
private static final com.yammer.metrics.core.MetricsRegistry METRICS
private static final org.codehaus.jackson.map.ObjectMapper MAPPER
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–2019 The Apache Software Foundation. All rights reserved.