org.apache.hadoop.fs

## Class QuotaUsage

- java.lang.Object
- - org.apache.hadoop.fs.QuotaUsage

- Direct Known Subclasses:
    ContentSummary

      @InterfaceAudience.Public
       @InterfaceStability.Evolving
      public class QuotaUsage
      extends Object

  Store the quota usage of a directory.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `QuotaUsage.Builder` Builder class for QuotaUsage.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `QUOTA_HEADER`
    `protected static String[]` | `QUOTA_HEADER_FIELDS`
    `protected static String` | `QUOTA_STRING_FORMAT` Output format: <----12----> <----15----> <----15----> <----15----> <-------18-------> QUOTA REMAINING_QUATA SPACE_QUOTA SPACE_QUOTA_REM FILE_NAME
    `protected static String` | `SPACE_QUOTA_STRING_FORMAT`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `QuotaUsage()`
    `protected` | `QuotaUsage(QuotaUsage.Builder builder)` Build the instance based on the builder.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object to)`
    `long` | `getFileAndDirectoryCount()` Return the directory count.
    `static String` | `getHeader()` Return the header of the output.
    `long` | `getQuota()` Return the directory quota.
    `protected String` | `getQuotaUsage(boolean hOption)`
    `long` | `getSpaceConsumed()` Return (disk) space consumed.
    `long` | `getSpaceQuota()` Return (disk) space quota.
    `static String` | `getStorageTypeHeader(List<StorageType> storageTypes)` return the header of with the StorageTypes.
    `long` | `getTypeConsumed(StorageType type)` Return storage type consumed.
    `long` | `getTypeQuota(StorageType type)` Return storage type quota.
    `protected String` | `getTypesQuotaUsage(boolean hOption, List<StorageType> types)`
    `int` | `hashCode()`
    `boolean` | `isTypeConsumedAvailable()` Return true if any storage type consumption information is available.
    `boolean` | `isTypeQuotaSet()` Return true if any storage type quota has been set.
    `protected void` | `setQuota(long quota)`
    `protected void` | `setSpaceConsumed(long spaceConsumed)`
    `protected void` | `setSpaceQuota(long spaceQuota)`
    `String` | `toString()`
    `String` | `toString(boolean hOption)`
    `String` | `toString(boolean hOption, boolean tOption, List<StorageType> types)` Return the string representation of the object in the output format.

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### QUOTA_STRING_FORMAT

          protected static final String QUOTA_STRING_FORMAT

      Output format: <----12----> <----15----> <----15----> <----15----> <-------18-------> QUOTA REMAINING_QUATA SPACE_QUOTA SPACE_QUOTA_REM FILE_NAME
      See Also:
        Constant Field Values

    - #### SPACE_QUOTA_STRING_FORMAT

          protected static final String SPACE_QUOTA_STRING_FORMAT

      See Also:
        Constant Field Values

    - #### QUOTA_HEADER_FIELDS

          protected static final String[] QUOTA_HEADER_FIELDS

    - #### QUOTA_HEADER

          protected static final String QUOTA_HEADER

  - ### Constructor Detail

    - #### QuotaUsage

          protected QuotaUsage()

    - #### QuotaUsage

          protected QuotaUsage(QuotaUsage.Builder builder)

      Build the instance based on the builder.

  - ### Method Detail

    - #### setQuota

          protected void setQuota(long quota)

    - #### setSpaceConsumed

          protected void setSpaceConsumed(long spaceConsumed)

    - #### setSpaceQuota

          protected void setSpaceQuota(long spaceQuota)

    - #### getFileAndDirectoryCount

          public long getFileAndDirectoryCount()

      Return the directory count.

    - #### getQuota

          public long getQuota()

      Return the directory quota.

    - #### getSpaceConsumed

          public long getSpaceConsumed()

      Return (disk) space consumed.

    - #### getSpaceQuota

          public long getSpaceQuota()

      Return (disk) space quota.

    - #### getTypeQuota

          public long getTypeQuota(StorageType type)

      Return storage type quota.

    - #### getTypeConsumed

          public long getTypeConsumed(StorageType type)

      Return storage type consumed.

    - #### isTypeQuotaSet

          public boolean isTypeQuotaSet()

      Return true if any storage type quota has been set.

    - #### isTypeConsumedAvailable

          public boolean isTypeConsumedAvailable()

      Return true if any storage type consumption information is available.

    - #### equals

          public boolean equals(Object to)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getHeader

          public static String getHeader()

      Return the header of the output.
      Returns:
        the header of the output

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(boolean hOption)

    - #### toString

          public String toString(boolean hOption,
                                 boolean tOption,
                                 List<StorageType> types)

      Return the string representation of the object in the output format. if hOption is false file sizes are returned in bytes if hOption is true file sizes are returned in human readable
      Parameters:
        `hOption` - a flag indicating if human readable output if to be used
      Returns:
        the string representation of the object

    - #### getQuotaUsage

          protected String getQuotaUsage(boolean hOption)

    - #### getTypesQuotaUsage

          protected String getTypesQuotaUsage(boolean hOption,
                                              List<StorageType> types)

    - #### getStorageTypeHeader

          public static String getStorageTypeHeader(List<StorageType> storageTypes)

      return the header of with the StorageTypes.
      Parameters:
        `storageTypes` -
      Returns:
        storage header string

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