rakeshadr commented on a change in pull request #2937:
URL: https://github.com/apache/ozone/pull/2937#discussion_r778579816



##########
File path: 
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/OzoneClientConfig.java
##########
@@ -124,6 +125,14 @@
       tags = ConfigTag.CLIENT)
   private boolean checksumVerify = true;
 
+  @Config(key = "checksum.combine.mode",

Review comment:
       Please add `ozone.client.checksum.combine.mode` config to 
ozone-default.xml file.

##########
File path: 
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
##########
@@ -1066,4 +1069,23 @@ public boolean isFSOptimizedBucket() {
     // TODO: Need to refine this part.
     return false;
   }
+
+  @Override
+  public FileChecksum getFileChecksum(Path f, long length) throws IOException {
+    Options.ChecksumCombineMode combineMode =
+        config.getObject(OzoneClientConfig.class).getChecksumCombineMode();
+
+    OFSPath ofsPath = new OFSPath(f);
+    String keyName = ofsPath.getKeyName();
+    if (keyName.length() == 0) {

Review comment:
       Please move the` if (keyName.length() == 0) {` validation inside 
`OzoneClientUtils.getFileChecksumWithCombineMode()` so that both o3fs and ofs 
will have the check.
   
   Also, Please make a `Preconditions.checkArgument(length >= 0);` check.




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