Class ContainerDiffReport

java.lang.Object
org.apache.hadoop.ozone.container.checksum.ContainerDiffReport

public class ContainerDiffReport extends Object
This class represents the difference between our replica of a container and a peer's replica of a container. It summarizes the operations we need to do to reconcile our replica with the peer replica it was compared to.
  • Constructor Details

    • ContainerDiffReport

      public ContainerDiffReport(long containerID)
  • Method Details

    • getContainerID

      public long getContainerID()
    • addMissingBlock

      public void addMissingBlock(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.BlockMerkleTree missingBlockMerkleTree)
      Parameters:
      missingBlockMerkleTree - The block merkle tree of the block to report as missing.
    • addMissingChunk

      public void addMissingChunk(long blockId, org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkMerkleTree missingChunkMerkleTree)
      Parameters:
      blockId - The ID of the block with missing chunks identified.
      missingChunkMerkleTree - The chunk within this block to report as missing.
    • addCorruptChunk

      public void addCorruptChunk(long blockId, org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkMerkleTree corruptChunk)
      Parameters:
      blockId - The ID of the block with missing chunks identified.
      corruptChunk - The chunk within this block to report as corrupt.
    • addDivergedDeletedBlock

      public void addDivergedDeletedBlock(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.BlockMerkleTree blockMerkleTree)
    • getMissingBlocks

      public List<org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.BlockMerkleTree> getMissingBlocks()
      Returns:
      A list of BlockMerkleTree objects that were reported as missing.
    • getMissingChunks

      public Map<Long,List<org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkMerkleTree>> getMissingChunks()
      Returns:
      A map of block IDs to lists of missing ChunkMerkleTree objects within those blocks.
    • getCorruptChunks

      public Map<Long,List<org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkMerkleTree>> getCorruptChunks()
      Returns:
      A map of block IDs to lists of corrupt ChunkMerkleTree objects within those blocks.
    • getDivergedDeletedBlocks

      public List<ContainerDiffReport.DeletedBlock> getDivergedDeletedBlocks()
    • needsRepair

      public boolean needsRepair()
      If needRepair is true, It means current replica needs blocks/chunks from the peer to repair its container replica. The peer replica still may have corruption, which it will fix when it reconciles with other peers.
    • getNumCorruptChunks

      public long getNumCorruptChunks()
    • getNumMissingChunks

      public long getNumMissingChunks()
    • getNumMissingBlocks

      public long getNumMissingBlocks()
    • getNumdivergedDeletedBlocks

      public long getNumdivergedDeletedBlocks()
    • toString

      public String toString()
      Overrides:
      toString in class Object