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

Package org.apache.hadoop.fs

# Class ContentSummary

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

All Implemented Interfaces:
  `Writable`

@Public @Evolving public class ContentSummary extends QuotaUsage implements Writable
Store the summary of a content (a directory or a file).

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ContentSummary.Builder`
  We 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

  Constructors
  Constructor
  Description
  `ContentSummary()`
  Deprecated.
  `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 Type
  Method
  Description
  `boolean`
  `equals(Object to)`
  `long`
  `getDirectoryCount()`
  `String`
  `getErasureCodingPolicy()`
  `static String`
  `getErasureCodingPolicyHeader()`
  `long`
  `getFileCount()`
  `static String`
  `getHeader(boolean qOption)`
  Return the header of the output.
  `static String[]`
  `getHeaderFields()`
  Returns the names of the fields from the summary header.
  `long`
  `getLength()`
  `static String[]`
  `getQuotaHeaderFields()`
  Returns the names of the fields used in the quota summary.
  `long`
  `getSnapshotDirectoryCount()`
  `long`
  `getSnapshotFileCount()`
  `static String`
  `getSnapshotHeader()`
  `long`
  `getSnapshotLength()`
  `long`
  `getSnapshotSpaceConsumed()`
  `int`
  `hashCode()`
  `void`
  `readFields(DataInput in)`
  Deserialize the fields of this object from `in`.
  `String`
  `toErasureCodingPolicy()`
  `String`
  `toSnapshot(boolean hOption)`
  Return the string representation of the snapshot counts in the output format.
  `String`
  `toString()`
  `String`
  `toString(boolean qOption)`
  Return the string representation of the object in the output format.
  `String`
  `toString(boolean qOption, boolean hOption)`
  Return the string representation of the object in the output format.
  `String`
  `toString(boolean qOption, boolean hOption, boolean xOption)`
  Return the string representation of the object in the output format.
  `String`
  `toString(boolean qOption, boolean hOption, boolean tOption, boolean xOption, List<StorageType> types)`
  Return the string representation of the object in the output format.
  `String`
  `toString(boolean qOption, boolean hOption, boolean tOption, List<StorageType> types)`
  Return the string representation of the object in the output format.
  `void`
  `write(DataOutput out)`
  Serialize the fields of this object to `out`.

  ### 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`

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

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

- ## Constructor Details

  - ### ContentSummary

    @Deprecated public ContentSummary()
    Deprecated.
    Constructor deprecated by ContentSummary.Builder

  - ### ContentSummary

    @Deprecated public ContentSummary(long length, long fileCount, long directoryCount)
    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

    public String getErasureCodingPolicy()

  - ### write

    @Private public void write(DataOutput out) throws IOException
    Description copied from interface: `Writable`
    Serialize the fields of this object to `out`.
    Specified by:
      `write` in interface `Writable`
    Parameters:
      `out` - `DataOuput` to serialize this object into.
    Throws:
      `IOException` - any other problem for write.

  - ### readFields

    @Private public void readFields(DataInput in) throws IOException
    Description copied from interface: `Writable`
    Deserialize the fields of this object from `in`.

    For efficiency, implementations should attempt to re-use storage in the existing object where possible.

    Specified by:
      `readFields` in interface `Writable`
    Parameters:
      `in` - `DataInput` to deseriablize this object from.
    Throws:
      `IOException` - any other problem for readFields.

  - ### equals

    public boolean equals(Object to)
    Overrides:
      `equals` in class `QuotaUsage`

  - ### hashCode

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

  - ### getHeader

    public static String getHeader(boolean qOption)
    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

    public static String getErasureCodingPolicyHeader()

  - ### getSnapshotHeader

    public static String getSnapshotHeader()

  - ### getHeaderFields

    public static String[] getHeaderFields()
    Returns the names of the fields from the summary header.
    Returns:
      names of fields as displayed in the header

  - ### getQuotaHeaderFields

    public static String[] getQuotaHeaderFields()
    Returns the names of the fields used in the quota summary.
    Returns:
      names of quota fields as displayed in the header

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `QuotaUsage`

  - ### toString

    public String toString(boolean qOption)
    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:
      `toString` in class `QuotaUsage`
    Parameters:
      `qOption` - a flag indicating if quota needs to be printed or not
    Returns:
      the string representation of the object

  - ### toString

    public String toString(boolean qOption, boolean hOption)
    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 not
      `hOption` - a flag indicating if human readable output if to be used
    Returns:
      the string representation of the object
    See Also:
      - `toString(boolean, boolean, boolean, boolean, List)`

  - ### toString

    public String toString(boolean qOption, boolean hOption, boolean xOption)
    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 not
      `hOption` - a flag indicating if human readable output is to be used
      `xOption` - a flag indicating if calculation from snapshots is to be included in the output
    Returns:
      the string representation of the object
    See Also:
      - `toString(boolean, boolean, boolean, boolean, List)`

  - ### toString

    public String toString(boolean qOption, boolean hOption, boolean tOption, List<StorageType> types)
    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 not
      `hOption` - a flag indicating if human readable output if to be used
      `tOption` - a flag indicating if display quota by storage types
      `types` - Storage types to display
    Returns:
      the string representation of the object
    See Also:
      - `toString(boolean, boolean, boolean, boolean, List)`

  - ### 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 not
      `hOption` - a flag indicating if human readable output is to be used
      `tOption` - a flag indicating if display quota by storage types
      `xOption` - a flag indicating if calculation from snapshots is to be included in the output
      `types` - Storage types to display
    Returns:
      the string representation of the object

  - ### toErasureCodingPolicy

    public String toErasureCodingPolicy()
    Returns:
      Constant-width String representation of Erasure Coding Policy

  - ### toSnapshot

    public String toSnapshot(boolean hOption)
    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