dombizita commented on code in PR #7528:
URL: https://github.com/apache/ozone/pull/7528#discussion_r1879769587


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1554,23 +1555,26 @@ public OzoneInputStream getKey(
     OmKeyInfo keyInfo = getKeyInfo(volumeName, bucketName, keyName, true);
     List<OmKeyLocationInfo> keyLocationInfos
         = keyInfo.getLatestVersionLocations().getBlocksLatestVersionOnly();
-
+    ReplicationConfig replicationConfig = keyInfo.getReplicationConfig();
     for (OmKeyLocationInfo locationInfo : keyLocationInfos) {
       Map<DatanodeDetails, OzoneInputStream> blocks = new HashMap<>();
 
 
       Pipeline pipelineBefore = locationInfo.getPipeline();
       List<DatanodeDetails> datanodes = pipelineBefore.getNodes();
-

Review Comment:
   Please try to avoid unnecessary changes, like removing or adding empty lines



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1615,6 +1621,30 @@ public OzoneInputStream getKey(
     return result;
   }
 
+  // Helper method to calculate the internal block length of an EC-replicated 
key.

Review Comment:
   Please add a javadoc for this method instead of the comment, thanks! 



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1594,7 +1598,9 @@ public OzoneInputStream getKey(
             .setDataSize(keyInfo.getDataSize())
             .setCreationTime(keyInfo.getCreationTime())
             .setModificationTime(keyInfo.getModificationTime())
-            .setReplicationConfig(keyInfo.getReplicationConfig())
+            .setReplicationConfig(replicationConfig instanceof 
ECReplicationConfig
+                    ? 
RatisReplicationConfig.getInstance(HddsProtos.ReplicationFactor.ONE)
+                    : keyInfo.getReplicationConfig())

Review Comment:
   Could you elaborate why did you choose to set the replication factor to ONE 
and RATIS in case of EC? You can do this in the method javadoc and in the PR 
description. You can add why and how the length is calculated in case of EC. 
Thanks!



-- 
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]

Reply via email to