NativePmemMappedBlock (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.datanode.fsdataset.impl, class: NativePmemMappedBlock

Package org.apache.hadoop.hdfs.server.datanode.fsdataset.impl

# Class NativePmemMappedBlock

java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.NativePmemMappedBlock

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `MappableBlock`

@Private @Unstable public class NativePmemMappedBlock extends Object implements MappableBlock
Represents an HDFS block that is mapped to persistent memory by the DataNode.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `long`
  `getAddress()`
  Get cache address if applicable.
  `org.apache.hadoop.hdfs.ExtendedBlockId`
  `getKey()`
  Get cached block's ExtendedBlockId.
  `long`
  `getLength()`
  Get the number of bytes that have been cached.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getLength

    public long getLength()
    Description copied from interface: `MappableBlock`
    Get the number of bytes that have been cached.
    Specified by:
      `getLength` in interface `MappableBlock`
    Returns:
      the number of bytes that have been cached.

  - ### getAddress

    public long getAddress()
    Description copied from interface: `MappableBlock`
    Get cache address if applicable. Return -1 if not applicable.
    Specified by:
      `getAddress` in interface `MappableBlock`

  - ### getKey

    public org.apache.hadoop.hdfs.ExtendedBlockId getKey()
    Description copied from interface: `MappableBlock`
    Get cached block's ExtendedBlockId.
    Specified by:
      `getKey` in interface `MappableBlock`
    Returns:
      cached block's ExtendedBlockId..

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`