rakeshadr commented on a change in pull request #1841:
URL: https://github.com/apache/ozone/pull/1841#discussion_r563881907
##########
File path:
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
##########
@@ -545,7 +545,17 @@ private FileStatusAdapter
toFileStatusAdapter(OzoneFileStatus status,
}
@Override
- public String getBucketLayoutVersion() {
- return bucket.getMetadata().get(OMConfigKeys.OZONE_OM_LAYOUT_VERSION);
+ public boolean isFSOptimizedBucket() {
+ boolean layoutVersionEnabled =
+ StringUtils.equalsIgnoreCase(
Review comment:
Thanks a lot @mukul1987 for the review comments. I have updated this in
my latest commit.
I'm planning one more follow-up jira task to modify config
"`ozone.om.layout.version`" name to something more readable which reflects
feature name correctly :-)
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -140,41 +141,41 @@ public static OMClientRequest
createClientRequest(OMRequest omRequest) {
case SetBucketProperty:
return new OMBucketSetPropertyRequest(omRequest);
case AllocateBlock:
- if (omLayoutVersionV1) {
+ if (isFsOptimizedEnabled()) {
return new OMAllocateBlockRequestV1(omRequest);
}
return new OMAllocateBlockRequest(omRequest);
case CreateKey:
- if (omLayoutVersionV1) {
+ if (isFsOptimizedEnabled()) {
return new OMKeyCreateRequestV1(omRequest);
}
return new OMKeyCreateRequest(omRequest);
case CommitKey:
- if (omLayoutVersionV1) {
+ if (isFsOptimizedEnabled()) {
return new OMKeyCommitRequestV1(omRequest);
}
return new OMKeyCommitRequest(omRequest);
case DeleteKey:
- if (omLayoutVersionV1) {
+ if (isFsOptimizedEnabled()) {
return new OMKeyDeleteRequestV1(omRequest);
}
return new OMKeyDeleteRequest(omRequest);
case DeleteKeys:
return new OMKeysDeleteRequest(omRequest);
case RenameKey:
- if (omLayoutVersionV1) {
+ if (isFsOptimizedEnabled()) {
return new OMKeyRenameRequestV1(omRequest);
}
return new OMKeyRenameRequest(omRequest);
case RenameKeys:
return new OMKeysRenameRequest(omRequest);
case CreateDirectory:
- if (omLayoutVersionV1) {
+ if (isFsOptimizedEnabled()) {
return new OMDirectoryCreateRequestV1(omRequest);
}
return new OMDirectoryCreateRequest(omRequest);
case CreateFile:
- if (omLayoutVersionV1) {
+ if (isFsOptimizedEnabled()) {
Review comment:
Done
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3680,14 +3682,18 @@ public boolean getEnableFileSystemPaths() {
OZONE_OM_ENABLE_FILESYSTEM_PATHS_DEFAULT);
}
- private void getOMLayoutVersion() {
+ public String getOMLayoutVersion() {
String version = configuration.getTrimmed(OZONE_OM_LAYOUT_VERSION,
OZONE_OM_LAYOUT_VERSION_DEFAULT);
- boolean omLayoutVersionV1 =
- StringUtils.equalsIgnoreCase(version, "V1");
- OzoneManagerRatisUtils.setOmLayoutVersionV1(omLayoutVersionV1);
+ boolean omLayoutVersionV1 = StringUtils.equalsIgnoreCase(version,
+ OZONE_OM_LAYOUT_VERSION_V1);
LOG.info("Configured {}={} and enabled:{} optimized OM FS operations",
OZONE_OM_LAYOUT_VERSION, version, omLayoutVersionV1);
+
+ boolean enabledFSO = omLayoutVersionV1 && getEnableFileSystemPaths();
Review comment:
Done
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneDirectory.java
##########
@@ -150,6 +150,7 @@ private void setupOzoneFileSystem()
OzoneConfiguration conf = new OzoneConfiguration();
conf.setInt(FS_TRASH_INTERVAL_KEY, 1);
conf.set(OMConfigKeys.OZONE_OM_LAYOUT_VERSION, "V1");
+ conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, true);
Review comment:
I have add OzoneTestUtils.configureFSOptimizedPaths, which is visible to
all `integration-test` cases. Also, I've add the same function into
TestOmRequestUtils.configureFSOptimizedPaths, this is basically added to avoid
adding new project dependency to `integration-test`. All the `ozone-manager`
project test cases using `TestOmRequestUtils` function.
Do you agree to this 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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]