Class NativePmemMappableBlockLoader


@Private @Unstable public class NativePmemMappableBlockLoader extends PmemMappableBlockLoader
Map block to persistent memory with native PMDK libs.
  • 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:
      isNativeLoader in class PmemMappableBlockLoader
    • getRecoveredMappableBlock

      public MappableBlock getRecoveredMappableBlock(File cacheFile, String bpid, byte volumeIndex) throws IOException
      Overrides:
      getRecoveredMappableBlock in class PmemMappableBlockLoader
      Throws:
      IOException