errose28 commented on code in PR #8515:
URL: https://github.com/apache/ozone/pull/8515#discussion_r2112300508
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/chunk/ChunkKeyHandler.java:
##########
@@ -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);
Review Comment:
We should use the term "replicaIndex" which is standard across the code
base. Can we do an addendum to this change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]