Class BlockStorageMovementNeeded
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.sps.BlockStorageMovementNeeded
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInfo for directory recursive scan. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidAdd the candidate to tracking list for which storage movement expected if necessary.voidAdd the itemInfo to tracking list for which storage movement expected if necessary.voidAdd the itemInfo list to tracking list for which storage movement expected if necessary.voidclearAll()voidClean all the movements in spsDirsToBeTraveresed/storageMovementNeeded and notify to clean up required resources.voidclose()get()Gets the satisfier files for which block storage movements check necessary and make the movement if required.static longvoidmarkScanCompletedForDir(long inode) voidremoveItemTrackInfo(ItemInfo trackInfo, boolean isSuccess) Decrease the pending child count for directory once one file blocks moved successfully.static voidsetStatusClearanceElapsedTimeMs(long statusClearanceElapsedTimeMs) intsize()Returns queue size.
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
BlockStorageMovementNeeded
-
-
Method Details
-
add
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 pathitemInfoList- - List of child in the directoryscanCompleted- -Indicates whether the start id directory has no more elements to scan.
-
add
Add the itemInfo to tracking list for which storage movement expected if necessary.- Parameters:
itemInfo- - child in the directoryscanCompleted- -Indicates whether the ItemInfo start id directory has no more elements to scan.
-
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
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)
-