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 Type
    Method
    Description
    void
    addAllFilesToProcess(long startPathId, List<ItemInfo> itemInfoList, boolean scanCompleted)
    Adds all the Item information(file etc) to processing queue.
    void
    addFileToProcess(ItemInfo itemInfo, boolean scanCompleted)
    Adds the Item information(file etc) to processing queue.
    org.apache.hadoop.conf.Configuration
     
    void
    init(Context ctxt)
    Initializes the helper services.
    boolean
    Check whether StoragePolicySatisfier is running.
    void
    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)
    Given node is reporting that it received a certain movement attempt finished block.
    int
     
    void
    start(org.apache.hadoop.hdfs.protocol.HdfsConstants.StoragePolicySatisfierMode spsMode)
    Starts the SPS service.
    void
    stop(boolean forceStop)
    Stops the SPS service.
    void
    Stops the SPS service gracefully.
  • Method Details

    • init

      void init(Context ctxt)
      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

      void addFileToProcess(ItemInfo itemInfo, boolean scanCompleted)
      Adds the Item information(file etc) to processing queue.
      Parameters:
      itemInfo - file info object for which need to satisfy the policy
    • addAllFilesToProcess

      void addAllFilesToProcess(long startPathId, List<ItemInfo> itemInfoList, boolean scanCompleted)
      Adds all the Item information(file etc) to processing queue.
      Parameters:
      startPathId - - directoryId/fileId, on which SPS was called.
      itemInfoList - - list of item infos
      scanCompleted - - 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 datanode
      storageType - - storage type
      block - - block that is attempted to move