rakeshadr commented on a change in pull request #2533:
URL: https://github.com/apache/ozone/pull/2533#discussion_r690013469
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -3093,4 +3095,25 @@ public OmKeyInfo getPendingDeletionDir() throws
IOException {
return files;
}
+
+ public boolean isBucketFSOptimized(String volName, String buckName)
+ throws IOException {
+ if (!isFSOBucketCheckEnabled) {
Review comment:
On a second thought, like we discussed offline we can add a safer null
check for the `ozoneManager == null` instead of using the
`isFSOBucketCheckEnabled` test flag. ozoneManager can be null for non-FSO test
cases and will execute non-FSO code path.
But, please ensure that all `*FSO test cases` would see a non-null
ozoneManager to cover the FSO execution code path.
https://github.com/apache/ozone/pull/2533/files#diff-bde0dade7dd5ddda419499f4f999d25d40fcec1412e0ce809c36ffd1be473f22R3101
```
public boolean isBucketFSOptimized(String volName, String buckName)
throws IOException {
// safer check for unit test case. In reality ozoneManager will never be
null
if (ozoneManager == null) {
return false;
}
```
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -3093,4 +3095,25 @@ public OmKeyInfo getPendingDeletionDir() throws
IOException {
return files;
}
+
+ public boolean isBucketFSOptimized(String volName, String buckName)
+ throws IOException {
+ if (!isFSOBucketCheckEnabled) {
Review comment:
@aryangupta1998
On a second thought, like we discussed offline we can add a safer null check
for the `ozoneManager == null` instead of using the `isFSOBucketCheckEnabled`
test flag. ozoneManager can be null for non-FSO test cases and will execute
non-FSO code path.
But, please ensure that all `*FSO test cases` would see a non-null
ozoneManager to cover the FSO execution code path.
https://github.com/apache/ozone/pull/2533/files#diff-bde0dade7dd5ddda419499f4f999d25d40fcec1412e0ce809c36ffd1be473f22R3101
```
public boolean isBucketFSOptimized(String volName, String buckName)
throws IOException {
// safer check for unit test case. In reality ozoneManager will never be
null
if (ozoneManager == null) {
return false;
}
```
--
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]