diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java index c541f9b828..548948e5b7 100644 --- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java +++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java @@ -241,6 +241,10 @@ private HddsConfigKeys() { "hdds.container.chunk.persistdata"; public static final boolean HDDS_CONTAINER_PERSISTDATA_DEFAULT = true; + public static final String HDDS_CONTAINER_SCRUB_ENABLED = + "hdds.container.scrub.enabled"; + public static final boolean HDDS_CONTAINER_SCRUB_ENABLED_DEFAULT = false; + public static final String HDDS_DATANODE_HTTP_ENABLED_KEY = "hdds.datanode.http.enabled"; public static final String HDDS_DATANODE_HTTP_BIND_HOST_KEY = diff --git a/hadoop-hdds/common/src/main/resources/ozone-default.xml b/hadoop-hdds/common/src/main/resources/ozone-default.xml index 22f1a3c727..52e83698f4 100644 --- a/hadoop-hdds/common/src/main/resources/ozone-default.xml +++ b/hadoop-hdds/common/src/main/resources/ozone-default.xml @@ -1367,7 +1367,7 @@ - hdds.containerscrub.enabled + hdds.container.scrub.enabled false DATANODE diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/ChunkManagerFactory.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/ChunkManagerFactory.java index 673e289683..85495783cc 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/ChunkManagerFactory.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/ChunkManagerFactory.java @@ -26,6 +26,8 @@ import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_CONTAINER_PERSISTDATA; import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_CONTAINER_PERSISTDATA_DEFAULT; +import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_CONTAINER_SCRUB_ENABLED; +import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_CONTAINER_SCRUB_ENABLED_DEFAULT; /** * Select an appropriate ChunkManager implementation as per config setting. @@ -64,12 +66,12 @@ private static ChunkManager createChunkManager(Configuration config, if (!persist) { boolean scrubber = config.getBoolean( - "hdds.containerscrub.enabled", - false); + HDDS_CONTAINER_SCRUB_ENABLED, + HDDS_CONTAINER_SCRUB_ENABLED_DEFAULT); if (scrubber) { // Data Scrubber needs to be disabled for non-persistent chunks. LOG.warn("Failed to set " + HDDS_CONTAINER_PERSISTDATA + " to false." - + " Please set hdds.containerscrub.enabled" + + " Please set " + HDDS_CONTAINER_SCRUB_ENABLED + " also to false to enable non-persistent containers."); persist = true; } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOzoneConfigurationFields.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOzoneConfigurationFields.java index cbd6a0bd26..fa0e73d935 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOzoneConfigurationFields.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOzoneConfigurationFields.java @@ -44,7 +44,6 @@ public void initializeMemberVariables() { errorIfMissingXmlProps = true; xmlPropsToSkipCompare.add("hadoop.tags.custom"); xmlPropsToSkipCompare.add("ozone.om.nodes.EXAMPLEOMSERVICEID"); - xmlPropsToSkipCompare.add("hdds.containerscrub.enabled"); addPropertiesNotInXml(); }