Repository: hadoop Updated Branches: refs/heads/HDFS-7240 52640fb88 -> e269865a2
HDFS-12183. Ozone: KSM : Use proper defaults for block client address. Contributed by Lokesh Jain. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e269865a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e269865a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e269865a Branch: refs/heads/HDFS-7240 Commit: e269865a2bbe7f96d55a57e54f25c4eb15c7ccbb Parents: 52640fb Author: Anu Engineer <aengin...@apache.org> Authored: Fri Jul 28 15:40:59 2017 -0700 Committer: Anu Engineer <aengin...@apache.org> Committed: Fri Jul 28 15:40:59 2017 -0700 ---------------------------------------------------------------------- .../apache/hadoop/ozone/OzoneClientUtils.java | 21 +++++++++++++------- .../src/main/resources/ozone-default.xml | 3 ++- 2 files changed, 16 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/e269865a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneClientUtils.java ---------------------------------------------------------------------- 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 47d4fe5..b4767dc 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 final class OzoneClientUtils { /** * 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<String> host = getHostNameFromConfigKeys(conf, + Optional<String> 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<Integer> port = getPortNumberFromConfigKeys(conf, http://git-wip-us.apache.org/repos/asf/hadoop/blob/e269865a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml ---------------------------------------------------------------------- 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 133bcb2..cf14013 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 @@ <name>ozone.scm.block.client.address</name> <value></value> <description> - 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. </description> </property> --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org