Interface SPSService
- All Known Implementing Classes:
StoragePolicySatisfier
@Private
@Evolving
public interface SPSService
An interface for SPSService, which exposes life cycle and processing APIs.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllFilesToProcess(long startPathId, List<ItemInfo> itemInfoList, boolean scanCompleted) Adds all the Item information(file etc) to processing queue.voidaddFileToProcess(ItemInfo itemInfo, boolean scanCompleted) Adds the Item information(file etc) to processing queue.org.apache.hadoop.conf.ConfigurationgetConf()voidInitializes the helper services.booleanCheck whether StoragePolicySatisfier is running.voidmarkScanCompletedForPath(long spsPath) Marks the scanning of directory if finished.voidnotifyStorageMovementAttemptFinishedBlk(org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.hdfs.protocol.Block block) Given node is reporting that it received a certain movement attempt finished block.intvoidstart(org.apache.hadoop.hdfs.protocol.HdfsConstants.StoragePolicySatisfierMode spsMode) Starts the SPS service.voidstop(boolean forceStop) Stops the SPS service.voidStops the SPS service gracefully.
-
Method Details
-
init
Initializes the helper services.- Parameters:
ctxt- - context is an helper service to provide communication channel between NN and SPS
-
start
void start(org.apache.hadoop.hdfs.protocol.HdfsConstants.StoragePolicySatisfierMode spsMode) Starts the SPS service. Make sure to initialize the helper services before invoking this method.- Parameters:
spsMode- sps service mode
-
stopGracefully
void stopGracefully()Stops the SPS service gracefully. Timed wait to stop storage policy satisfier daemon threads. -
stop
void stop(boolean forceStop) Stops the SPS service.- Parameters:
forceStop- true represents to clear all the sps path's hint, false otherwise.
-
isRunning
boolean isRunning()Check whether StoragePolicySatisfier is running.- Returns:
- true if running
-
addFileToProcess
Adds the Item information(file etc) to processing queue.- Parameters:
itemInfo- file info object for which need to satisfy the policy
-
addAllFilesToProcess
Adds all the Item information(file etc) to processing queue.- Parameters:
startPathId- - directoryId/fileId, on which SPS was called.itemInfoList- - list of item infosscanCompleted- - whether the scanning of directory fully done with itemInfoList
-
processingQueueSize
int processingQueueSize()- Returns:
- current processing queue size.
-
getConf
org.apache.hadoop.conf.Configuration getConf()- Returns:
- the configuration.
-
markScanCompletedForPath
void markScanCompletedForPath(long spsPath) Marks the scanning of directory if finished.- Parameters:
spsPath- - satisfier path id
-
notifyStorageMovementAttemptFinishedBlk
void notifyStorageMovementAttemptFinishedBlk(org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.hdfs.protocol.Block block) Given node is reporting that it received a certain movement attempt finished block.- Parameters:
dnInfo- - reported datanodestorageType- - storage typeblock- - block that is attempted to move
-