File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
hadoop-hdds/common/src/main
java/org/apache/hadoop/hdds/scm Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff 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 =
Original file line number Diff line number Diff line change 1919
2020import com .google .common .annotations .VisibleForTesting ;
2121import com .google .common .base .Preconditions ;
22+ import org .apache .commons .io .FilenameUtils ;
2223import org .apache .hadoop .hdds .scm .ScmConfigKeys ;
2324import org .apache .hadoop .hdds .scm .net .NodeSchemaLoader .NodeSchemaLoadResult ;
2425import 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 );
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments