org.apache.hadoop.yarn.webapp.util
Class WebAppUtils

java.lang.Object
  extended by org.apache.hadoop.yarn.webapp.util.WebAppUtils

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class WebAppUtils
extends Object


Field Summary
static String HTTP_PREFIX
           
static String HTTPS_PREFIX
           
static String WEB_APP_KEY_PASSWORD_KEY
           
static String WEB_APP_KEYSTORE_PASSWORD_KEY
           
static String WEB_APP_TRUSTSTORE_PASSWORD_KEY
           
 
Constructor Summary
WebAppUtils()
           
 
Method Summary
static String getAggregatedLogURL(String serverHttpAddress, String allocatedNode, String containerId, String entity, String user)
           
static String getAHSWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)
           
static String getHttpSchemePrefix(org.apache.hadoop.conf.Configuration conf)
          Choose which scheme (HTTP or HTTPS) to use when generating a URL based on the configuration.
static String getNMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)
           
static String getProxyHostAndPort(org.apache.hadoop.conf.Configuration conf)
           
static List<String> getProxyHostsAndPortsForAmFilter(org.apache.hadoop.conf.Configuration conf)
           
static String getResolvedRMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)
           
static String getResolvedRMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.http.HttpConfig.Policy httpPolicy)
           
static String getResolvedRMWebAppURLWithScheme(org.apache.hadoop.conf.Configuration conf)
           
static String getRMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)
           
static String getRMWebAppURLWithScheme(org.apache.hadoop.conf.Configuration conf)
           
static String getRunningLogURL(String nodeHttpAddress, String containerId, String user)
           
static String getURLWithScheme(String schemePrefix, String url)
          if url has scheme then it will be returned as it is else it will return url with scheme.
static String getWebAppBindURL(org.apache.hadoop.conf.Configuration conf, String hostProperty, String webAppURLWithoutScheme)
          Get the URL to use for binding where bind hostname can be specified to override the hostname in the webAppURLWithoutScheme.
static org.apache.hadoop.http.HttpServer2.Builder loadSslConfiguration(org.apache.hadoop.http.HttpServer2.Builder builder)
          Load the SSL keystore / truststore into the HttpServer builder.
static org.apache.hadoop.http.HttpServer2.Builder loadSslConfiguration(org.apache.hadoop.http.HttpServer2.Builder builder, org.apache.hadoop.conf.Configuration sslConf)
          Load the SSL keystore / truststore into the HttpServer builder.
static void setNMWebAppHostNameAndPort(org.apache.hadoop.conf.Configuration conf, String hostName, int port)
           
static void setRMWebAppHostnameAndPort(org.apache.hadoop.conf.Configuration conf, String hostname, int port)
           
static void setRMWebAppPort(org.apache.hadoop.conf.Configuration conf, int port)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEB_APP_TRUSTSTORE_PASSWORD_KEY

public static final String WEB_APP_TRUSTSTORE_PASSWORD_KEY
See Also:
Constant Field Values

WEB_APP_KEYSTORE_PASSWORD_KEY

public static final String WEB_APP_KEYSTORE_PASSWORD_KEY
See Also:
Constant Field Values

WEB_APP_KEY_PASSWORD_KEY

public static final String WEB_APP_KEY_PASSWORD_KEY
See Also:
Constant Field Values

HTTPS_PREFIX

public static final String HTTPS_PREFIX
See Also:
Constant Field Values

HTTP_PREFIX

public static final String HTTP_PREFIX
See Also:
Constant Field Values
Constructor Detail

WebAppUtils

public WebAppUtils()
Method Detail

setRMWebAppPort

public static void setRMWebAppPort(org.apache.hadoop.conf.Configuration conf,
                                   int port)

setRMWebAppHostnameAndPort

public static void setRMWebAppHostnameAndPort(org.apache.hadoop.conf.Configuration conf,
                                              String hostname,
                                              int port)

setNMWebAppHostNameAndPort

public static void setNMWebAppHostNameAndPort(org.apache.hadoop.conf.Configuration conf,
                                              String hostName,
                                              int port)

getRMWebAppURLWithScheme

public static String getRMWebAppURLWithScheme(org.apache.hadoop.conf.Configuration conf)

getRMWebAppURLWithoutScheme

public static String getRMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)

getProxyHostsAndPortsForAmFilter

public static List<String> getProxyHostsAndPortsForAmFilter(org.apache.hadoop.conf.Configuration conf)

getProxyHostAndPort

public static String getProxyHostAndPort(org.apache.hadoop.conf.Configuration conf)

getResolvedRMWebAppURLWithScheme

public static String getResolvedRMWebAppURLWithScheme(org.apache.hadoop.conf.Configuration conf)

getResolvedRMWebAppURLWithoutScheme

public static String getResolvedRMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)

getResolvedRMWebAppURLWithoutScheme

public static String getResolvedRMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf,
                                                         org.apache.hadoop.http.HttpConfig.Policy httpPolicy)

getWebAppBindURL

public static String getWebAppBindURL(org.apache.hadoop.conf.Configuration conf,
                                      String hostProperty,
                                      String webAppURLWithoutScheme)
Get the URL to use for binding where bind hostname can be specified to override the hostname in the webAppURLWithoutScheme. Port specified in the webAppURLWithoutScheme will be used.

Parameters:
conf - the configuration
hostProperty - bind host property name
webAppURLWithoutScheme - web app URL without scheme String
Returns:
String representing bind URL

getNMWebAppURLWithoutScheme

public static String getNMWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)

getAHSWebAppURLWithoutScheme

public static String getAHSWebAppURLWithoutScheme(org.apache.hadoop.conf.Configuration conf)

getURLWithScheme

public static String getURLWithScheme(String schemePrefix,
                                      String url)
if url has scheme then it will be returned as it is else it will return url with scheme.

Parameters:
schemePrefix - eg. http:// or https://
url -
Returns:
url with scheme

getRunningLogURL

public static String getRunningLogURL(String nodeHttpAddress,
                                      String containerId,
                                      String user)

getAggregatedLogURL

public static String getAggregatedLogURL(String serverHttpAddress,
                                         String allocatedNode,
                                         String containerId,
                                         String entity,
                                         String user)

getHttpSchemePrefix

public static String getHttpSchemePrefix(org.apache.hadoop.conf.Configuration conf)
Choose which scheme (HTTP or HTTPS) to use when generating a URL based on the configuration.

Returns:
the scheme (HTTP / HTTPS)

loadSslConfiguration

public static org.apache.hadoop.http.HttpServer2.Builder loadSslConfiguration(org.apache.hadoop.http.HttpServer2.Builder builder)
Load the SSL keystore / truststore into the HttpServer builder.

Parameters:
builder - the HttpServer2.Builder to populate with ssl config

loadSslConfiguration

public static org.apache.hadoop.http.HttpServer2.Builder loadSslConfiguration(org.apache.hadoop.http.HttpServer2.Builder builder,
                                                                              org.apache.hadoop.conf.Configuration sslConf)
Load the SSL keystore / truststore into the HttpServer builder.

Parameters:
builder - the HttpServer2.Builder to populate with ssl config
sslConf - the Configuration instance to use during loading of SSL conf


Copyright © 2014 Apache Software Foundation. All Rights Reserved.