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



##########
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",
+      defaultValue = "MD5MD5CRC",
+      description = "The combined checksum type [MD5MD5CRC / COMPOSITE_CRC] "
+          + "determines which algorithm would be used to compute checksum for "
+          + "file checksum. Default checksum type is MD5MD5CRC.",
+      tags = ConfigTag.CLIENT)
+  private String checksumCombineMode = 
Options.ChecksumCombineMode.MD5MD5CRC.name();

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