Class BlockScanner

java.lang.Object
org.apache.hadoop.hdfs.server.datanode.BlockScanner

@Private public class BlockScanner extends Object
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • BlockScanner

      public BlockScanner(DataNode datanode)
    • BlockScanner

      public BlockScanner(DataNode datanode, org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns true if the block scanner is enabled. If the block scanner is disabled, no volume scanners will be created, and no threads will start.
    • hasAnyRegisteredScanner

      public boolean hasAnyRegisteredScanner()
      Returns true if there is any scanner thread registered.
    • addVolumeScanner

      public void addVolumeScanner(FsVolumeReference ref)
      Set up a scanner for the given block pool and volume.
      Parameters:
      ref - A reference to the volume.
    • removeVolumeScanner

      public void removeVolumeScanner(FsVolumeSpi volume)
      Stops and removes a volume scanner. This function will block until the volume scanner has stopped.
      Parameters:
      volume - The volume to remove.
    • removeAllVolumeScanners

      public void removeAllVolumeScanners()
      Stops and removes all volume scanners. This function is called on shutdown. It will return even if some of the scanners don't terminate in time. Since the scanners are daemon threads and do not alter the block content, it is safe to ignore such conditions on shutdown.
    • getJoinVolumeScannersTimeOutMs

      public long getJoinVolumeScannersTimeOutMs()
    • setJoinVolumeScannersTimeOutMs

      public void setJoinVolumeScannersTimeOutMs(long joinScannersTimeOutMs)