org.apache.hadoop.hdfs.server.datanode

## Class DirectoryScanner.ReportCompiler

- java.lang.Object
- - org.apache.hadoop.hdfs.server.datanode.DirectoryScanner.ReportCompiler

- All Implemented Interfaces:
    Callable<org.apache.hadoop.hdfs.server.datanode.DirectoryScanner.ScanInfoPerBlockPool>
  Enclosing class:
    org.apache.hadoop.hdfs.server.datanode.DirectoryScanner

      public class DirectoryScanner.ReportCompiler
      extends Object
      implements Callable<org.apache.hadoop.hdfs.server.datanode.DirectoryScanner.ScanInfoPerBlockPool>

  The ReportCompiler class encapsulates the process of searching a datanode's disks for block information. It operates by performing a DFS of the volume to discover block information. When the ReportCompiler discovers block information, it create a new ScanInfo object for it and adds that object to its report list. The report list is returned by the `call()` method.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReportCompiler(org.apache.hadoop.hdfs.server.datanode.DataNode datanode, FsVolumeSpi volume)` Create a report compiler for the given volume on the given datanode.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.hadoop.hdfs.server.datanode.DirectoryScanner.ScanInfoPerBlockPool` | `call()` Run this report compiler thread.
    `void` | `throttle()` Called by the thread before each potential disk scan so that a pause can be optionally inserted to limit the number of scans per second.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReportCompiler

          public ReportCompiler(org.apache.hadoop.hdfs.server.datanode.DataNode datanode,
                                FsVolumeSpi volume)

      Create a report compiler for the given volume on the given datanode.
      Parameters:
        `datanode` - the target datanode
        `volume` - the target volume

  - ### Method Detail

    - #### call

          public org.apache.hadoop.hdfs.server.datanode.DirectoryScanner.ScanInfoPerBlockPool call()
                                                                                            throws IOException

      Run this report compiler thread.
      Specified by:
        `call` in interface `Callable<org.apache.hadoop.hdfs.server.datanode.DirectoryScanner.ScanInfoPerBlockPool>`
      Returns:
        the block info report list
      Throws:
        `IOException` - if the block pool isn't found

    - #### throttle

          public void throttle()
                        throws InterruptedException

      Called by the thread before each potential disk scan so that a pause can be optionally inserted to limit the number of scans per second. The limit is controlled by `DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_THROTTLE_LIMIT_MS_PER_SEC_KEY`.
      Throws:
        `InterruptedException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.