java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.MemoryMappedBlock
All Implemented Interfaces:
Closeable, AutoCloseable, MappableBlock

@Private @Unstable public class MemoryMappedBlock extends Object implements MappableBlock
Represents an HDFS block that is mapped to memory by the DataNode.
  • 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