Skip to content

Commit 64f30da

Browse files
xiaoyuyaoajayydv
authored andcommitted
HDDS-1450. Fix nightly run failures after HDDS-976. Contributed by Xiaoyu Yao. (#757)
1 parent 3f2f418 commit 64f30da

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ScmConfigKeys.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ public final class ScmConfigKeys {
368368
"hdds.scm.http.kerberos.keytab";
369369

370370
// Network topology
371-
public static final String OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE_TYPE =
372-
"ozone.scm.network.topology.schema.file.type";
373371
public static final String OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE =
374372
"ozone.scm.network.topology.schema.file";
375373
public static final String OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE_DEFAULT =

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/NodeSchemaManager.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import com.google.common.annotations.VisibleForTesting;
2121
import com.google.common.base.Preconditions;
22+
import org.apache.commons.io.FilenameUtils;
2223
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
2324
import org.apache.hadoop.hdds.scm.net.NodeSchemaLoader.NodeSchemaLoadResult;
2425
import org.slf4j.Logger;
@@ -59,16 +60,14 @@ public void init(Configuration conf) {
5960
/**
6061
* Load schemas from network topology schema configuration file
6162
*/
62-
String schemaFileType = conf.get(
63-
ScmConfigKeys.OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE_TYPE);
64-
6563
String schemaFile = conf.get(
6664
ScmConfigKeys.OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE,
6765
ScmConfigKeys.OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE_DEFAULT);
6866

6967
NodeSchemaLoadResult result;
7068
try {
71-
if (schemaFileType.toLowerCase().compareTo("yaml") == 0) {
69+
if (FilenameUtils.getExtension(schemaFile).toLowerCase()
70+
.compareTo("yaml") == 0) {
7271
result = NodeSchemaLoader.getInstance().loadSchemaFromYaml(schemaFile);
7372
} else {
7473
result = NodeSchemaLoader.getInstance().loadSchemaFromXml(schemaFile);

hadoop-hdds/common/src/main/resources/ozone-default.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,10 +2288,12 @@
22882288
</property>
22892289
<property>
22902290
<name>ozone.scm.network.topology.schema.file</name>
2291-
<value>network-topology-default.xm</value>
2291+
<value>network-topology-default.xml</value>
22922292
<tag>OZONE, MANAGEMENT</tag>
22932293
<description>
2294-
The schema file defines the ozone network topology
2294+
The schema file defines the ozone network topology. We currently support
2295+
xml(default) and yaml format. Refer to the samples in the topology
2296+
awareness document for xml and yaml topology definition samples.
22952297
</description>
22962298
</property>
22972299
<property>

0 commit comments

Comments
 (0)