diff --git a/hadoop-hdds/common/src/main/resources/ozone-default.xml b/hadoop-hdds/common/src/main/resources/ozone-default.xml
index c3580a35907..34ffaebf689 100644
--- a/hadoop-hdds/common/src/main/resources/ozone-default.xml
+++ b/hadoop-hdds/common/src/main/resources/ozone-default.xml
@@ -2771,12 +2771,15 @@
- ozone.om.layout.version
+ ozone.om.metadata.layout
OZONE, OM
- V0
- Temporary workaround for OM upgrade and will be replaced once
- upgrade HDDS-3698 story reaches consensus. Defaulting to 'V0' so that
- existing unit test cases won't be affected. New OM version should be 'V1'
+ LEGACY
+
+ This property is used to define the metadata layout of file system
+ paths. If it is configured as PREFIX in combination with
+ ozone.om.enable.filesystem.paths to true then this allows to perform
+ atomic rename and delete of any directory at any level in the namespace.
+ Defaulting to LEGACY. Supported values: LEGACY and PREFIX.
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java
index 6a648183890..971e248d1f7 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java
@@ -245,14 +245,17 @@ private OMConfigKeys() {
public static final long OZONE_FS_TRASH_CHECKPOINT_INTERVAL_DEFAULT = 0;
- // TODO: Temporary workaround for OM upgrade path and will be replaced once
- // upgrade HDDS-3698 story reaches consensus. Defaulting to 'V0' so that
- // existing unit test cases won't be affected. New OM version should be 'V1'.
- public static final String OZONE_OM_LAYOUT_VERSION =
- "ozone.om.layout.version";
- public static final String OZONE_OM_LAYOUT_VERSION_DEFAULT = "V0";
-
- public static final String OZONE_OM_LAYOUT_VERSION_V1 = "V1";
+// This property is used to define the metadata layout of file system
+// paths. If it is configured as PREFIX in combination with
+// ozone.om.enable.filesystem.paths to true then this allows to perform
+// atomic rename and delete of any directory at any level in the namespace.
+// Defaulting to LEGACY. Supported values: LEGACY and PREFIX.
+
+ public static final String OZONE_OM_METADATA_LAYOUT =
+ "ozone.om.metadata.layout";
+ public static final String OZONE_OM_METADATA_LAYOUT_DEFAULT = "LEGACY";
+
+ public static final String OZONE_OM_METADATA_LAYOUT_PREFIX = "PREFIX";
/**
* Configuration properties for Directory Deleting Service.
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFSUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFSUtils.java
index f1f6454caf7..4f2ba368281 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFSUtils.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFSUtils.java
@@ -216,18 +216,18 @@ public static int getFileCount(String keyName) {
*/
public static boolean isFSOptimizedBucket(
Map bucketMetadata) {
- // layout version V1 represents optimized FS path
- boolean layoutVersionEnabled =
+ // layout 'PREFIX' represents optimized FS path
+ boolean metadataLayoutEnabled =
org.apache.commons.lang3.StringUtils.equalsIgnoreCase(
- OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1,
+ OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX,
bucketMetadata
- .get(OMConfigKeys.OZONE_OM_LAYOUT_VERSION));
+ .get(OMConfigKeys.OZONE_OM_METADATA_LAYOUT));
boolean fsEnabled =
Boolean.parseBoolean(bucketMetadata
.get(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS));
- return layoutVersionEnabled && fsEnabled;
+ return metadataLayoutEnabled && fsEnabled;
}
public static String removeTrailingSlashIfNeeded(String key) {
diff --git a/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml b/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml
index b7b450daf4f..6328be4a40e 100644
--- a/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml
+++ b/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml
@@ -26,8 +26,8 @@ x-common-config:
- docker-config
x-layout_version:
- &layout_version
- OZONE-SITE.XML_ozone.om.layout.version: ${OZONE_OM_LAYOUT_VERSION:-V0}
+ &metadata_layout
+ OZONE-SITE.XML_ozone.om.metadata.layout: ${OZONE_OM_METADATA_LAYOUT:-LEGACY}
OZONE-SITE.XML_ozone.om.enable.filesystem.paths: ${OZONE_OM_ENABLE_FILESYSTEM_PATHS:-false}
x-replication:
@@ -42,7 +42,7 @@ services:
- 9882
environment:
<<: *replication
- <<: *layout_version
+ <<: *metadata_layout
OZONE_OPTS:
command: ["ozone","datanode"]
om:
@@ -51,7 +51,7 @@ services:
ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION
OZONE_OPTS:
<<: *replication
- <<: *layout_version
+ <<: *metadata_layout
ports:
- 9874:9874
- 9862:9862
@@ -66,14 +66,14 @@ services:
OZONE-SITE.XML_hdds.scm.safemode.min.datanode: ${OZONE_SAFEMODE_MIN_DATANODES:-1}
OZONE_OPTS:
<<: *replication
- <<: *layout_version
+ <<: *metadata_layout
command: ["ozone","scm"]
s3g:
<<: *common-config
environment:
OZONE_OPTS:
<<: *replication
- <<: *layout_version
+ <<: *metadata_layout
ports:
- 9878:9878
command: ["ozone","s3g"]
@@ -84,5 +84,5 @@ services:
environment:
OZONE_OPTS:
<<: *replication
- <<: *layout_version
+ <<: *metadata_layout
command: ["ozone","recon"]
diff --git a/hadoop-ozone/dist/src/main/compose/ozone/test.sh b/hadoop-ozone/dist/src/main/compose/ozone/test.sh
index 6de26ab94cb..c2af02f8d37 100755
--- a/hadoop-ozone/dist/src/main/compose/ozone/test.sh
+++ b/hadoop-ozone/dist/src/main/compose/ozone/test.sh
@@ -53,9 +53,9 @@ stop_docker_env
# running FS tests with different config requires restart of the cluster
export OZONE_KEEP_RESULTS=true
-export OZONE_OM_LAYOUT_VERSION OZONE_OM_ENABLE_FILESYSTEM_PATHS
-for OZONE_OM_LAYOUT_VERSION in V0 V1; do
- if [[ $OZONE_OM_LAYOUT_VERSION == "V1" ]]; then
+export OZONE_OM_METADATA_LAYOUT OZONE_OM_ENABLE_FILESYSTEM_PATHS
+for OZONE_OM_METADATA_LAYOUT in LEGACY PREFIX; do
+ if [[ $OZONE_OM_METADATA_LAYOUT == "PREFIX" ]]; then
OZONE_OM_ENABLE_FILESYSTEM_PATHS=true
else
OZONE_OM_ENABLE_FILESYSTEM_PATHS=false
@@ -64,7 +64,7 @@ for OZONE_OM_LAYOUT_VERSION in V0 V1; do
start_docker_env
for scheme in ofs o3fs; do
for bucket in link bucket; do
- execute_robot_test scm -v SCHEME:${scheme} -v BUCKET_TYPE:${bucket} -N ozonefs-${OZONE_OM_LAYOUT_VERSION}-${scheme}-${bucket} ozonefs/ozonefs.robot
+ execute_robot_test scm -v SCHEME:${scheme} -v BUCKET_TYPE:${bucket} -N ozonefs-${OZONE_OM_METADATA_LAYOUT}-${scheme}-${bucket} ozonefs/ozonefs.robot
done
done
stop_docker_env
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSOBucket.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSOBucket.java
index aa2d8e7b096..df2e47bac37 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSOBucket.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSOBucket.java
@@ -86,7 +86,7 @@ public static void init() throws Exception {
conf.setBoolean(OZONE_ACL_ENABLED, true);
if (isBucketFSOptimized) {
TestOMRequestUtils.configureFSOptimizedPaths(conf,
- enabledFileSystemPaths, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ enabledFileSystemPaths, OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
} else {
conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS,
enabledFileSystemPaths);
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneDirectory.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneDirectory.java
index 22ed13eef45..3763295005c 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneDirectory.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneDirectory.java
@@ -151,7 +151,7 @@ private void setupOzoneFileSystem()
OzoneConfiguration conf = new OzoneConfiguration();
conf.setInt(FS_TRASH_INTERVAL_KEY, 1);
TestOMRequestUtils.configureFSOptimizedPaths(conf,
- true, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ true, OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
cluster = MiniOzoneCluster.newBuilder(conf)
.setNumDatanodes(3)
.build();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfacesV1.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfacesV1.java
index d7164577486..de484eafe65 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfacesV1.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfacesV1.java
@@ -45,8 +45,8 @@ public TestOzoneFileInterfacesV1(boolean setDefaultFs,
@Override
protected OzoneConfiguration getOzoneConfiguration() {
OzoneConfiguration conf = new OzoneConfiguration();
- TestOMRequestUtils.configureFSOptimizedPaths(conf,
- enableFileSystemPaths, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ TestOMRequestUtils.configureFSOptimizedPaths(conf, enableFileSystemPaths,
+ OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
return conf;
}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileOps.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileOps.java
index 147a9cea779..c0f228dd0b4 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileOps.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileOps.java
@@ -73,7 +73,7 @@ public void setupOzoneFileSystem()
OzoneConfiguration conf = new OzoneConfiguration();
conf.setInt(FS_TRASH_INTERVAL_KEY, 1);
TestOMRequestUtils.configureFSOptimizedPaths(conf,
- true, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ true, OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
cluster = MiniOzoneCluster.newBuilder(conf)
.setNumDatanodes(3)
.build();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java
index 3d25e72ee5e..bddc21fcb50 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java
@@ -149,11 +149,11 @@ private void init() throws Exception {
conf.setBoolean(OMConfigKeys.OZONE_OM_RATIS_ENABLE_KEY, omRatisEnabled);
conf.setBoolean(OZONE_ACL_ENABLED, true);
if (isBucketFSOptimized) {
- TestOMRequestUtils.configureFSOptimizedPaths(conf,
- enabledFileSystemPaths, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ TestOMRequestUtils.configureFSOptimizedPaths(conf, enabledFileSystemPaths,
+ OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
} else {
conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS,
- enabledFileSystemPaths);
+ enabledFileSystemPaths);
}
cluster = MiniOzoneCluster.newBuilder(conf)
.setNumDatanodes(3)
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java
index 3f18faeeacc..4cd875056e8 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java
@@ -62,7 +62,7 @@ public void init() throws Exception {
configuration = new OzoneConfiguration();
TestOMRequestUtils.configureFSOptimizedPaths(configuration,
- true, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ true, OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
cluster = MiniOzoneCluster.newBuilder(configuration)
.setNumDatanodes(3)
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
index b5b77034e17..813965eb33b 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
@@ -156,7 +156,7 @@ public static void init() throws Exception {
conf.setBoolean(OMConfigKeys.OZONE_OM_RATIS_ENABLE_KEY, omRatisEnabled);
if (isBucketFSOptimized) {
TestOMRequestUtils.configureFSOptimizedPaths(conf,
- true, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ true, OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
} else {
conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS,
enabledFileSystemPaths);
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/contract/OzoneContract.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/contract/OzoneContract.java
index f401c0674ec..925ef6ae1c1 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/contract/OzoneContract.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/contract/OzoneContract.java
@@ -88,8 +88,8 @@ public static void createCluster() throws IOException {
if (fsOptimizedServer){
conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS,
true);
- conf.set(OMConfigKeys.OZONE_OM_LAYOUT_VERSION,
- OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ conf.set(OMConfigKeys.OZONE_OM_METADATA_LAYOUT,
+ OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
}
cluster = MiniOzoneCluster.newBuilder(conf).setNumDatanodes(5).build();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadV1.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadV1.java
index 0e981d6edbd..b248b72128a 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadV1.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadV1.java
@@ -106,7 +106,7 @@ public class TestOzoneClientMultipartUploadV1 {
public static void init() throws Exception {
OzoneConfiguration conf = new OzoneConfiguration();
TestOMRequestUtils.configureFSOptimizedPaths(conf,
- true, OMConfigKeys.OZONE_OM_LAYOUT_VERSION_V1);
+ true, OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX);
startCluster(conf);
}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java
index 446ed5c1577..f94e47e7336 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java
@@ -103,8 +103,8 @@ public TestReadRetries(String layoutVersion) {
@Parameterized.Parameters
public static Collection