Class CacheReplicationMonitor

java.lang.Object
java.lang.Thread
org.apache.hadoop.util.concurrent.SubjectInheritingThread
org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor
All Implemented Interfaces:
Closeable, AutoCloseable, Runnable

@LimitedPrivate("HDFS") public class CacheReplicationMonitor extends org.apache.hadoop.util.concurrent.SubjectInheritingThread implements Closeable
Scans the namesystem, scheduling blocks to be cached as appropriate. The CacheReplicationMonitor does a full scan when the NameNode first starts up, and at configurable intervals afterwards.
  • Constructor Details

  • Method Details

    • work

      public void work()
      Overrides:
      work in class org.apache.hadoop.util.concurrent.SubjectInheritingThread
    • waitForRescanIfNeeded

      public void waitForRescanIfNeeded()
      Waits for a rescan to complete. This doesn't guarantee consistency with pending operations, only relative recency, since it will not force a new rescan if a rescan is already underway.

      Note that this call will release the FSN lock, so operations before and after are not atomic.

    • setNeedsRescan

      public void setNeedsRescan()
      Indicates to the CacheReplicationMonitor that there have been CacheManager changes that require a rescan.
    • close

      public void close() throws IOException
      Shut down the monitor thread.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException