热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.hadoop.yarn.util.ConverterUtils.toNodeIdWithDefaultPort()方法的使用及代码示例

本文整理了Java中org.apache.hadoop.yarn.util.ConverterUtils.toNodeIdWithDefaultPort()方法的一些代

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

ConverterUtils.toNodeIdWithDefaultPort介绍

暂无

代码示例

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

@POST
@Path(RMWSConsts.NODES_NODEID_REPLACE_LABELS)
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
@Override
public Response replaceLabelsOnNode(
@QueryParam("labels") Set newNodeLabelsName,
@Context HttpServletRequest hsr, @PathParam("nodeId") String nodeId)
throws Exception {
UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true);
initForWritableEndpoints(callerUGI, false);
NodeId nid = ConverterUtils.toNodeIdWithDefaultPort(nodeId);
Map> newLabelsForNode =
new HashMap>();
newLabelsForNode.put(nid, new HashSet(newNodeLabelsName));
return replaceLabelsOnNode(newLabelsForNode, hsr,
"/nodes/nodeid/replace-labels");
}

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

"node name cannot be empty");
NodeId nodeId = ConverterUtils.toNodeIdWithDefaultPort(nodeIdStr);
map.put(nodeId, new HashSet());

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

@GET
@Path(RMWSConsts.NODES_NODEID_GETLABELS)
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
@Override
public NodeLabelsInfo getLabelsOnNode(@Context HttpServletRequest hsr,
@PathParam(RMWSConsts.NODEID) String nodeId) throws IOException {
initForReadableEndpoints();
NodeId nid = ConverterUtils.toNodeIdWithDefaultPort(nodeId);
List labels = new ArrayList(
rm.getRMContext().getNodeLabelManager().getLabelsInfoByNode(nid));
return new NodeLabelsInfo(labels);
}

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

"node name cannot be empty");
NodeId nodeId = ConverterUtils.toNodeIdWithDefaultPort(nodeIdStr);
map.put(nodeId, new HashSet());

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

"node name cannot be empty");
NodeId nodeId = ConverterUtils.toNodeIdWithDefaultPort(nodeIdStr);
map.put(nodeId, new HashSet());

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

"node name cannot be empty");
NodeId nodeId = ConverterUtils.toNodeIdWithDefaultPort(nodeIdStr);
map.put(nodeId, new HashSet());

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

@GET
@Path("/nodes/{nodeId}/get-labels")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public NodeLabelsInfo getLabelsOnNode(@Context HttpServletRequest hsr,
@PathParam("nodeId") String nodeId)
throws IOException {
init();
NodeId nid = ConverterUtils.toNodeIdWithDefaultPort(nodeId);
return new NodeLabelsInfo(
rm.getRMContext().getNodeLabelManager().getLabelsOnNode(nid));
}

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

@GET
@Path("/nodes/{nodeId}/get-labels")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public NodeLabelsInfo getLabelsOnNode(@Context HttpServletRequest hsr,
@PathParam("nodeId") String nodeId)
throws IOException {
init();
NodeId nid = ConverterUtils.toNodeIdWithDefaultPort(nodeId);
return new NodeLabelsInfo(
rm.getRMContext().getNodeLabelManager().getLabelsOnNode(nid));
}

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

@POST
@Path(RMWSConsts.REPLACE_NODE_TO_LABELS)
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
@Override
public Response replaceLabelsOnNodes(
final NodeToLabelsEntryList newNodeToLabels,
@Context HttpServletRequest hsr) throws IOException {
UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true);
initForWritableEndpoints(callerUGI, false);
Map> nodeIdToLabels =
new HashMap>();
for (NodeToLabelsEntry nitle : newNodeToLabels.getNodeToLabels()) {
nodeIdToLabels.put(
ConverterUtils.toNodeIdWithDefaultPort(nitle.getNodeId()),
new HashSet(nitle.getNodeLabels()));
}
return replaceLabelsOnNode(nodeIdToLabels, hsr, "/replace-node-to-labels");
}

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

NodeId nid = ConverterUtils.toNodeIdWithDefaultPort(nodeId);

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

NodeId nid = ConverterUtils.toNodeIdWithDefaultPort(nodeId);

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

nodeIdToLabels.put(ConverterUtils.toNodeIdWithDefaultPort(nitle.getKey()),
new HashSet(nitle.getValue().getNodeLabels()));

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

nodeIdToLabels.put(ConverterUtils.toNodeIdWithDefaultPort(nitle.getKey()),
new HashSet(nitle.getValue().getNodeLabels()));

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

@Test
public void testNodeIdWithDefaultPort() throws URISyntaxException {
NodeId nid;

nid = ConverterUtils.toNodeIdWithDefaultPort("node:10");
assertEquals(nid.getPort(), 10);
assertEquals(nid.getHost(), "node");

nid = ConverterUtils.toNodeIdWithDefaultPort("node");
assertEquals(nid.getPort(), 0);
assertEquals(nid.getHost(), "node");
}

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

@Test
public void testNodeIdWithDefaultPort() throws URISyntaxException {
NodeId nid;

nid = ConverterUtils.toNodeIdWithDefaultPort("node:10");
assertEquals(nid.getPort(), 10);
assertEquals(nid.getHost(), "node");

nid = ConverterUtils.toNodeIdWithDefaultPort("node");
assertEquals(nid.getPort(), 0);
assertEquals(nid.getHost(), "node");
}

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

@Test
public void testNodeIdWithDefaultPort() throws URISyntaxException {
NodeId nid;

nid = ConverterUtils.toNodeIdWithDefaultPort("node:10");
assertEquals(nid.getPort(), 10);
assertEquals(nid.getHost(), "node");

nid = ConverterUtils.toNodeIdWithDefaultPort("node");
assertEquals(nid.getPort(), 0);
assertEquals(nid.getHost(), "node");
}

推荐阅读
author-avatar
静静
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有