Java Code Examples for org.apache.hadoop.yarn.api.records.URL#setPort()

The following examples show how to use org.apache.hadoop.yarn.api.records.URL#setPort() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConverterUtils.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public static URL getYarnUrlFromURI(URI uri) {
  URL url = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(URL.class);
  if (uri.getHost() != null) {
    url.setHost(uri.getHost());
  }
  if (uri.getUserInfo() != null) {
    url.setUserInfo(uri.getUserInfo());
  }
  url.setPort(uri.getPort());
  url.setScheme(uri.getScheme());
  url.setFile(uri.getPath());
  return url;
}
 
Example 2
Source File: BuilderUtils.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public static URL newURL(String scheme, String host, int port, String file) {
  URL url = recordFactory.newRecordInstance(URL.class);
  url.setScheme(scheme);
  url.setHost(host);
  url.setPort(port);
  url.setFile(file);
  return url;
}
 
Example 3
Source File: ConverterUtils.java    From big-c with Apache License 2.0 5 votes vote down vote up
public static URL getYarnUrlFromURI(URI uri) {
  URL url = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(URL.class);
  if (uri.getHost() != null) {
    url.setHost(uri.getHost());
  }
  if (uri.getUserInfo() != null) {
    url.setUserInfo(uri.getUserInfo());
  }
  url.setPort(uri.getPort());
  url.setScheme(uri.getScheme());
  url.setFile(uri.getPath());
  return url;
}
 
Example 4
Source File: BuilderUtils.java    From big-c with Apache License 2.0 5 votes vote down vote up
public static URL newURL(String scheme, String host, int port, String file) {
  URL url = recordFactory.newRecordInstance(URL.class);
  url.setScheme(scheme);
  url.setHost(host);
  url.setPort(port);
  url.setFile(file);
  return url;
}