Example usage for org.apache.hadoop.yarn.api.records URL getUserInfo

List of usage examples for org.apache.hadoop.yarn.api.records URL getUserInfo

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.api.records URL getUserInfo.

Prototype

@Public
@Stable
public abstract String getUserInfo();

Source Link

Document

Get the user info of the URL.

Usage

From source file:org.apache.tez.common.TezConverterUtils.java

License:Apache License

/**
 * return a {@link URI} from a given url
 * //from ww w  .ja va  2  s.  co m
 * @param url
 *          url to convert
 * @return path from {@link URL}
 * @throws URISyntaxException
 */
@Private
public static URI getURIFromYarnURL(URL url) throws URISyntaxException {
    String scheme = url.getScheme() == null ? "" : url.getScheme();

    String authority = "";
    if (url.getHost() != null) {
        authority = url.getHost();
        if (url.getUserInfo() != null) {
            authority = url.getUserInfo() + "@" + authority;
        }
        if (url.getPort() > 0) {
            authority += ":" + url.getPort();
        }
    }

    return new URI(scheme, authority, url.getFile(), null, null).normalize();
}