Class BlockStorageMovementNeeded

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.sps.BlockStorageMovementNeeded

@Private public class BlockStorageMovementNeeded extends Object
A Class to track the block collection IDs (Inode's ID) for which physical storage movement needed as per the Namespace and StorageReports from DN. It scan the pending directories for which storage movement is required and schedule the block collection IDs for movement. It track the info of scheduled items and remove the SPS xAttr from the file/Directory once movement is success.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • BlockStorageMovementNeeded

      public BlockStorageMovementNeeded(Context context)
  • Method Details

    • add

      public void add(ItemInfo trackInfo)
      Add the candidate to tracking list for which storage movement expected if necessary.
      Parameters:
      trackInfo - - track info for satisfy the policy
    • addAll

      @VisibleForTesting public void addAll(long startPath, List<ItemInfo> itemInfoList, boolean scanCompleted)
      Add the itemInfo list to tracking list for which storage movement expected if necessary.
      Parameters:
      startPath - - start path
      itemInfoList - - List of child in the directory
      scanCompleted - -Indicates whether the start id directory has no more elements to scan.
    • add

      @VisibleForTesting public void add(ItemInfo itemInfo, boolean scanCompleted)
      Add the itemInfo to tracking list for which storage movement expected if necessary.
      Parameters:
      itemInfo - - child in the directory
      scanCompleted - -Indicates whether the ItemInfo start id directory has no more elements to scan.
    • get

      public ItemInfo get()
      Gets the satisfier files for which block storage movements check necessary and make the movement if required.
      Returns:
      satisfier files
    • size

      public int size()
      Returns queue size.
    • clearAll

      public void clearAll()
    • removeItemTrackInfo

      public void removeItemTrackInfo(ItemInfo trackInfo, boolean isSuccess) throws IOException
      Decrease the pending child count for directory once one file blocks moved successfully. Remove the SPS xAttr if pending child count is zero.
      Throws:
      IOException
    • clearQueuesWithNotification

      public void clearQueuesWithNotification()
      Clean all the movements in spsDirsToBeTraveresed/storageMovementNeeded and notify to clean up required resources.
    • activate

      public void activate()
    • close

      public void close()
    • setStatusClearanceElapsedTimeMs

      @VisibleForTesting public static void setStatusClearanceElapsedTimeMs(long statusClearanceElapsedTimeMs)
    • getStatusClearanceElapsedTimeMs

      @VisibleForTesting public static long getStatusClearanceElapsedTimeMs()
    • markScanCompletedForDir

      public void markScanCompletedForDir(long inode)