for (Container container : workerContainers) { Map<String, String> containerMessage = new HashMap<>(); containerMessage.put(AMParams.CONTAINER_HTTP_ADDRESS, container.getNodeHttpAddress()); if (tfEvaluator && container.getId().toString().equals(tfEvaluatorContainerId)) { containerMessage.put(AMParams.CONTAINER_ROLE, XLearningConstants.EVALUATOR); container.getNodeHttpAddress(), container.getId().toString(), userName)); containerMessage.put(AMParams.CONTAINER_HTTP_ADDRESS, container.getNodeHttpAddress()); if (xlearningAppType.equals("TENSORFLOW")) { containerMessage.put(AMParams.CONTAINER_ROLE, "ps"); container.getNodeHttpAddress(), container.getId().toString(), userName));
int i = 0; for (Container container : workerContainers) { set(CONTAINER_HTTP_ADDRESS + i, container.getNodeHttpAddress()); set(CONTAINER_ID + i, container.getId().toString()); if (app.context.getContainerStatus(new XLearningContainerId(container.getId())) != null) { set(CONTAINER_HTTP_ADDRESS + i, container.getNodeHttpAddress()); set(CONTAINER_ID + i, container.getId().toString()); if (app.context.getContainerStatus(new XLearningContainerId(container.getId())) != null) {
+ ", containerNode=" + allocatedContainer.getNodeId().getHost() + ":" + allocatedContainer.getNodeId().getPort() + ", containerNodeURI=" + allocatedContainer.getNodeHttpAddress() + ", containerResourceMemory" + allocatedContainer.getResource().getMemory()
nmLink = "http://" + task.container.getNodeHttpAddress(); } else { memoryMb = task.scheduler.getResource().memoryMb;
private String containerHostname() { String nodeHost = null; try { boolean hasProtocol = container.getNodeHttpAddress().startsWith("http"); java.net.URL nodehttpAddress = new java.net.URL((hasProtocol?"":"http://") + container.getNodeHttpAddress()); nodeHost = nodehttpAddress.getHost(); } catch (MalformedURLException e) { LOG.error(e.getMessage(), e); throw new IllegalStateException("Unable to parse " + container.getNodeHttpAddress() + " into a URL"); } return nodeHost; } }
@Override public void onContainersAllocated(List<Container> allocatedContainers) { LOG.info("Got response from RM for container ask, allocatedCnt=" + allocatedContainers.size()); for (Container allocatedContainer : allocatedContainers) { containers.put(allocatedContainer.getId(), allocatedContainer); state.registerContainer(allocatedContainer.getResource(), allocatedContainer); LOG.info("Launching shell command on a new container." + ", containerId=" + allocatedContainer.getId() + ", containerNode=" + allocatedContainer.getNodeId().getHost() + ":" + allocatedContainer.getNodeId().getPort() + ", containerNodeURI=" + allocatedContainer.getNodeHttpAddress() + ", containerResourceMemory=" + allocatedContainer.getResource().getMemory() + ", containerResourceVirtualCores=" + allocatedContainer.getResource().getVirtualCores()); } }
/**If container Assigned then return the node's address, otherwise null. */ @Override public String getNodeHttpAddress() { readLock.lock(); try { return container == null ? null : container.getNodeHttpAddress(); } finally { readLock.unlock(); } }
/**If container Assigned then return the node's address, otherwise null. */ @Override public String getNodeHttpAddress() { readLock.lock(); try { return container == null ? null : container.getNodeHttpAddress(); } finally { readLock.unlock(); } }
/**If container Assigned then return the node's address, otherwise null. */ @Override public String getNodeHttpAddress() { readLock.lock(); try { return container == null ? null : container.getNodeHttpAddress(); } finally { readLock.unlock(); } }
public static String constructContainerUrl(Container container) { try { return String.format(WORKER_LOG_URL_TEMPLATE, container.getNodeHttpAddress(), container.getId(), UserGroupInformation.getCurrentUser().getShortUserName()); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public Entry<TableContent,String> apply(ClusterNode input) { final String containerId = input.name; if (containerInstances.containsKey(containerId)) { RoleInstance roleInst = containerInstances.get(containerId); if (roleInst.container.getNodeHttpAddress() != null) { return Maps.<TableContent,String> immutableEntry( new TableAnchorContent(containerId, buildNodeUrlForContainer(roleInst.container.getNodeHttpAddress(), containerId)), null); } } return Maps.immutableEntry(new TableContent(input.name), null); }
@Override public Entry<TableContent,String> apply(ClusterNode input) { final String containerId = input.name; if (containerInstances.containsKey(containerId)) { RoleInstance roleInst = containerInstances.get(containerId); if (roleInst.container.getNodeHttpAddress() != null) { return Maps.<TableContent,String> immutableEntry( new TableAnchorContent(containerId, buildNodeUrlForContainer(roleInst.container.getNodeHttpAddress(), containerId)), null); } } return Maps.immutableEntry(new TableContent(input.name), null); }
private static void sendJHStartEventForAssignedFailTask(TaskAttemptImpl taskAttempt) { if (null == taskAttempt.container) { return; } taskAttempt.launchTime = taskAttempt.clock.getTime(); InetSocketAddress nodeHttpInetAddr = NetUtils.createSocketAddr(taskAttempt.container.getNodeHttpAddress()); taskAttempt.trackerName = nodeHttpInetAddr.getHostName(); taskAttempt.httpPort = nodeHttpInetAddr.getPort(); taskAttempt.sendLaunchedEvents(); }
private static void sendJHStartEventForAssignedFailTask(TaskAttemptImpl taskAttempt) { if (null == taskAttempt.container) { return; } taskAttempt.launchTime = taskAttempt.clock.getTime(); InetSocketAddress nodeHttpInetAddr = NetUtils.createSocketAddr(taskAttempt.container.getNodeHttpAddress()); taskAttempt.trackerName = nodeHttpInetAddr.getHostName(); taskAttempt.httpPort = nodeHttpInetAddr.getPort(); taskAttempt.sendLaunchedEvents(); }
private static void sendJHStartEventForAssignedFailTask(TaskAttemptImpl taskAttempt) { if (null == taskAttempt.container) { return; } taskAttempt.launchTime = taskAttempt.clock.getTime(); InetSocketAddress nodeHttpInetAddr = NetUtils.createSocketAddr(taskAttempt.container.getNodeHttpAddress()); taskAttempt.trackerName = nodeHttpInetAddr.getHostName(); taskAttempt.httpPort = nodeHttpInetAddr.getPort(); taskAttempt.sendLaunchedEvents(); }
@Override public String getLogURL() { try { readLock.lock(); StringBuilder logURL = new StringBuilder(); logURL.append(WebAppUtils.getHttpSchemePrefix(rmContext .getYarnConfiguration())); logURL.append(WebAppUtils.getRunningLogURL( container.getNodeHttpAddress(), ConverterUtils.toString(containerId), user)); return logURL.toString(); } finally { readLock.unlock(); } }
@Override public String getLogURL() { try { readLock.lock(); StringBuilder logURL = new StringBuilder(); logURL.append(WebAppUtils.getHttpSchemePrefix(rmContext .getYarnConfiguration())); logURL.append(WebAppUtils.getRunningLogURL( container.getNodeHttpAddress(), ConverterUtils.toString(containerId), user)); return logURL.toString(); } finally { readLock.unlock(); } }
@Override public String getLogURL() { try { readLock.lock(); StringBuilder logURL = new StringBuilder(); logURL.append(WebAppUtils.getHttpSchemePrefix(rmContext .getYarnConfiguration())); logURL.append(WebAppUtils.getRunningLogURL( container.getNodeHttpAddress(), getContainerId().toString(), user)); return logURL.toString(); } finally { readLock.unlock(); } }
public static String containerToString(Container container) { if (container == null) { return "null container"; } return String.format(Locale.ENGLISH, "ContainerID=%s nodeID=%s http=%s priority=%s resource=%s", container.getId(), container.getNodeId(), container.getNodeHttpAddress(), container.getPriority(), container.getResource()); }
public static String containerToString(Container container) { if (container == null) { return "null container"; } return String.format(Locale.ENGLISH, "ContainerID=%s nodeID=%s http=%s priority=%s resource=%s", container.getId(), container.getNodeId(), container.getNodeHttpAddress(), container.getPriority(), container.getResource()); }