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

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

# Interface MappableBlock

All Superinterfaces:
  `AutoCloseable`, `Closeable`

All Known Implementing Classes:
  `MemoryMappedBlock`, `NativePmemMappedBlock`, `PmemMappedBlock`

@Private @Unstable public interface MappableBlock extends Closeable
Represents an HDFS block that is mapped by the DataNode.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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 interface java.io.Closeable

  `close`

- ## Method Details

  - ### getLength

    long getLength()
    Get the number of bytes that have been cached.
    Returns:
      the number of bytes that have been cached.

  - ### getAddress

    long getAddress()
    Get cache address if applicable. Return -1 if not applicable.

  - ### getKey

    org.apache.hadoop.hdfs.ExtendedBlockId getKey()
    Get cached block's ExtendedBlockId.
    Returns:
      cached block's ExtendedBlockId..