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.
  • 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:
    • SPACE_QUOTA_STRING_FORMAT

      protected static final String SPACE_QUOTA_STRING_FORMAT
      See Also:
    • 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(org.apache.hadoop.fs.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