org.apache.hadoop.yarn.api.records.URL.getPort()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中org.apache.hadoop.yarn.api.records.URL.getPort()方法的一些代码示例,展示了URL.getPort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URL.getPort()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.records.URL
类名称:URL
方法名:getPort

URL.getPort介绍

[英]Get the port of the URL.
[中]获取URL的端口。

代码示例

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-common

private static String toString(org.apache.hadoop.yarn.api.records.URL url) {
 StringBuffer b = new StringBuffer();
 b.append(url.getScheme()).append("://").append(url.getHost());
 if(url.getPort() >= 0) {
  b.append(":").append(url.getPort());
 }
 b.append(url.getFile());
 return b.toString();
}

代码示例来源:origin: io.hops/hadoop-mapreduce-client-common

private static String toString(org.apache.hadoop.yarn.api.records.URL url) {
 StringBuffer b = new StringBuffer();
 b.append(url.getScheme()).append("://").append(url.getHost());
 if(url.getPort() >= 0) {
  b.append(":").append(url.getPort());
 }
 b.append(url.getFile());
 return b.toString();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-common

private static String toString(org.apache.hadoop.yarn.api.records.URL url) {
 StringBuffer b = new StringBuffer();
 b.append(url.getScheme()).append("://").append(url.getHost());
 if(url.getPort() >= 0) {
  b.append(":").append(url.getPort());
 }
 b.append(url.getFile());
 return b.toString();
}

代码示例来源:origin: org.apache.slider/slider-core

/**
 * Convert a YARN URL into a string value of a normal URL
 * @param url URL
 * @return string representatin
 */
public static String stringify(org.apache.hadoop.yarn.api.records.URL url) {
 StringBuilder builder = new StringBuilder();
 builder.append(url.getScheme()).append("://");
 if (url.getHost() != null) {
  builder.append(url.getHost()).append(":").append(url.getPort());
 }
 builder.append(url.getFile());
 return builder.toString();
}

代码示例来源:origin: apache/incubator-slider

/**
 * Convert a YARN URL into a string value of a normal URL
 * @param url URL
 * @return string representatin
 */
public static String stringify(org.apache.hadoop.yarn.api.records.URL url) {
 StringBuilder builder = new StringBuilder();
 builder.append(url.getScheme()).append("://");
 if (url.getHost() != null) {
  builder.append(url.getHost()).append(":").append(url.getPort());
 }
 builder.append(url.getFile());
 return builder.toString();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-api

@Public
@Stable
public Path toPath() throws URISyntaxException {
 return new Path(new URI(getScheme(), getUserInfo(),
  getHost(), getPort(), getFile(), null, null));
}

代码示例来源:origin: io.hops/hadoop-yarn-api

@Public
@Stable
public Path toPath() throws URISyntaxException {
 return new Path(new URI(getScheme(), getUserInfo(),
  getHost(), getPort(), getFile(), null, null));
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

/**
 * return a hadoop path from a given url
 * 
 * @param url
 *          url to convert
 * @return path from {@link URL}
 * @throws URISyntaxException
 */
public static Path getPathFromYarnURL(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 Path(
   (new URI(scheme, authority, url.getFile(), null, null)).normalize());
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common

/**
 * return a hadoop path from a given url
 * 
 * @param url
 *          url to convert
 * @return path from {@link URL}
 * @throws URISyntaxException
 */
public static Path getPathFromYarnURL(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 Path(
   (new URI(scheme, authority, url.getFile(), null, null)).normalize());
}

代码示例来源:origin: org.apache.tez/tez-runtime-internals

/**
 * return a {@link URI} from a given url
 *
 * @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();
}

相关文章