HDFS-12183. Ozone: KSM : Use proper defaults for block client address. Contributed by Lokesh Jain.
This commit is contained in:
parent
7907fe1c80
commit
86b42907cf
|
@ -169,22 +169,29 @@ public final class OzoneClientUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the socket address that should be used by clients to connect
|
* 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
|
* @param conf
|
||||||
* @return Target InetSocketAddress for the SCM block client endpoint.
|
* @return Target InetSocketAddress for the SCM block client endpoint.
|
||||||
|
* @throws IllegalArgumentException if configuration is not defined.
|
||||||
*/
|
*/
|
||||||
public static InetSocketAddress getScmAddressForBlockClients(
|
public static InetSocketAddress getScmAddressForBlockClients(
|
||||||
Configuration conf) {
|
Configuration conf) {
|
||||||
final Optional<String> host = getHostNameFromConfigKeys(conf,
|
Optional<String> host = getHostNameFromConfigKeys(conf,
|
||||||
ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY);
|
ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY);
|
||||||
|
|
||||||
if (!host.isPresent()) {
|
if (!host.isPresent()) {
|
||||||
throw new IllegalArgumentException(
|
host = getHostNameFromConfigKeys(conf,
|
||||||
ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY +
|
ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY);
|
||||||
" must be defined. See" +
|
if (!host.isPresent()) {
|
||||||
" https://wiki.apache.org/hadoop/Ozone#Configuration for details" +
|
throw new IllegalArgumentException(
|
||||||
" on configuring Ozone.");
|
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,
|
final Optional<Integer> port = getPortNumberFromConfigKeys(conf,
|
||||||
|
|
|
@ -171,7 +171,8 @@
|
||||||
<name>ozone.scm.block.client.address</name>
|
<name>ozone.scm.block.client.address</name>
|
||||||
<value></value>
|
<value></value>
|
||||||
<description>
|
<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>
|
</description>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue