diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneClientUtils.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneClientUtils.java index 47d4fe54ee..b4767dc79a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneClientUtils.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneClientUtils.java @@ -169,22 +169,29 @@ public static InetSocketAddress getScmAddressForClients(Configuration conf) { /** * Retrieve the socket address that should be used by clients to connect - * to the SCM for block service. + * to the SCM for block service. If + * {@link ScmConfigKeys#OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY} is not defined + * then {@link ScmConfigKeys#OZONE_SCM_CLIENT_ADDRESS_KEY} is used. * * @param conf * @return Target InetSocketAddress for the SCM block client endpoint. + * @throws IllegalArgumentException if configuration is not defined. */ public static InetSocketAddress getScmAddressForBlockClients( Configuration conf) { - final Optional host = getHostNameFromConfigKeys(conf, + Optional host = getHostNameFromConfigKeys(conf, ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY); if (!host.isPresent()) { - throw new IllegalArgumentException( - ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY + - " must be defined. See" + - " https://wiki.apache.org/hadoop/Ozone#Configuration for details" + - " on configuring Ozone."); + host = getHostNameFromConfigKeys(conf, + ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY); + if (!host.isPresent()) { + throw new IllegalArgumentException( + ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY + + " must be defined. See" + + " https://wiki.apache.org/hadoop/Ozone#Configuration for details" + + " on configuring Ozone."); + } } final Optional port = getPortNumberFromConfigKeys(conf, diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml index 133bcb26eb..cf1401332b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml @@ -171,7 +171,8 @@ ozone.scm.block.client.address - The address of the Ozone SCM block client service. + The address of the Ozone SCM block client service. If not defined + value of ozone.scm.client.address is used.