org.apache.hadoop.yarn.server.nodemanager

## Class DirectoryCollection

- java.lang.Object
- - org.apache.hadoop.yarn.server.nodemanager.DirectoryCollection

-     public class DirectoryCollection
      extends Object

  Manages a list of local storage directories.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `DirectoryCollection.DirsChangeListener` The interface provides a callback when localDirs is changed.
    `static class` | `DirectoryCollection.DiskErrorCause` The enum defines disk failure type.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirectoryCollection(String[] dirs)` Create collection for the directories specified.
    `DirectoryCollection(String[] dirs, float utilizationPercentageCutOff)` Create collection for the directories specified.
    `DirectoryCollection(String[] dirs, float utilizationPercentageCutOffHigh, float utilizationPercentageCutOffLow, long utilizationSpaceCutOff)` Create collection for the directories specified.
    `DirectoryCollection(String[] dirs, float utilizationPercentageCutOffHigh, float utilizationPercentageCutOffLow, long utilizationSpaceCutOffLow, long utilizationSpaceCutOffHigh)` Create collection for the directories specified.
    `DirectoryCollection(String[] dirs, long utilizationSpaceCutOff)` Create collection for the directories specified.
    `DirectoryCollection(String[] dirs, long utilizationSpaceCutOffLow, long utilizationSpaceCutOffHigh)` Create collection for the directories specified.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getDiskUtilizationSpaceCutoff()`
    `int` | `getGoodDirsDiskUtilizationPercentage()`
    `void` | `setDiskUtilizationPercentageCutoff(float utilizationPercentageCutOffHigh, float utilizationPercentageCutOffLow)`
    `void` | `setDiskUtilizationSpaceCutoff(long freeSpaceCutoff)`
    `void` | `setDiskUtilizationSpaceCutoff(long freeSpaceCutoffLow, long freeSpaceCutoffHigh)`

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

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

- - ### Constructor Detail

    - #### DirectoryCollection

          public DirectoryCollection(String[] dirs)

      Create collection for the directories specified. No check for free space.
      Parameters:
        `dirs` - directories to be monitored

    - #### DirectoryCollection

          public DirectoryCollection(String[] dirs,
                                     float utilizationPercentageCutOff)

      Create collection for the directories specified. Users must specify the maximum percentage of disk utilization allowed. Minimum amount of disk space is not checked.
      Parameters:
        `dirs` - directories to be monitored
        `utilizationPercentageCutOff` - percentage of disk that can be used before the dir is taken out of the good dirs list

    - #### DirectoryCollection

          public DirectoryCollection(String[] dirs,
                                     long utilizationSpaceCutOff)

      Create collection for the directories specified. Users must specify the minimum amount of free space that must be available for the dir to be used.
      Parameters:
        `dirs` - directories to be monitored
        `utilizationSpaceCutOff` - minimum space, in MB, that must be available on the disk for the dir to be marked as good

    - #### DirectoryCollection

          public DirectoryCollection(String[] dirs,
                                     long utilizationSpaceCutOffLow,
                                     long utilizationSpaceCutOffHigh)

      Create collection for the directories specified. Users must specify the minimum amount of free space that must be available for the dir to be used.
      Parameters:
        `dirs` - directories to be monitored
        `utilizationSpaceCutOffLow` - minimum space, in MB, that must be available on the disk for the dir to be taken out of the good dirs list
        `utilizationSpaceCutOffHigh` - minimum space, in MB, that must be available on the disk for the dir to be moved from the bad dirs list to the good dirs list

    - #### DirectoryCollection

          public DirectoryCollection(String[] dirs,
                                     float utilizationPercentageCutOffHigh,
                                     float utilizationPercentageCutOffLow,
                                     long utilizationSpaceCutOff)

      Create collection for the directories specified. Users must specify the maximum percentage of disk utilization allowed and the minimum amount of free space that must be available for the dir to be used. If either check fails the dir is removed from the good dirs list.
      Parameters:
        `dirs` - directories to be monitored
        `utilizationPercentageCutOffHigh` - percentage of disk that can be used before the dir is taken out of the good dirs list
        `utilizationPercentageCutOffLow` - percentage of disk that can be used when the dir is moved from the bad dirs list to the good dirs list
        `utilizationSpaceCutOff` - minimum space, in MB, that must be available on the disk for the dir to be marked as good

    - #### DirectoryCollection

          public DirectoryCollection(String[] dirs,
                                     float utilizationPercentageCutOffHigh,
                                     float utilizationPercentageCutOffLow,
                                     long utilizationSpaceCutOffLow,
                                     long utilizationSpaceCutOffHigh)

      Create collection for the directories specified. Users must specify the maximum percentage of disk utilization allowed and the minimum amount of free space that must be available for the dir to be used. If either check fails the dir is removed from the good dirs list.
      Parameters:
        `dirs` - directories to be monitored
        `utilizationPercentageCutOffHigh` - percentage of disk that can be used before the dir is taken out of the good dirs list
        `utilizationPercentageCutOffLow` - percentage of disk that can be used when the dir is moved from the bad dirs list to the good dirs list
        `utilizationSpaceCutOffLow` - minimum space, in MB, that must be available on the disk for the dir to be taken out of the good dirs list
        `utilizationSpaceCutOffHigh` - minimum space, in MB, that must be available on the disk for the dir to be moved from the bad dirs list to the good dirs list

  - ### Method Detail

    - #### setDiskUtilizationPercentageCutoff

          public void setDiskUtilizationPercentageCutoff(float utilizationPercentageCutOffHigh,
                                                         float utilizationPercentageCutOffLow)

    - #### getDiskUtilizationSpaceCutoff

          public long getDiskUtilizationSpaceCutoff()

    - #### setDiskUtilizationSpaceCutoff

          public void setDiskUtilizationSpaceCutoff(long freeSpaceCutoff)

    - #### setDiskUtilizationSpaceCutoff

          public void setDiskUtilizationSpaceCutoff(long freeSpaceCutoffLow,
                                                    long freeSpaceCutoffHigh)

    - #### getGoodDirsDiskUtilizationPercentage

          public int getGoodDirsDiskUtilizationPercentage()

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