Class BlockStorageMovementAttemptedItems
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.sps.BlockStorageMovementAttemptedItems
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 Summary
ConstructorsConstructorDescriptionBlockStorageMovementAttemptedItems(SPSService service, BlockStorageMovementNeeded unsatisfiedStorageMovementFiles, Context context) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(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.voidintBlockingQueue<org.apache.hadoop.hdfs.protocol.Block>intvoidnotifyReportedBlock(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.voidstart()Starts the monitor thread.voidstop()Sets running flag to false.
-
Constructor Details
-
BlockStorageMovementAttemptedItems
public BlockStorageMovementAttemptedItems(SPSService service, BlockStorageMovementNeeded unsatisfiedStorageMovementFiles, Context context)
-
-
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 identifierfileId- - file identifiermonotonicNow- - time nowassignedBlocks- - assigned blocks for block movementretryCount- - 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 datanodetype- storage typereportedBlock- 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()
-