Skip to content

Commit

Permalink
HDDS-2087. Remove the hard coded config key in ChunkManager (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekratnavel authored and bharatviswa504 committed Sep 9, 2019
1 parent 43e389b commit 3b9584d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@
</property>

<property>
<name>hdds.containerscrub.enabled</name>
<name>hdds.container.scrub.enabled</name>
<value>false</value>
<tag>DATANODE</tag>
<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 3b9584d

Please sign in to comment.