Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,13 @@ protected void execute(OzoneClient client, OzoneAddress address)
}

if (isECKey) {
ChunkType blockChunksType = isECParityBlock(keyPipeline, entry.getKey()) ?
ChunkType.PARITY : ChunkType.DATA;
jsonObj.put("chunkType", blockChunksType.name());
int replicaIndex = keyPipeline.getReplicaIndex(entry.getKey());
int dataCount = ((ECReplicationConfig) keyPipeline.getReplicationConfig()).getData();
// Index is 1-based,
// e.g. for RS-3-2 we will have data indexes 1,2,3 and parity indexes 4,5
ChunkType chunkType = (replicaIndex > dataCount) ? ChunkType.PARITY : ChunkType.DATA;
jsonObj.put("chunkType", chunkType.name());
jsonObj.put("ecIndex", replicaIndex);
Copy link
Contributor

@errose28 errose28 May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the term "replicaIndex" which is standard across the code base. Can we do an addendum to this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Let me add.

}
}
} catch (InterruptedException e) {
Expand All @@ -205,11 +209,4 @@ protected void execute(OzoneClient client, OzoneAddress address)
System.out.println(prettyJson);
}
}

private boolean isECParityBlock(Pipeline pipeline, DatanodeDetails dn) {
//index is 1-based,
//e.g. for RS-3-2 we will have data indexes 1,2,3 and parity indexes 4,5
return pipeline.getReplicaIndex(dn) >
((ECReplicationConfig) pipeline.getReplicationConfig()).getData();
}
}