Package org.apache.hadoop.fs
Class ContentSummary
java.lang.Object
org.apache.hadoop.fs.QuotaUsage
org.apache.hadoop.fs.ContentSummary
- All Implemented Interfaces:
Writable
Store the summary of a content (a directory or a file).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.fs.ContentSummary.BuilderWe don't use generics. -
Field Summary
Fields inherited from class org.apache.hadoop.fs.QuotaUsage
QUOTA_HEADER, QUOTA_HEADER_FIELDS, QUOTA_STRING_FORMAT, SPACE_QUOTA_STRING_FORMAT -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ContentSummary(long length, long fileCount, long directoryCount) Deprecated.ContentSummary(long length, long fileCount, long directoryCount, long quota, long spaceConsumed, long spaceQuota) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongstatic Stringlongstatic StringgetHeader(boolean qOption) Return the header of the output.static String[]Returns the names of the fields from the summary header.longstatic String[]Returns the names of the fields used in the quota summary.longlongstatic StringlonglonginthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.toSnapshot(boolean hOption) Return the string representation of the snapshot counts in the output format.toString()toString(boolean qOption) Return the string representation of the object in the output format.toString(boolean qOption, boolean hOption) Return the string representation of the object in the output format.toString(boolean qOption, boolean hOption, boolean xOption) Return the string representation of the object in the output format.toString(boolean qOption, boolean hOption, boolean tOption, boolean xOption, List<StorageType> types) Return the string representation of the object in the output format.toString(boolean qOption, boolean hOption, boolean tOption, List<StorageType> types) Return the string representation of the object in the output format.voidwrite(DataOutput out) Serialize the fields of this object toout.Methods inherited from class org.apache.hadoop.fs.QuotaUsage
getFileAndDirectoryCount, getHeader, getQuota, getQuotaUsage, getSpaceConsumed, getSpaceQuota, getStorageTypeHeader, getTypeConsumed, getTypeQuota, getTypesQuotaUsage, isTypeConsumedAvailable, isTypeQuotaSet, setQuota, setSpaceConsumed, setSpaceQuota, toString
-
Constructor Details
-
ContentSummary
Deprecated.Constructor deprecated by ContentSummary.Builder -
ContentSummary
Deprecated.Constructor, deprecated by ContentSummary.Builder This constructor implicitly set spaceConsumed the same as length. spaceConsumed and length must be set explicitly with ContentSummary.Builder.- Parameters:
length- length.fileCount- file count.directoryCount- directory count.
-
ContentSummary
@Deprecated public ContentSummary(long length, long fileCount, long directoryCount, long quota, long spaceConsumed, long spaceQuota) Deprecated.Constructor, deprecated by ContentSummary.Builder.- Parameters:
length- length.fileCount- file count.directoryCount- directory count.quota- quota.spaceConsumed- space consumed.spaceQuota- space quota.
-
-
Method Details
-
getLength
public long getLength()- Returns:
- the length
-
getSnapshotLength
public long getSnapshotLength() -
getDirectoryCount
public long getDirectoryCount()- Returns:
- the directory count
-
getSnapshotDirectoryCount
public long getSnapshotDirectoryCount() -
getFileCount
public long getFileCount()- Returns:
- the file count
-
getSnapshotFileCount
public long getSnapshotFileCount() -
getSnapshotSpaceConsumed
public long getSnapshotSpaceConsumed() -
getErasureCodingPolicy
-
write
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
equals
- Overrides:
equalsin classQuotaUsage
-
hashCode
public int hashCode()- Overrides:
hashCodein classQuotaUsage
-
getHeader
Return the header of the output. if qOption is false, output directory count, file count, and content size; if qOption is true, output quota and remaining quota as well.- Parameters:
qOption- a flag indicating if quota needs to be printed or not- Returns:
- the header of the output
-
getErasureCodingPolicyHeader
-
getSnapshotHeader
-
getHeaderFields
Returns the names of the fields from the summary header.- Returns:
- names of fields as displayed in the header
-
getQuotaHeaderFields
Returns the names of the fields used in the quota summary.- Returns:
- names of quota fields as displayed in the header
-
toString
- Overrides:
toStringin classQuotaUsage
-
toString
Return the string representation of the object in the output format. if qOption is false, output directory count, file count, and content size; if qOption is true, output quota and remaining quota as well.- Overrides:
toStringin classQuotaUsage- Parameters:
qOption- a flag indicating if quota needs to be printed or not- Returns:
- the string representation of the object
-
toString
Return the string representation of the object in the output format. For description of the options,- Parameters:
qOption- a flag indicating if quota needs to be printed or nothOption- a flag indicating if human readable output if to be used- Returns:
- the string representation of the object
- See Also:
-
toString
Return the string representation of the object in the output format. For description of the options,- Parameters:
qOption- a flag indicating if quota needs to be printed or nothOption- a flag indicating if human readable output is to be usedxOption- a flag indicating if calculation from snapshots is to be included in the output- Returns:
- the string representation of the object
- See Also:
-
toString
Return the string representation of the object in the output format. For description of the options,- Parameters:
qOption- a flag indicating if quota needs to be printed or nothOption- a flag indicating if human readable output if to be usedtOption- a flag indicating if display quota by storage typestypes- Storage types to display- Returns:
- the string representation of the object
- See Also:
-
toString
public String toString(boolean qOption, boolean hOption, boolean tOption, boolean xOption, List<StorageType> types) Return the string representation of the object in the output format. if qOption is false, output directory count, file count, and content size; if qOption is true, output quota and remaining quota as well. if hOption is false, file sizes are returned in bytes if hOption is true, file sizes are returned in human readable if tOption is true, display the quota by storage types if tOption is false, same logic with #toString(boolean,boolean) if xOption is false, output includes the calculation from snapshots if xOption is true, output excludes the calculation from snapshots- Parameters:
qOption- a flag indicating if quota needs to be printed or nothOption- a flag indicating if human readable output is to be usedtOption- a flag indicating if display quota by storage typesxOption- a flag indicating if calculation from snapshots is to be included in the outputtypes- Storage types to display- Returns:
- the string representation of the object
-
toErasureCodingPolicy
- Returns:
- Constant-width String representation of Erasure Coding Policy
-
toSnapshot
Return the string representation of the snapshot counts in the output format.- Parameters:
hOption- flag indicating human readable or not- Returns:
- String representation of the snapshot counts
-