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

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

# Class FileDiff

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.snapshot.FileDiff

All Implemented Interfaces:
  `Comparable<Integer>`

public class FileDiff extends Object
The difference of an `INodeFile` between two snapshots.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final int`
  `compareTo(Integer that)`
  Compare diffs with snapshot ID.
  `void`
  `destroyAndCollectSnapshotBlocks(INode.BlocksMapUpdateInfo collectedBlocks)`
  `BlockInfo[]`
  `getBlocks()`
  `long`
  `getFileSize()`
  `final int`
  `getSnapshotId()`
  `void`
  `setBlocks(BlockInfo[] blocks)`
  Copy block references into the snapshot up to the current `fileSize`.
  `String`
  `toString()`

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

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

- ## Method Details

  - ### getFileSize

    public long getFileSize()
    Returns:
      the file size in the snapshot.

  - ### setBlocks

    public void setBlocks(BlockInfo[] blocks)
    Copy block references into the snapshot up to the current `fileSize`. Should be done only once.

  - ### getBlocks

    public BlockInfo[] getBlocks()

  - ### toString

    public String toString()

  - ### destroyAndCollectSnapshotBlocks

    public void destroyAndCollectSnapshotBlocks(INode.BlocksMapUpdateInfo collectedBlocks)

  - ### compareTo

    public final int compareTo(Integer that)
    Compare diffs with snapshot ID.
    Specified by:
      `compareTo` in interface `Comparable<N extends INode>`

  - ### getSnapshotId

    public final int getSnapshotId()
    Returns:
      the snapshot object of this diff.