Class DatanodeStorageInfo

java.lang.Object
org.apache.hadoop.hdfs.server.blockmanagement.DatanodeStorageInfo

public class DatanodeStorageInfo extends Object
A Datanode has one or more storages. A storage in the Datanode is represented by this class.
  • Field Details

  • Method Details

    • toDatanodeInfos

      public static org.apache.hadoop.hdfs.protocol.DatanodeInfo[] toDatanodeInfos(DatanodeStorageInfo[] storages)
    • toStorageIDs

      public static String[] toStorageIDs(DatanodeStorageInfo[] storages)
    • toStorageTypes

      public static org.apache.hadoop.fs.StorageType[] toStorageTypes(DatanodeStorageInfo[] storages)
    • updateFromStorage

      public void updateFromStorage(org.apache.hadoop.hdfs.server.protocol.DatanodeStorage storage)
    • getBlockReportCount

      public int getBlockReportCount()
    • areBlockContentsStale

      public boolean areBlockContentsStale()
    • setBlockContentsStale

      @VisibleForTesting public void setBlockContentsStale(boolean value)
    • setUtilizationForTesting

      @VisibleForTesting public void setUtilizationForTesting(long capacity, long dfsUsed, long remaining, long blockPoolUsed)
    • getStorageID

      @VisibleForTesting public String getStorageID()
    • getStorageType

      public org.apache.hadoop.fs.StorageType getStorageType()
    • addBlock

      public org.apache.hadoop.hdfs.server.blockmanagement.DatanodeStorageInfo.AddBlockResult addBlock(BlockInfo b, org.apache.hadoop.hdfs.protocol.Block reportedBlock)
    • insertToList

      public void insertToList(BlockInfo b)
    • getDatanodeDescriptor

      public DatanodeDescriptor getDatanodeDescriptor()
    • incrementBlocksScheduled

      public static void incrementBlocksScheduled(DatanodeStorageInfo... storages)
      Increment the number of blocks scheduled for each given storage
    • decrementBlocksScheduled

      public static void decrementBlocksScheduled(DatanodeStorageInfo... storages)
      Decrement the number of blocks scheduled for each given storage. This will be called during abandon block or delete of UC block.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object