Java Code Examples for org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerNode#getRunningContainers()
The following examples show how to use
org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerNode#getRunningContainers() .
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: FifoScheduler.java From hadoop with Apache License 2.0 | 6 votes |
private synchronized void removeNode(RMNode nodeInfo) { FiCaSchedulerNode node = getNode(nodeInfo.getNodeID()); if (node == null) { return; } // Kill running containers for(RMContainer container : node.getRunningContainers()) { completedContainer(container, SchedulerUtils.createAbnormalContainerStatus( container.getContainerId(), SchedulerUtils.LOST_CONTAINER), RMContainerEventType.KILL); } //Remove the node this.nodes.remove(nodeInfo.getNodeID()); updateMaximumAllocation(node, false); // Update cluster metrics Resources.subtractFrom(clusterResource, node.getRMNode().getTotalCapability()); }
Example 2
Source File: FifoScheduler.java From big-c with Apache License 2.0 | 6 votes |
private synchronized void removeNode(RMNode nodeInfo) { FiCaSchedulerNode node = getNode(nodeInfo.getNodeID()); if (node == null) { return; } // Kill running containers for(RMContainer container : node.getRunningContainers()) { completedContainer(container, SchedulerUtils.createAbnormalContainerStatus( container.getContainerId(), SchedulerUtils.LOST_CONTAINER), RMContainerEventType.KILL); } //Remove the node this.nodes.remove(nodeInfo.getNodeID()); updateMaximumAllocation(node, false); // Update cluster metrics Resources.subtractFrom(clusterResource, node.getRMNode().getTotalCapability()); }
Example 3
Source File: CapacityScheduler.java From hadoop with Apache License 2.0 | 5 votes |
/** * Process node labels update on a node. * * TODO: Currently capacity scheduler will kill containers on a node when * labels on the node changed. It is a simply solution to ensure guaranteed * capacity on labels of queues. When YARN-2498 completed, we can let * preemption policy to decide if such containers need to be killed or just * keep them running. */ private synchronized void updateLabelsOnNode(NodeId nodeId, Set<String> newLabels) { FiCaSchedulerNode node = nodes.get(nodeId); if (null == node) { return; } // labels is same, we don't need do update if (node.getLabels().size() == newLabels.size() && node.getLabels().containsAll(newLabels)) { return; } // Kill running containers since label is changed for (RMContainer rmContainer : node.getRunningContainers()) { ContainerId containerId = rmContainer.getContainerId(); completedContainer(rmContainer, ContainerStatus.newInstance(containerId, ContainerState.COMPLETE, String.format( "Container=%s killed since labels on the node=%s changed", containerId.toString(), nodeId.toString()), ContainerExitStatus.KILLED_BY_RESOURCEMANAGER), RMContainerEventType.KILL); } // Unreserve container on this node RMContainer reservedContainer = node.getReservedContainer(); if (null != reservedContainer) { dropContainerReservation(reservedContainer); } // Update node labels after we've done this node.updateLabels(newLabels); }
Example 4
Source File: CapacityScheduler.java From big-c with Apache License 2.0 | 5 votes |
/** * Process node labels update on a node. * * TODO: Currently capacity scheduler will kill containers on a node when * labels on the node changed. It is a simply solution to ensure guaranteed * capacity on labels of queues. When YARN-2498 completed, we can let * preemption policy to decide if such containers need to be killed or just * keep them running. */ private synchronized void updateLabelsOnNode(NodeId nodeId, Set<String> newLabels) { FiCaSchedulerNode node = nodes.get(nodeId); if (null == node) { return; } // labels is same, we don't need do update if (node.getLabels().size() == newLabels.size() && node.getLabels().containsAll(newLabels)) { return; } // Kill running containers since label is changed for (RMContainer rmContainer : node.getRunningContainers()) { ContainerId containerId = rmContainer.getContainerId(); completedContainer(rmContainer, ContainerStatus.newInstance(containerId, ContainerState.COMPLETE, String.format( "Container=%s killed since labels on the node=%s changed", containerId.toString(), nodeId.toString()), ContainerExitStatus.KILLED_BY_RESOURCEMANAGER), RMContainerEventType.KILL); } // Unreserve container on this node RMContainer reservedContainer = node.getReservedContainer(); if (null != reservedContainer) { dropContainerReservation(reservedContainer); } // Update node labels after we've done this node.updateLabels(newLabels); }
Example 5
Source File: CapacityScheduler.java From hadoop with Apache License 2.0 | 4 votes |
private synchronized void removeNode(RMNode nodeInfo) { // update this node to node label manager if (labelManager != null) { labelManager.deactivateNode(nodeInfo.getNodeID()); } FiCaSchedulerNode node = nodes.get(nodeInfo.getNodeID()); if (node == null) { return; } Resources.subtractFrom(clusterResource, node.getRMNode().getTotalCapability()); root.updateClusterResource(clusterResource, new ResourceLimits( clusterResource)); int numNodes = numNodeManagers.decrementAndGet(); if (scheduleAsynchronously && numNodes == 0) { asyncSchedulerThread.suspendSchedule(); } // Remove running containers List<RMContainer> runningContainers = node.getRunningContainers(); for (RMContainer container : runningContainers) { completedContainer(container, SchedulerUtils.createAbnormalContainerStatus( container.getContainerId(), SchedulerUtils.LOST_CONTAINER), RMContainerEventType.KILL); } // Remove reservations, if any RMContainer reservedContainer = node.getReservedContainer(); if (reservedContainer != null) { completedContainer(reservedContainer, SchedulerUtils.createAbnormalContainerStatus( reservedContainer.getContainerId(), SchedulerUtils.LOST_CONTAINER), RMContainerEventType.KILL); } this.nodes.remove(nodeInfo.getNodeID()); updateMaximumAllocation(node, false); LOG.info("Removed node " + nodeInfo.getNodeAddress() + " clusterResource: " + clusterResource); }
Example 6
Source File: CapacityScheduler.java From big-c with Apache License 2.0 | 4 votes |
private synchronized void removeNode(RMNode nodeInfo) { // update this node to node label manager if (labelManager != null) { labelManager.deactivateNode(nodeInfo.getNodeID()); } FiCaSchedulerNode node = nodes.get(nodeInfo.getNodeID()); if (node == null) { return; } Resources.subtractFrom(clusterResource, node.getRMNode().getTotalCapability()); root.updateClusterResource(clusterResource, new ResourceLimits( clusterResource)); int numNodes = numNodeManagers.decrementAndGet(); if (scheduleAsynchronously && numNodes == 0) { asyncSchedulerThread.suspendSchedule(); } // Remove running containers List<RMContainer> runningContainers = node.getRunningContainers(); for (RMContainer container : runningContainers) { completedContainer(container, SchedulerUtils.createAbnormalContainerStatus( container.getContainerId(), SchedulerUtils.LOST_CONTAINER), RMContainerEventType.KILL); } // Remove reservations, if any RMContainer reservedContainer = node.getReservedContainer(); if (reservedContainer != null) { completedContainer(reservedContainer, SchedulerUtils.createAbnormalContainerStatus( reservedContainer.getContainerId(), SchedulerUtils.LOST_CONTAINER), RMContainerEventType.KILL); } this.nodes.remove(nodeInfo.getNodeID()); updateMaximumAllocation(node, false); LOG.info("Removed node " + nodeInfo.getNodeAddress() + " clusterResource: " + clusterResource); }