public static int getRunningContainers() { int count = 0; for (int nmId = 0; nmId < NUM_NODEMANAGERS; nmId++) { NodeManager nm = yarnCluster.getNodeManager(nmId); ConcurrentMap<ContainerId, Container> containers = nm.getNMContext().getContainers(); count += containers.size(); } return count; }
ConcurrentMap<ContainerId, Container> containers = nm.getNMContext().getContainers(); for (Map.Entry<ContainerId, Container> entry : containers.entrySet()) { String command = StringUtils.join(entry.getValue().getLaunchContext().getCommands(), " "); if (command.contains(YarnTaskExecutorRunner.class.getSimpleName())) { taskManagerContainer = entry.getKey(); nodeManager.getNMContext().getContainerManager().stopContainers(scr);
private NMNodeLabelsHandler createNMNodeLabelsHandler( NodeLabelsProvider nodeLabelsProvider) { if (nodeLabelsProvider == null) { return new NMCentralizedNodeLabelsHandler(); } else { return new NMDistributedNodeLabelsHandler(nodeLabelsProvider, this.getConfig()); } }
@Override public void writeLocalWrapperScript(Path launchDst, Path pidFile) throws IOException { writeSessionScript(launchDst, pidFile); super.writeLocalWrapperScript(launchDst, pidFile); }
protected LocalWrapperScriptBuilder getLocalWrapperScriptBuilder( String containerIdStr, Path containerWorkDir) { return Shell.WINDOWS ? new WindowsLocalWrapperScriptBuilder(containerIdStr, containerWorkDir) : new UnixLocalWrapperScriptBuilder(containerWorkDir); }
/** * @return <em>true</em> if the node is healthy */ boolean isHealthy() { boolean scriptHealthStatus = (nodeHealthScriptRunner == null) ? true : nodeHealthScriptRunner.isHealthy(); return scriptHealthStatus && dirsHandler.areDisksHealthy(); }
@Override public void writeLocalWrapperScript(Path launchDst, Path pidFile) throws IOException { writeSessionScript(launchDst, pidFile); super.writeLocalWrapperScript(launchDst, pidFile); }
private int verifyContainerLog(int containerNum, List<String> expectedContent, boolean count, String expectedWord) { File logFolder = new File(yarnComponent.getYARNCluster().getNodeManager(0).getConfig() .get(YarnConfiguration.NM_LOG_DIRS, YarnConfiguration.DEFAULT_NM_LOG_DIRS));
/** * Get the utilization of the node. This includes the containers. * @return Resource utilization of the node. */ private ResourceUtilization getNodeUtilization() { NodeResourceMonitorImpl nodeResourceMonitor = (NodeResourceMonitorImpl) this.context.getNodeResourceMonitor(); return nodeResourceMonitor.getUtilization(); }
@Override public void reportException(Exception ex) { healthChecker.reportException(ex); sendOutofBandHeartBeat(); }
@Override public void writeLocalWrapperScript(Path launchDst, Path pidFile) throws IOException { writeSessionScript(launchDst, pidFile); super.writeLocalWrapperScript(launchDst, pidFile); }
protected LocalWrapperScriptBuilder getLocalWrapperScriptBuilder( String containerIdStr, Path containerWorkDir) { return Shell.WINDOWS ? new WindowsLocalWrapperScriptBuilder(containerIdStr, containerWorkDir) : new UnixLocalWrapperScriptBuilder(containerWorkDir); }
private NMNodeLabelsHandler createNMNodeLabelsHandler( NodeLabelsProvider nodeLabelsProvider) { if (nodeLabelsProvider == null) { return new NMCentralizedNodeLabelsHandler(); } else { return new NMDistributedNodeLabelsHandler(nodeLabelsProvider, this.getConfig()); } }
/** * @return <em>true</em> if the node is healthy */ boolean isHealthy() { boolean scriptHealthStatus = (nodeHealthScriptRunner == null) ? true : nodeHealthScriptRunner.isHealthy(); return scriptHealthStatus && dirsHandler.areDisksHealthy(); }
@Override public void writeLocalWrapperScript(Path launchDst, Path pidFile) throws IOException { writeSessionScript(launchDst, pidFile); super.writeLocalWrapperScript(launchDst, pidFile); }
/** * Get the utilization of the node. This includes the containers. * @return Resource utilization of the node. */ private ResourceUtilization getNodeUtilization() { NodeResourceMonitorImpl nodeResourceMonitor = (NodeResourceMonitorImpl) this.context.getNodeResourceMonitor(); return nodeResourceMonitor.getUtilization(); }
@Override public void writeLocalWrapperScript(Path launchDst, Path pidFile) throws IOException { writeSessionScript(launchDst, pidFile); super.writeLocalWrapperScript(launchDst, pidFile); }
protected LocalWrapperScriptBuilder getLocalWrapperScriptBuilder( String containerIdStr, Path containerWorkDir) { return Shell.WINDOWS ? new WindowsLocalWrapperScriptBuilder(containerIdStr, containerWorkDir) : new UnixLocalWrapperScriptBuilder(containerWorkDir); }
@Override public void writeLocalWrapperScript(Path launchDst, Path pidFile) throws IOException { writeSessionScript(launchDst, pidFile); super.writeLocalWrapperScript(launchDst, pidFile); }
@Override public void writeLocalWrapperScript(Path launchDst, Path pidFile) throws IOException { writeSessionScript(launchDst, pidFile); super.writeLocalWrapperScript(launchDst, pidFile); }