@Private
@Unstable
public final class PmemVolumeManager
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
CACHE_DIR |
| Modifier and Type | Method | Description |
|---|---|---|
void |
createBlockPoolDir(java.lang.String bpid) |
Create cache subdirectory specified with blockPoolId.
|
long |
getCacheCapacity() |
|
java.lang.String |
getCachePath(org.apache.hadoop.hdfs.ExtendedBlockId key) |
The cache file path is pmemVolume/BlockPoolId/subdir#/subdir#/BlockId.
|
long |
getCacheUsed() |
|
static PmemVolumeManager |
getInstance() |
|
static java.lang.String |
getRealPmemDir(java.lang.String rawPmemDir) |
|
java.lang.String |
idToCacheFileName(org.apache.hadoop.hdfs.ExtendedBlockId key) |
A cache file is named after the corresponding BlockId.
|
java.lang.String |
idToCacheFilePath(java.lang.Byte volumeIndex,
org.apache.hadoop.hdfs.ExtendedBlockId key) |
Create and get the directory where a cache file with this key and
volumeIndex should be stored.
|
static void |
init(java.lang.String[] pmemVolumesConfig,
boolean cacheRecoveryEnabled) |
|
void |
recoverBlockKeyToVolume(org.apache.hadoop.hdfs.ExtendedBlockId key,
byte volumeIndex) |
|
java.util.Map<org.apache.hadoop.hdfs.ExtendedBlockId,MappableBlock> |
recoverCache(java.lang.String bpid,
MappableBlockLoader cacheLoader) |
Recover cache from the cached files in the configured pmem volumes.
|
static void |
reset() |
|
static void |
setMaxBytes(long maxBytes) |
public static final java.lang.String CACHE_DIR
public static void init(java.lang.String[] pmemVolumesConfig,
boolean cacheRecoveryEnabled)
throws java.io.IOException
java.io.IOExceptionpublic static PmemVolumeManager getInstance()
@VisibleForTesting public static void reset()
@VisibleForTesting public static void setMaxBytes(long maxBytes)
public long getCacheUsed()
public long getCacheCapacity()
public java.util.Map<org.apache.hadoop.hdfs.ExtendedBlockId,MappableBlock> recoverCache(java.lang.String bpid, MappableBlockLoader cacheLoader) throws java.io.IOException
java.io.IOExceptionpublic void recoverBlockKeyToVolume(org.apache.hadoop.hdfs.ExtendedBlockId key,
byte volumeIndex)
public void createBlockPoolDir(java.lang.String bpid)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String getRealPmemDir(java.lang.String rawPmemDir)
public java.lang.String idToCacheFileName(org.apache.hadoop.hdfs.ExtendedBlockId key)
public java.lang.String idToCacheFilePath(java.lang.Byte volumeIndex,
org.apache.hadoop.hdfs.ExtendedBlockId key)
throws java.io.IOException
volumeIndex - The index of pmem volume where a replica will be
cached to or has been cached to.key - The replica's ExtendedBlockId.java.io.IOExceptionpublic java.lang.String getCachePath(org.apache.hadoop.hdfs.ExtendedBlockId key)
throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.