Class BlockStorageMovementAttemptedItems

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

public class BlockStorageMovementAttemptedItems extends Object
A monitor class for checking whether block storage movements attempt completed or not. If this receives block storage movement attempt status(either success or failure) from DN then it will just remove the entries from tracking. If there is no DN reports about movement attempt finished for a longer time period, then such items will retries automatically after timeout. The default timeout would be 5 minutes.
  • Constructor Details

  • Method Details

    • add

      public void add(long startPathId, long fileId, long monotonicNow, Map<org.apache.hadoop.hdfs.protocol.Block,Set<org.apache.hadoop.hdfs.server.namenode.sps.StoragePolicySatisfier.StorageTypeNodePair>> assignedBlocks, int retryCount)
      Add item to block storage movement attempted items map which holds the tracking/blockCollection id versus time stamp.
      Parameters:
      startPathId - - start satisfier path identifier
      fileId - - file identifier
      monotonicNow - - time now
      assignedBlocks - - assigned blocks for block movement
      retryCount - - retry count
    • notifyReportedBlock

      public void notifyReportedBlock(org.apache.hadoop.hdfs.protocol.DatanodeInfo reportedDn, org.apache.hadoop.fs.StorageType type, org.apache.hadoop.hdfs.protocol.Block reportedBlock)
      Notify the storage movement attempt finished block.
      Parameters:
      reportedDn - reported datanode
      type - storage type
      reportedBlock - reported block
    • start

      public void start()
      Starts the monitor thread.
    • stop

      public void stop()
      Sets running flag to false. Also, this will interrupt monitor thread and clear all the queued up tasks.
    • getMovementFinishedBlocksCount

      @VisibleForTesting public int getMovementFinishedBlocksCount()
    • getAttemptedItemsCount

      @VisibleForTesting public int getAttemptedItemsCount()
    • getStorageMovementAttemptedItems

      @VisibleForTesting public List<StoragePolicySatisfier.AttemptedItemInfo> getStorageMovementAttemptedItems()
    • getMovementFinishedBlocks

      @VisibleForTesting public BlockingQueue<org.apache.hadoop.hdfs.protocol.Block> getMovementFinishedBlocks()
    • clearQueues

      public void clearQueues()