You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/05/15 08:17:03 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #4706: HDDS-8615. Explicitly show EC block type in 'ozone debug chunkinfo'

adoroszlai commented on code in PR #4706:
URL: https://github.com/apache/ozone/pull/4706#discussion_r1193492130


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkKeyHandler.java:
##########
@@ -115,11 +116,17 @@ protected void execute(OzoneClient client, OzoneAddress address)
         ContainerChunkInfo containerChunkInfo = new ContainerChunkInfo();
         long containerId = keyLocation.getContainerID();
         chunkPaths.clear();
-        Pipeline pipeline = keyLocation.getPipeline();
-        if (pipeline.getType() != HddsProtos.ReplicationType.STAND_ALONE) {
-          pipeline = Pipeline.newBuilder(pipeline)
+        Pipeline keyPipeline = keyLocation.getPipeline();
+        boolean isECKey =
+            keyPipeline.getReplicationConfig().getReplicationType() ==
+                HddsProtos.ReplicationType.EC;
+        Pipeline pipeline;
+        if (keyPipeline.getType() != HddsProtos.ReplicationType.STAND_ALONE) {
+          pipeline = Pipeline.newBuilder(keyPipeline)
               .setReplicationConfig(StandaloneReplicationConfig
                   .getInstance(ONE)).build();
+        } else {
+          pipeline = keyPipeline;

Review Comment:
   Previous logic:
   
   ```
   pipeline = keyPipeline
   if (not standalone) {
     pipeline = ...
   }
   ```
   
   New logic:
   
   ```
   if (not standalone) {
     pipeline = ...
   } else {
     pipeline = keyPipeline
   }
   ```
   
   I think the result is the same in both cases.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org