java.lang.Runnable, SPSService@Private public class StoragePolicySatisfier extends java.lang.Object implements SPSService, java.lang.Runnable
| Modifier and Type | Class | Description |
|---|---|---|
static class |
StoragePolicySatisfier.AttemptedItemInfo |
This class contains information of an attempted blocks and its last
attempted or reported time stamp.
|
static class |
StoragePolicySatisfier.DatanodeMap |
Maintains storage type map with the available datanodes in the cluster.
|
static class |
StoragePolicySatisfier.DatanodeWithStorage |
Keeps datanode with its respective set of supported storage types.
|
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
StoragePolicySatisfier(org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAllFilesToProcess(long startPath,
java.util.List<ItemInfo> itemInfoList,
boolean scanCompleted) |
Adds all the Item information(file etc) to processing queue.
|
void |
addFileToProcess(ItemInfo trackInfo,
boolean scanCompleted) |
Adds the Item information(file etc) to processing queue.
|
void |
clearQueues() |
Clear the queues from to be storage movement needed lists and items tracked
in storage movement monitor.
|
BlockStorageMovementAttemptedItems |
getAttemptedItemsMonitor() |
|
org.apache.hadoop.conf.Configuration |
getConf() |
|
BlockStorageMovementNeeded |
getStorageMovementQueue() |
|
void |
init(Context context) |
Initializes the helper services.
|
boolean |
isRunning() |
Check whether StoragePolicySatisfier is running.
|
void |
join() |
Join main SPS thread.
|
void |
markScanCompletedForPath(long inodeId) |
Marks the scanning of directory if finished.
|
void |
notifyStorageMovementAttemptFinishedBlk(org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo,
org.apache.hadoop.fs.StorageType storageType,
org.apache.hadoop.hdfs.protocol.Block block) |
Receives storage movement attempt finished block report.
|
int |
processingQueueSize() |
|
void |
run() |
|
void |
start(org.apache.hadoop.hdfs.protocol.HdfsConstants.StoragePolicySatisfierMode serviceMode) |
Start storage policy satisfier demon thread.
|
void |
stop(boolean forceStop) |
Stops the SPS service.
|
void |
stopGracefully() |
Stops the SPS service gracefully.
|
public StoragePolicySatisfier(org.apache.hadoop.conf.Configuration conf)
public void init(Context context)
SPSServiceinit in interface SPSServicecontext - - context is an helper service to provide communication channel
between NN and SPSpublic void start(org.apache.hadoop.hdfs.protocol.HdfsConstants.StoragePolicySatisfierMode serviceMode)
start in interface SPSServiceserviceMode - sps service modepublic void stop(boolean forceStop)
SPSServicestop in interface SPSServiceforceStop - true represents to clear all the sps path's hint, false otherwise.public void stopGracefully()
SPSServicestopGracefully in interface SPSServicepublic boolean isRunning()
SPSServiceisRunning in interface SPSServicepublic void run()
run in interface java.lang.Runnablepublic void notifyStorageMovementAttemptFinishedBlk(org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo,
org.apache.hadoop.fs.StorageType storageType,
org.apache.hadoop.hdfs.protocol.Block block)
notifyStorageMovementAttemptFinishedBlk in interface SPSServicednInfo - reported datanodestorageType - - storage typeblock - movement attempt finished block.@VisibleForTesting public BlockStorageMovementAttemptedItems getAttemptedItemsMonitor()
public void clearQueues()
public void addFileToProcess(ItemInfo trackInfo, boolean scanCompleted)
SPSServiceaddFileToProcess in interface SPSServicetrackInfo - file info object for which need to satisfy the policypublic void addAllFilesToProcess(long startPath,
java.util.List<ItemInfo> itemInfoList,
boolean scanCompleted)
SPSServiceaddAllFilesToProcess in interface SPSServicestartPath - - directoryId/fileId, on which SPS was called.itemInfoList - - list of item infosscanCompleted - - whether the scanning of directory fully done with itemInfoListpublic int processingQueueSize()
processingQueueSize in interface SPSServicepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface SPSService@VisibleForTesting public BlockStorageMovementNeeded getStorageMovementQueue()
public void markScanCompletedForPath(long inodeId)
SPSServicemarkScanCompletedForPath in interface SPSServiceinodeId - - satisfier path idpublic void join()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.