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[]>, org.apache.hadoop.hdfs.server.namenode.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 and Description
    --- | ---
    `static 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 and Description
    `WithCount(INodeReference parent, org.apache.hadoop.hdfs.server.namenode.INode referred)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addReference(INodeReference ref)` Increment and then return the reference count.
    `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.

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

      `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, dumpTreeRecursively, dumpTreeRecursively, equals, getAccessTime, getAclFeature, getFsPermission, 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, toDetailString, toString`

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

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

- - ### Field Detail

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

    - #### WithCount

          public WithCount(INodeReference parent,
                           org.apache.hadoop.hdfs.server.namenode.INode referred)

  - ### Method Detail

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

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