DatanodeCacheManager (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.namenode.sps, class: DatanodeCacheManager

Package org.apache.hadoop.hdfs.server.namenode.sps

# Class DatanodeCacheManager

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.sps.DatanodeCacheManager

@Private public class DatanodeCacheManager extends Object
The Datanode cache Manager handles caching of `DatanodeStorageReport`. This class is instantiated by StoragePolicySatisifer. It maintains the array of datanode storage reports. It has a configurable refresh interval and periodically refresh the datanode cache by fetching latest `Context.getLiveDatanodeStorageReport()` once it reaches refresh interval.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DatanodeCacheManager(org.apache.hadoop.conf.Configuration conf)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `StoragePolicySatisfier.DatanodeMap`
  `getLiveDatanodeStorageReport(Context spsContext)`
  Returns the live datanodes and its storage details, which has available space (> 0) to schedule block moves.

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

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

- ## Constructor Details

  - ### DatanodeCacheManager

    public DatanodeCacheManager(org.apache.hadoop.conf.Configuration conf)

- ## Method Details

  - ### getLiveDatanodeStorageReport

    public StoragePolicySatisfier.DatanodeMap getLiveDatanodeStorageReport(Context spsContext) throws IOException
    Returns the live datanodes and its storage details, which has available space (> 0) to schedule block moves. This will return array of datanodes from its local cache. It has a configurable refresh interval in millis and periodically refresh the datanode cache by fetching latest `Context.getLiveDatanodeStorageReport()` once it elapsed refresh interval.
    Throws:
      `IOException`