org.apache.hadoop.fs

## Class ContentSummary

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

- All Implemented Interfaces:
    Writable

      @InterfaceAudience.Public
       @InterfaceStability.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 and 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 and 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

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object to)`
    `long` | `getDirectoryCount()`
    `String` | `getErasureCodingPolicy()`
    `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()`
    `long` | `getSnapshotLength()`
    `long` | `getSnapshotSpaceConsumed()`
    `int` | `hashCode()`
    `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.

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

    - ### Methods inherited from interface org.apache.hadoop.io.Writable

      `readFields, write`

- - ### Constructor Detail

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

    - #### ContentSummary

          @Deprecated
          public ContentSummary(long length,
                                            long fileCount,
                                            long directoryCount,
                                            long quota,
                                            long spaceConsumed,
                                            long spaceQuota)

      Deprecated.
      Constructor, deprecated by ContentSummary.Builder

  - ### Method Detail

    - #### 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()

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

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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.