rakeshadr commented on code in PR #12080:
URL: https://github.com/apache/ozone/pull/12080#discussion_r4669193370


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1250,6 +1254,9 @@ public void setBucketStoragePolicy(
     verifyVolumeName(volumeName);
     verifyBucketName(bucketName);
     Objects.requireNonNull(storagePolicy, "storagePolicy == null");
+    if (!OzoneManagerVersion.STORAGE_POLICY_SUPPORT.isSupportedBy(omVersion)) {

Review Comment:
   Similar to the `# checkIfNoneMatchETagSupport()` helper call, Extract 
repeated version check into a helper and call it.
   
   ```
   private void checkStoragePolicySupported() throws IOException {
     if (!OzoneManagerVersion.STORAGE_POLICY_SUPPORT.isSupportedBy(omVersion)) {
       throw new IOException("OzoneManager does not support storage policy");
     }
   }
   ```



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########


Review Comment:
   Version check missing in createKey(... StoragePolicy). Please add it.
   
    ```
      if (!OzoneManagerVersion.STORAGE_POLICY_SUPPORT.isSupportedBy(omVersion)) 
{
         throw new IOException("OzoneManager does not support storage policy");
       }
   ```



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