Package org.apache.hadoop.fs
Class QuotaUsage
java.lang.Object
org.apache.hadoop.fs.QuotaUsage
- Direct Known Subclasses:
ContentSummary
Store the quota usage of a directory.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.fs.QuotaUsage.BuilderBuilder class for QuotaUsage. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final String[]protected static final StringOutput format: |----12----| |----15----| |----15----| |----15----| |-------18-------| QUOTA REMAINING_QUOTA SPACE_QUOTA SPACE_QUOTA_REM FILE_NAMEprotected static final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedQuotaUsage(org.apache.hadoop.fs.QuotaUsage.Builder builder) Build the instance based on the builder. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongReturn the directory count.static StringReturn the header of the output.longgetQuota()Return the directory quota.protected StringgetQuotaUsage(boolean hOption) longReturn (disk) space consumed.longReturn (disk) space quota.static StringgetStorageTypeHeader(List<StorageType> storageTypes) return the header of with the StorageTypes.longgetTypeConsumed(StorageType type) Return storage type consumed.longgetTypeQuota(StorageType type) Return storage type quota.protected StringgetTypesQuotaUsage(boolean hOption, List<StorageType> types) inthashCode()booleanReturn true if any storage type consumption information is available.booleanReturn true if any storage type quota has been set.protected voidsetQuota(long quota) protected voidsetSpaceConsumed(long spaceConsumed) protected voidsetSpaceQuota(long spaceQuota) toString()toString(boolean hOption) toString(boolean hOption, boolean tOption, List<StorageType> types) Return the string representation of the object in the output format.
-
Field Details
-
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
- See Also:
-
QUOTA_HEADER_FIELDS
-
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
Return storage type quota.- Parameters:
type- storage type.- Returns:
- type quota.
-
getTypeConsumed
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() -
equals
-
getHeader
Return the header of the output.- Returns:
- the header of the output
-
toString
-
toString
-
toString
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 usedtOption- type option.types- storage types.- Returns:
- the string representation of the object.
-
getQuotaUsage
-
getTypesQuotaUsage
-
getStorageTypeHeader
return the header of with the StorageTypes.- Parameters:
storageTypes- storage types.- Returns:
- storage header string
-