Class ProxyUriUtils
java.lang.Object
org.apache.hadoop.yarn.server.webproxy.ProxyUriUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringQuery Parameter indicating that the URI was approved.static final StringBase path where the proxy servlet will handle requests.static final StringPath Specification for the proxy servlet.static final StringName of the servlet to use when registering the proxy servlet.static final StringPath component added when the proxy redirects the connection. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetPath(org.apache.hadoop.yarn.api.records.ApplicationId id) Get the proxied path for an application.static StringgetPath(org.apache.hadoop.yarn.api.records.ApplicationId id, boolean redirected) Get the proxied path for an application.static StringGet the proxied path for an application.static StringGet the proxied path for an application.static StringgetPathAndQuery(org.apache.hadoop.yarn.api.records.ApplicationId id, String path, String query, boolean approved) Get the proxied path for an applicationstatic URIgetProxyUri(URI originalUri, URI proxyUri, org.apache.hadoop.yarn.api.records.ApplicationId id) Get a proxied URI for the original URI.static StringgetSchemeFromUrl(String url) Returns the scheme if present in the url eg.static URIgetUriFromAMUrl(String scheme, String noSchemeUrl) Create a URI form a no scheme Url, such as is returned by the AM.static URIgetUriFromTrackingPlugins(org.apache.hadoop.yarn.api.records.ApplicationId id, List<org.apache.hadoop.yarn.util.TrackingUriPlugin> trackingUriPlugins) Returns the first valid tracking link, if any, from the given id from the given list of plug-ins, if any.
-
Field Details
-
PROXY_SERVLET_NAME
Name of the servlet to use when registering the proxy servlet.- See Also:
-
PROXY_BASE
Base path where the proxy servlet will handle requests.- See Also:
-
REDIRECT
Path component added when the proxy redirects the connection.- See Also:
-
PROXY_PATH_SPEC
Path Specification for the proxy servlet.- See Also:
-
PROXY_APPROVAL_PARAM
Query Parameter indicating that the URI was approved.- See Also:
-
-
Constructor Details
-
ProxyUriUtils
public ProxyUriUtils()
-
-
Method Details
-
getPath
Get the proxied path for an application.- Parameters:
id- the application id to use- Returns:
- the base path to that application through the proxy
-
getPath
public static String getPath(org.apache.hadoop.yarn.api.records.ApplicationId id, boolean redirected) Get the proxied path for an application.- Parameters:
id- the application id to useredirected- whether the path should contain the redirect component- Returns:
- the base path to that application through the proxy
-
getPath
Get the proxied path for an application.- Parameters:
id- the application id to usepath- the rest of the path to the application- Returns:
- the base path to that application through the proxy
-
getPath
public static String getPath(org.apache.hadoop.yarn.api.records.ApplicationId id, String path, boolean redirected) Get the proxied path for an application.- Parameters:
id- the application id to usepath- the rest of the path to the applicationredirected- whether the path should contain the redirect component- Returns:
- the base path to that application through the proxy
-
getPathAndQuery
public static String getPathAndQuery(org.apache.hadoop.yarn.api.records.ApplicationId id, String path, String query, boolean approved) Get the proxied path for an application- Parameters:
id- the id of the applicationpath- the path of the application.query- the query parametersapproved- true if the user has approved accessing this app.- Returns:
- the proxied path for this app.
-
getProxyUri
public static URI getProxyUri(URI originalUri, URI proxyUri, org.apache.hadoop.yarn.api.records.ApplicationId id) Get a proxied URI for the original URI.- Parameters:
originalUri- the original URI to go through the proxy, or null if a default path "/" can be used.proxyUri- the URI of the proxy itself, scheme, host and port are used.id- the id of the application- Returns:
- the proxied URI
-
getUriFromAMUrl
Create a URI form a no scheme Url, such as is returned by the AM.- Parameters:
noSchemeUrl- the URL format returned by an AM- Returns:
- a URI with an http scheme
- Throws:
URISyntaxException- if the url is not formatted correctly.
-
getUriFromTrackingPlugins
public static URI getUriFromTrackingPlugins(org.apache.hadoop.yarn.api.records.ApplicationId id, List<org.apache.hadoop.yarn.util.TrackingUriPlugin> trackingUriPlugins) throws URISyntaxException Returns the first valid tracking link, if any, from the given id from the given list of plug-ins, if any.- Parameters:
id- the id of the application for which the tracking link is desiredtrackingUriPlugins- list of plugins from which to get the tracking link- Returns:
- the desired link if possible, otherwise null
- Throws:
URISyntaxException
-
getSchemeFromUrl
Returns the scheme if present in the url eg. "https://issues.apache.org/jira/browse/YARN" -> "https"
-