Class NativePmemMappableBlockLoader
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.MappableBlockLoader
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.PmemMappableBlockLoader
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.NativePmemMappableBlockLoader
Map block to persistent memory with native PMDK libs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRecoveredMappableBlock(File cacheFile, String bpid, byte volumeIndex) booleanload(long length, FileInputStream blockIn, FileInputStream metaIn, String blockFileName, org.apache.hadoop.hdfs.ExtendedBlockId key) Load the block.Methods inherited from class org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.PmemMappableBlockLoader
getBlockId, getCacheCapacity, getCacheUsed, isTransientCacheMethods inherited from class org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.MappableBlockLoader
fillBuffer, verifyChecksum
-
Constructor Details
-
NativePmemMappableBlockLoader
public NativePmemMappableBlockLoader()
-
-
Method Details
-
load
public MappableBlock load(long length, FileInputStream blockIn, FileInputStream metaIn, String blockFileName, org.apache.hadoop.hdfs.ExtendedBlockId key) throws IOException Load the block. Map the block and verify its checksum. The block will be mapped to PmemDir/BlockPoolId/subdir#/subdir#/BlockId, in which PmemDir is a persistent memory volume chosen by PmemVolumeManager.- Parameters:
length- The current length of the block.blockIn- The block input stream. Should be positioned at the start. The caller must close this.metaIn- The meta file input stream. Should be positioned at the start. The caller must close this.blockFileName- The block file name, for logging purposes.key- The extended block ID.- Returns:
- The Mappable block.
- Throws:
IOException- If mapping block to persistent memory fails or checksum fails.
-
isNativeLoader
public boolean isNativeLoader()- Overrides:
isNativeLoaderin classPmemMappableBlockLoader
-
getRecoveredMappableBlock
public MappableBlock getRecoveredMappableBlock(File cacheFile, String bpid, byte volumeIndex) throws IOException - Overrides:
getRecoveredMappableBlockin classPmemMappableBlockLoader- Throws:
IOException
-