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 c541f9b8289..548948e5b78 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 @@ public final class 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 22f1a3c7279..52e83698f43 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 673e2896830..85495783cc8 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 org.slf4j.LoggerFactory; 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 @@ public final class ChunkManagerFactory { 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 cbd6a0bd268..fa0e73d9354 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 class TestOzoneConfigurationFields extends TestConfigurationFieldsBase { errorIfMissingXmlProps = true; xmlPropsToSkipCompare.add("hadoop.tags.custom"); xmlPropsToSkipCompare.add("ozone.om.nodes.EXAMPLEOMSERVICEID"); - xmlPropsToSkipCompare.add("hdds.containerscrub.enabled"); addPropertiesNotInXml(); }