Class ContainerDiffReport
java.lang.Object
org.apache.hadoop.ozone.container.checksum.ContainerDiffReport
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a block that has been deleted in a peer whose metadata we need to add to our container replica's merkle tree. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCorruptChunk(long blockId, org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkMerkleTree corruptChunk) voidaddDivergedDeletedBlock(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.BlockMerkleTree blockMerkleTree) voidaddMissingBlock(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.BlockMerkleTree missingBlockMerkleTree) voidaddMissingChunk(long blockId, org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkMerkleTree missingChunkMerkleTree) longList<org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.BlockMerkleTree> longlonglonglongbooleanIf needRepair is true, It means current replica needs blocks/chunks from the peer to repair its container replica.toString()
-
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
-
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
-