@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 int |
compareCacheBlock(Cacheable left,
Cacheable right) |
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 BlockCacheUtil()
public static String toString(CachedBlock cb, long now)
cb
- public static String toJSON(String filename, NavigableSet<CachedBlock> blocks) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
filename
- blocks
- filename
and counts of blocks
com.fasterxml.jackson.core.JsonGenerationException
com.fasterxml.jackson.databind.JsonMappingException
IOException
public static String toJSON(BlockCacheUtil.CachedBlocksByFile cbsbf) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
cbsbf
- cbsf
aggregatedcom.fasterxml.jackson.core.JsonGenerationException
com.fasterxml.jackson.databind.JsonMappingException
IOException
public static String toJSON(BlockCache bc) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
bc
- bc
content.com.fasterxml.jackson.core.JsonGenerationException
com.fasterxml.jackson.databind.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.public static int compareCacheBlock(Cacheable left, Cacheable right)
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.