hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
public static CloseableHttpClient newHttpClient(Configuration conf) {
    long socketTimeout = OzoneConfigKeys
        .OZONE_CLIENT_SOCKET_TIMEOUT_DEFAULT;
    long connectionTimeout = OzoneConfigKeys
        .OZONE_CLIENT_CONNECTION_TIMEOUT_DEFAULT;
    if (conf != null) {
      socketTimeout = conf.getTimeDuration(
          OzoneConfigKeys.OZONE_CLIENT_SOCKET_TIMEOUT,
          OzoneConfigKeys.OZONE_CLIENT_SOCKET_TIMEOUT_DEFAULT,
          TimeUnit.MILLISECONDS);
      connectionTimeout = conf.getTimeDuration(
          OzoneConfigKeys.OZONE_CLIENT_CONNECTION_TIMEOUT,
          OzoneConfigKeys.OZONE_CLIENT_CONNECTION_TIMEOUT_DEFAULT,
          TimeUnit.MILLISECONDS);
    }

    CloseableHttpClient client = HttpClients.custom()
        .setDefaultRequestConfig(
            RequestConfig.custom()
                .setSocketTimeout(Math.toIntExact(socketTimeout))
                .setConnectTimeout(Math.toIntExact(connectionTimeout))
                .build())
        .build();
    return client;
  }
/**
   * Returns a {@link CloseableHttpClient} configured by given configuration.
   * If conf is null, returns a default instance.
   *
   * @param conf configuration
   * @return a {@link CloseableHttpClient} instance.
   */
Returns a  CloseableHttpClient configured by given configuration.
If conf is null, returns a default instance.

@param conf configuration
@return a  CloseableHttpClient instance.
Returns a CloseableHttpClient configured by given configuration . If conf is null returns a default instance . @param conf configuration @return a CloseableHttpClient instance .
public static CloseableHttpClient newHttpClient(Configuration conf) {
    long socketTimeout = OzoneConfigKeys
        .OZONE_CLIENT_SOCKET_TIMEOUT_DEFAULT;
    long connectionTimeout = OzoneConfigKeys
        .OZONE_CLIENT_CONNECTION_TIMEOUT_DEFAULT;
    if (conf != null) {
      socketTimeout = conf.getTimeDuration(
          OzoneConfigKeys.OZONE_CLIENT_SOCKET_TIMEOUT,
          OzoneConfigKeys.OZONE_CLIENT_SOCKET_TIMEOUT_DEFAULT,
          TimeUnit.MILLISECONDS);
      connectionTimeout = conf.getTimeDuration(
          OzoneConfigKeys.OZONE_CLIENT_CONNECTION_TIMEOUT,
          OzoneConfigKeys.OZONE_CLIENT_CONNECTION_TIMEOUT_DEFAULT,
          TimeUnit.MILLISECONDS);
    }
    CloseableHttpClient client = HttpClients.custom()
        .setDefaultRequestConfig(
            RequestConfig.custom()
                .setSocketTimeout(Math.toIntExact(socketTimeout))
                .setConnectTimeout(Math.toIntExact(connectionTimeout))
                .build())
        .build();
    return client;
  }
public static CloseableHttpClient newHttpClient ( Configuration conf ) { long socketTimeout = OzoneConfigKeys . OZONE_CLIENT_SOCKET_TIMEOUT_DEFAULT ; long connectionTimeout = OzoneConfigKeys . OZONE_CLIENT_CONNECTION_TIMEOUT_DEFAULT ; if ( conf != null ) { socketTimeout = conf . getTimeDuration ( OzoneConfigKeys . OZONE_CLIENT_SOCKET_TIMEOUT , OzoneConfigKeys . OZONE_CLIENT_SOCKET_TIMEOUT_DEFAULT , TimeUnit . MILLISECONDS ) ; connectionTimeout = conf . getTimeDuration ( OzoneConfigKeys . OZONE_CLIENT_CONNECTION_TIMEOUT , OzoneConfigKeys . OZONE_CLIENT_CONNECTION_TIMEOUT_DEFAULT , TimeUnit . MILLISECONDS ) ; } CloseableHttpClient client = HttpClients . custom ( ) . setDefaultRequestConfig ( RequestConfig . custom ( ) . setSocketTimeout ( Math . toIntExact ( socketTimeout ) ) . setConnectTimeout ( Math . toIntExact ( connectionTimeout ) ) . build ( ) ) . build ( ) ; return client ; }
Returns a {@link CloseableHttpClient} configured by given configuration.
Returns a { @link CloseableHttpClient } configured by given configuration .