aryangupta1998 commented on a change in pull request #2533:
URL: https://github.com/apache/ozone/pull/2533#discussion_r691272865



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyDeleteRequest.java
##########
@@ -197,4 +198,118 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
     return omClientResponse;
   }
 
+  public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,

Review comment:
       Done

##########
File path: 
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/TestOMRequestUtils.java
##########
@@ -439,6 +441,21 @@ public static void addBucketToDB(String volumeName, String 
bucketName,
         new CacheValue<>(Optional.of(omBucketInfo), 1L));
   }
 
+  public static void addBucketToDB(String volumeName, String bucketName,

Review comment:
       Done

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyDeleteRequest.java
##########
@@ -197,4 +198,118 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
     return omClientResponse;
   }
 
+  public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,

Review comment:
       Yes, this method is necessary for the test. Also, we need `bucketLayout` 
as a parameter because we need to set the `bucketLayout` in the `OmBucketInfo`, 
earlier for FSO(File System Optimized) cases we were dependent on a flag 
`isBucketFSOptimized` but with the help of this PR, we will deduce the 
`bucketLayout` directly from `OmBucketInfo` hence, we need to set the 
appropriate `bucketLayout`. I hope this clears your doubt, if you have more 
questions please feel free to add them!

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -437,4 +450,117 @@ private static ServiceException 
createLeaderNotReadyException(
     return new ServiceException(leaderNotReadyException);
   }
 
+  public static boolean isBucketFSOptimized(OMRequest omRequest,
+      OzoneManager ozoneManager) {
+    Type cmdType = omRequest.getCmdType();
+    BucketLayout bucketLayout = null;
+    OmBucketInfo buckInfo = null;
+    switch (cmdType) {
+    case AllocateBlock:
+      String volName =
+          omRequest.getAllocateBlockRequest().getKeyArgs().getVolumeName();
+      String buckName =
+          omRequest.getAllocateBlockRequest().getKeyArgs().getBucketName();
+      buckInfo = getOmBucketInfo(ozoneManager, buckInfo, volName, buckName);

Review comment:
       I have made the necessary changes according to your comment below.

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
##########
@@ -279,6 +279,7 @@ protected OmMetadataManagerImpl() {
 
   @Override
   public Table<String, OmKeyInfo> getKeyTable() {
+    // TODO: Refactor the below function by reading bucketLayout.

Review comment:
       Done

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -437,4 +450,117 @@ private static ServiceException 
createLeaderNotReadyException(
     return new ServiceException(leaderNotReadyException);
   }
 
+  public static boolean isBucketFSOptimized(OMRequest omRequest,
+      OzoneManager ozoneManager) {
+    Type cmdType = omRequest.getCmdType();
+    BucketLayout bucketLayout = null;
+    OmBucketInfo buckInfo = null;
+    switch (cmdType) {
+    case AllocateBlock:

Review comment:
       Thanks, @rakeshadr for this nice approach, I have made the necessary 
changes.




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