ContentSummaryComputationContext (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.namenode, class: ContentSummaryComputationContext

Package org.apache.hadoop.hdfs.server.namenode

# Class ContentSummaryComputationContext

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ContentSummaryComputationContext

@Private @Unstable public class ContentSummaryComputationContext extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final org.slf4j.Logger`
  `LOG`
  `static final String`
  `REPLICATED`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContentSummaryComputationContext(BlockStoragePolicySuite bsps)`
  Constructor for blocking computation.
  `ContentSummaryComputationContext(FSDirectory dir, FSNamesystem fsn, long limitPerRun, long sleepMicroSec)`
  Constructor
  `ContentSummaryComputationContext(FSDirectory dir, FSNamesystem fsn, long limitPerRun, long sleepMicroSec, FSPermissionChecker pc)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BlockStoragePolicySuite`
  `getBlockStoragePolicySuite()`
  `ContentCounts`
  `getCounts()`
  Get the content counts
  `String`
  `getErasureCodingPolicyName(INode inode)`
  Get the erasure coding policy.
  `ContentCounts`
  `getSnapshotCounts()`
  `long`
  `getYieldCount()`
  Return current yield count
  `boolean`
  `yield()`
  Relinquish locks held during computation for a short while and reacquire them.

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### REPLICATED

    public static final String REPLICATED
    See Also:
      - Constant Field Values

  - ### LOG

    public static final org.slf4j.Logger LOG

- ## Constructor Details

  - ### ContentSummaryComputationContext

    public ContentSummaryComputationContext(FSDirectory dir, FSNamesystem fsn, long limitPerRun, long sleepMicroSec)
    Constructor
    Parameters:
      `dir` - The FSDirectory instance
      `fsn` - The FSNamesystem instance
      `limitPerRun` - allowed number of operations in one locking period. 0 or a negative number means no limit (i.e. no yielding)

  - ### ContentSummaryComputationContext

    public ContentSummaryComputationContext(FSDirectory dir, FSNamesystem fsn, long limitPerRun, long sleepMicroSec, FSPermissionChecker pc)

  - ### ContentSummaryComputationContext

    public ContentSummaryComputationContext(BlockStoragePolicySuite bsps)
    Constructor for blocking computation.

- ## Method Details

  - ### getYieldCount

    public long getYieldCount()
    Return current yield count

  - ### yield

    public boolean yield()
    Relinquish locks held during computation for a short while and reacquire them. This will give other threads a chance to acquire the contended locks and run.
    Returns:
      true if locks were released and reacquired.

  - ### getCounts

    public ContentCounts getCounts()
    Get the content counts

  - ### getSnapshotCounts

    public ContentCounts getSnapshotCounts()

  - ### getBlockStoragePolicySuite

    public BlockStoragePolicySuite getBlockStoragePolicySuite()

  - ### getErasureCodingPolicyName

    public String getErasureCodingPolicyName(INode inode)
    Get the erasure coding policy.