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

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

# Class INode.ReclaimContext

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.INode.ReclaimContext

Enclosing class:
  INode

public static class INode.ReclaimContext extends Object
Context object to record blocks and inodes that need to be reclaimed

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final BlockStoragePolicySuite`
  `bsps`
  `protected final INode.BlocksMapUpdateInfo`
  `collectedBlocks`
  `protected final List<INode>`
  `removedINodes`
  `protected final List<Long>`
  `removedUCFiles`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReclaimContext(BlockStoragePolicySuite bsps, INode.BlocksMapUpdateInfo collectedBlocks, List<INode> removedINodes, List<Long> removedUCFiles)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `INode.BlocksMapUpdateInfo`
  `collectedBlocks()`
  `INode.ReclaimContext`
  `getCopy()`
  make a copy with the same collectedBlocks, removedINodes, and removedUCFiles but a new quotaDelta.
  `int`
  `getSnapshotIdToBeDeleted()`
  For `FSEditLogOpCodes.OP_DELETE_SNAPSHOT`, return the snapshot to be deleted.
  `int`
  `getSnapshotIdToBeDeleted(int snapshotId, INode inode)`
  `INode.QuotaDelta`
  `quotaDelta()`
  `void`
  `setSnapshotToBeDeleted(Snapshot snapshot)`
  Set the snapshot to be deleted for `FSEditLogOpCodes.OP_DELETE_SNAPSHOT`.
  `BlockStoragePolicySuite`
  `storagePolicySuite()`

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

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

- ## Field Details

  - ### bsps

    protected final BlockStoragePolicySuite bsps

  - ### collectedBlocks

    protected final INode.BlocksMapUpdateInfo collectedBlocks

  - ### removedINodes

    protected final List<INode> removedINodes

  - ### removedUCFiles

    protected final List<Long> removedUCFiles

- ## Constructor Details

  - ### ReclaimContext

    public ReclaimContext(BlockStoragePolicySuite bsps, INode.BlocksMapUpdateInfo collectedBlocks, List<INode> removedINodes, List<Long> removedUCFiles)
    Parameters:
      `bsps` - block storage policy suite to calculate intended storage type usage
      `collectedBlocks` - blocks collected from the descents for further block deletion/update will be added to the given map.
      `removedINodes` - INodes collected from the descents for further cleaning up of
      `removedUCFiles` - INodes whose leases need to be released

- ## Method Details

  - ### setSnapshotToBeDeleted

    public void setSnapshotToBeDeleted(Snapshot snapshot)
    Set the snapshot to be deleted for `FSEditLogOpCodes.OP_DELETE_SNAPSHOT`.
    Parameters:
      `snapshot` - the snapshot to be deleted

  - ### getSnapshotIdToBeDeleted

    public int getSnapshotIdToBeDeleted()
    For `FSEditLogOpCodes.OP_DELETE_SNAPSHOT`, return the snapshot to be deleted. For other ops, return `Snapshot.CURRENT_STATE_ID`.

  - ### getSnapshotIdToBeDeleted

    public int getSnapshotIdToBeDeleted(int snapshotId, INode inode)

  - ### storagePolicySuite

    public BlockStoragePolicySuite storagePolicySuite()

  - ### collectedBlocks

    public INode.BlocksMapUpdateInfo collectedBlocks()

  - ### quotaDelta

    public INode.QuotaDelta quotaDelta()

  - ### getCopy

    public INode.ReclaimContext getCopy()
    make a copy with the same collectedBlocks, removedINodes, and removedUCFiles but a new quotaDelta.