HDDS-2087. Remove the hard coded config key in ChunkManager (#1409)

This commit is contained in:
Vivek Ratnavel Subramanian 2019-09-08 20:44:07 -07:00 committed by Bharat Viswanadham
parent 43e389b980
commit 3b9584d12b
4 changed files with 10 additions and 5 deletions

View File

@ -241,6 +241,10 @@ private HddsConfigKeys() {
"hdds.container.chunk.persistdata"; "hdds.container.chunk.persistdata";
public static final boolean HDDS_CONTAINER_PERSISTDATA_DEFAULT = true; 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 = public static final String HDDS_DATANODE_HTTP_ENABLED_KEY =
"hdds.datanode.http.enabled"; "hdds.datanode.http.enabled";
public static final String HDDS_DATANODE_HTTP_BIND_HOST_KEY = public static final String HDDS_DATANODE_HTTP_BIND_HOST_KEY =

View File

@ -1367,7 +1367,7 @@
</property> </property>
<property> <property>
<name>hdds.containerscrub.enabled</name> <name>hdds.container.scrub.enabled</name>
<value>false</value> <value>false</value>
<tag>DATANODE</tag> <tag>DATANODE</tag>
<description> <description>

View File

@ -26,6 +26,8 @@
import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_CONTAINER_PERSISTDATA; 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_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. * Select an appropriate ChunkManager implementation as per config setting.
@ -64,12 +66,12 @@ private static ChunkManager createChunkManager(Configuration config,
if (!persist) { if (!persist) {
boolean scrubber = config.getBoolean( boolean scrubber = config.getBoolean(
"hdds.containerscrub.enabled", HDDS_CONTAINER_SCRUB_ENABLED,
false); HDDS_CONTAINER_SCRUB_ENABLED_DEFAULT);
if (scrubber) { if (scrubber) {
// Data Scrubber needs to be disabled for non-persistent chunks. // Data Scrubber needs to be disabled for non-persistent chunks.
LOG.warn("Failed to set " + HDDS_CONTAINER_PERSISTDATA + " to false." 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."); + " also to false to enable non-persistent containers.");
persist = true; persist = true;
} }

View File

@ -44,7 +44,6 @@ public void initializeMemberVariables() {
errorIfMissingXmlProps = true; errorIfMissingXmlProps = true;
xmlPropsToSkipCompare.add("hadoop.tags.custom"); xmlPropsToSkipCompare.add("hadoop.tags.custom");
xmlPropsToSkipCompare.add("ozone.om.nodes.EXAMPLEOMSERVICEID"); xmlPropsToSkipCompare.add("ozone.om.nodes.EXAMPLEOMSERVICEID");
xmlPropsToSkipCompare.add("hdds.containerscrub.enabled");
addPropertiesNotInXml(); addPropertiesNotInXml();
} }