Class FsDatasetCache
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetCache
Manages caching for an FsDatasetImpl by using the mmap(2) and mlock(2)
system calls to lock blocks into memory. Block checksums are verified upon
entry into the cache.
-
Constructor Summary
ConstructorsConstructorDescriptionFsDatasetCache(org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl dataset) -
Method Summary
Modifier and TypeMethodDescriptionlongGet the maximum amount of bytes we can cache either on DRAM or on persistent memory.longGet the approximate amount of cache space used either on DRAM or on persistent memory.longGet the maximum amount of bytes we can cache on DRAM.longGet the approximate amount of DRAM cache space used.longlonglongvoidFor persistent memory cache, create cache subdirectory specified with blockPoolId to store cache data.boolean
-
Constructor Details
-
FsDatasetCache
public FsDatasetCache(org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl dataset) throws IOException - Throws:
IOException
-
-
Method Details
-
initCache
For persistent memory cache, create cache subdirectory specified with blockPoolId to store cache data. Recover the status of cache in persistent memory, if any.- Throws:
IOException
-
getMemCacheUsed
public long getMemCacheUsed()Get the approximate amount of DRAM cache space used. -
getCacheUsed
public long getCacheUsed()Get the approximate amount of cache space used either on DRAM or on persistent memory.- Returns:
-
getMemCacheCapacity
public long getMemCacheCapacity()Get the maximum amount of bytes we can cache on DRAM. This is a constant. -
getCacheCapacity
public long getCacheCapacity()Get the maximum amount of bytes we can cache either on DRAM or on persistent memory. This is a constant. -
getNumBlocksFailedToCache
public long getNumBlocksFailedToCache() -
getNumBlocksFailedToUncache
public long getNumBlocksFailedToUncache() -
getNumBlocksCached
public long getNumBlocksCached() -
isCached
-