This is an automated email from the ASF dual-hosted git repository.
ssulav pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 10c470d800 HDDS-12817. Add EC block index in the ozone debug replicas
chunk-info (#8515)
10c470d800 is described below
commit 10c470d800da33adcf3f902cb0498ce2260fc6cf
Author: Soumitra Sulav <[email protected]>
AuthorDate: Wed May 28 15:34:34 2025 +0530
HDDS-12817. Add EC block index in the ozone debug replicas chunk-info
(#8515)
---
.../ozone/debug/replicas/chunk/ChunkKeyHandler.java | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/chunk/ChunkKeyHandler.java
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/chunk/ChunkKeyHandler.java
index 2131877765..91f5e87ca4 100644
---
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/chunk/ChunkKeyHandler.java
+++
b/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);
}
}
} catch (InterruptedException e) {
@@ -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();
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]