QuotaUsage (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs, class: QuotaUsage

Package org.apache.hadoop.fs

# Class QuotaUsage

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

Direct Known Subclasses:
  `ContentSummary`

@Public @Evolving public class QuotaUsage extends Object
Store the quota usage of a directory.

- ## Nested Class Summary

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

- ## Field Summary

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

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `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 Details

  - ### QUOTA_STRING_FORMAT

    protected static final String QUOTA_STRING_FORMAT
    Output format: |----12----| |----15----| |----15----| |----15----| |-------18-------| QUOTA REMAINING_QUOTA 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 Details

  - ### QuotaUsage

    protected QuotaUsage()

  - ### QuotaUsage

    protected QuotaUsage(QuotaUsage.Builder builder)
    Build the instance based on the builder.
    Parameters:
      `builder` - bulider.

- ## Method Details

  - ### 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.
    Returns:
      file and directory count.

  - ### getQuota

    public long getQuota()
    Return the directory quota.
    Returns:
      quota.

  - ### getSpaceConsumed

    public long getSpaceConsumed()
    Return (disk) space consumed.
    Returns:
      space consumed.

  - ### getSpaceQuota

    public long getSpaceQuota()
    Return (disk) space quota.
    Returns:
      space quota.

  - ### getTypeQuota

    public long getTypeQuota(StorageType type)
    Return storage type quota.
    Parameters:
      `type` - storage type.
    Returns:
      type quota.

  - ### getTypeConsumed

    public long getTypeConsumed(StorageType type)
    Return storage type consumed.
    Parameters:
      `type` - storage type.
    Returns:
      type consumed.

  - ### isTypeQuotaSet

    public boolean isTypeQuotaSet()
    Return true if any storage type quota has been set.
    Returns:
      if any storage type quota has been set true, not false.

  - ### isTypeConsumedAvailable

    public boolean isTypeConsumedAvailable()
    Return true if any storage type consumption information is available.
    Returns:
      if any storage type consumption information is available, not false.

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` 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
      `tOption` - type option.
      `types` - storage types.
    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` - storage types.
    Returns:
      storage header string