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

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

# Class INodeReference.WithCount

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.INode
org.apache.hadoop.hdfs.server.namenode.INodeReference
org.apache.hadoop.hdfs.server.namenode.INodeReference.WithCount

All Implemented Interfaces:
  `Comparable<byte[]>`, `INodeAttributes`, `Diff.Element<byte[]>`

Enclosing class:
  INodeReference

public static class INodeReference.WithCount extends INodeReference
An anonymous reference with reference count.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.namenode.INodeReference

  `INodeReference.DstReference, INodeReference.WithCount, INodeReference.WithName`

  ## Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.namenode.INode

  `INode.BlocksMapUpdateInfo, INode.Feature, INode.QuotaDelta, INode.ReclaimContext`

  ## Nested classes/interfaces inherited from interface org.apache.hadoop.hdfs.server.namenode.INodeAttributes

  `INodeAttributes.SnapshotCopy`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Comparator<INodeReference.WithName>`
  `WITHNAME_COMPARATOR`
  Compare snapshot with IDs, where null indicates the current status thus is greater than any non-null snapshot.

  ### Fields inherited from class org.apache.hadoop.hdfs.server.namenode.INode

  `LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WithCount(INodeReference parent, INode referred)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addReference(INodeReference ref)`
  Increment and then return the reference count.
  `String`
  `getCountDetails()`
  `INodeReference.WithName`
  `getLastWithName()`
  Return the last WithName reference if there is any, null otherwise.
  `INodeReference`
  `getParentRef(int snapshotId)`
  `int`
  `getReferenceCount()`
  `void`
  `removeReference(INodeReference ref)`
  Decrement and then return the reference count.
  `String`
  `toDetailString()`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.namenode.INodeReference

  `accept, asDirectory, asFile, asReference, asSymlink, cleanSubtree, clear, computeContentSummary, computeQuotaUsage, destroyAndCollectBlocks, dumpTreeRecursively, getAccessTime, getDstSnapshotId, getFsPermission, getFsPermissionShort, getGroupName, getId, getLocalNameBytes, getLocalStoragePolicyID, getModificationTime, getPermissionLong, getPermissionStatus, getQuotaCounts, getReferredINode, getSnapshotINode, getStoragePolicyID, getUserName, isDirectory, isFile, isReference, isSymlink, setAccessTime, setLocalName, setModificationTime, tryRemoveReference, updateModificationTime`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.namenode.INode

  `addSpaceConsumed, compareTo, computeAndConvertContentSummary, computeContentSummary, computeQuotaUsage, computeQuotaUsage, dumpINode, dumpParentINodes, dumpTreeRecursively, dumpTreeRecursively, equals, getAccessTime, getAclFeature, getFsPermission, getFullPathAndObjectString, getFullPathName, getGroupName, getKey, getLocalName, getModificationTime, getObjectString, getParent, getParentReference, getParentString, getPathComponents, getPathComponents, getPathNames, getStoragePolicyIDForQuota, getUserName, getXAttrFeature, hashCode, isAncestorDirectory, isDeleted, isInCurrentState, isInLatestSnapshot, isLastReference, isQuotaSet, isSetStoragePolicy, setAccessTime, setModificationTime, setParent, setParentReference, shouldRecordInSrcSnapshot, toString`

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

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

- ## Field Details

  - ### WITHNAME_COMPARATOR

    public static final Comparator<INodeReference.WithName> WITHNAME_COMPARATOR
    Compare snapshot with IDs, where null indicates the current status thus is greater than any non-null snapshot.

- ## Constructor Details

  - ### WithCount

    public WithCount(INodeReference parent, INode referred)

- ## Method Details

  - ### getCountDetails

    public String getCountDetails()

  - ### toDetailString

    public String toDetailString()
    Overrides:
      `toDetailString` in class `INodeReference`

  - ### getReferenceCount

    public int getReferenceCount()

  - ### addReference

    public void addReference(INodeReference ref)
    Increment and then return the reference count.

  - ### removeReference

    public void removeReference(INodeReference ref)
    Decrement and then return the reference count.

  - ### getLastWithName

    public INodeReference.WithName getLastWithName()
    Return the last WithName reference if there is any, null otherwise.

  - ### getParentRef

    public INodeReference getParentRef(int snapshotId)
    Returns:
      the WithName/DstReference node contained in the given snapshot.