/** * The Scheduler has allocated containers on this node to the given * application. * @param rmContainer Allocated container */ public void allocateContainer(RMContainer rmContainer) { allocateContainer(rmContainer, false); }
/** * Recover a container. * @param rmContainer Container to recover. */ public synchronized void recoverContainer(RMContainer rmContainer) { if (rmContainer.getState().equals(RMContainerState.COMPLETED)) { return; } allocateContainer(rmContainer, true); }
public synchronized void recoverContainer(RMContainer rmContainer) { if (rmContainer.getState().equals(RMContainerState.COMPLETED)) { return; } allocateContainer(rmContainer); }
public synchronized void recoverContainer(RMContainer rmContainer) { if (rmContainer.getState().equals(RMContainerState.COMPLETED)) { return; } allocateContainer(rmContainer); }
protected synchronized void allocateContainer(RMContainer rmContainer, boolean launchedOnNode) { super.allocateContainer(rmContainer, launchedOnNode); final Container container = rmContainer.getContainer(); LOG.info("Assigned container " + container.getId() + " of capacity " + container.getResource() + " on host " + getRMNode().getNodeAddress() + ", which has " + getNumContainers() + " containers, " + getAllocatedResource() + " used and " + getUnallocatedResource() + " available after allocation"); }
protected synchronized void allocateContainer(RMContainer rmContainer, boolean launchedOnNode) { super.allocateContainer(rmContainer, launchedOnNode); if (LOG.isDebugEnabled()) { final Container container = rmContainer.getContainer();
public static RMContainer createOpportunisticRmContainer(RMContext rmContext, Container container, boolean isRemotelyAllocated) { SchedulerApplicationAttempt appAttempt = ((AbstractYarnScheduler) rmContext.getScheduler()) .getCurrentAttemptForContainer(container.getId()); RMContainer rmContainer = new RMContainerImpl(container, SchedulerRequestKey.extractFrom(container), appAttempt.getApplicationAttemptId(), container.getNodeId(), appAttempt.getUser(), rmContext, isRemotelyAllocated); appAttempt.addRMContainer(container.getId(), rmContainer); ((AbstractYarnScheduler) rmContext.getScheduler()).getNode( container.getNodeId()).allocateContainer(rmContainer); return rmContainer; } }
schedulerNode.allocateContainer(rmContainer); rmContainer.handle(new RMContainerEvent(containerId, RMContainerEventType.START)); schedulerNode.allocateContainer(rmContainer); schedulerNode.allocateContainer(rmContainer);
private RMContainer createDecreasedRMContainer( SchedulerApplicationAttempt appAttempt, UpdateContainerRequest uReq, RMContainer rmContainer) { SchedulerRequestKey sk = SchedulerRequestKey.extractFrom(rmContainer.getContainer()); Container decreasedContainer = BuilderUtils.newContainer( ContainerId.newContainerId(appAttempt.getApplicationAttemptId(), appAttempt.getNewContainerId()), rmContainer.getContainer().getNodeId(), rmContainer.getContainer().getNodeHttpAddress(), Resources.none(), sk.getPriority(), null, rmContainer.getExecutionType(), sk.getAllocationRequestId()); decreasedContainer.setVersion(rmContainer.getContainer().getVersion()); RMContainer newRmContainer = new RMContainerImpl(decreasedContainer, sk, appAttempt.getApplicationAttemptId(), decreasedContainer.getNodeId(), appAttempt.getUser(), rmContext, rmContainer.isRemotelyAllocated()); appAttempt.addRMContainer(decreasedContainer.getId(), rmContainer); ((AbstractYarnScheduler) rmContext.getScheduler()).getNode( decreasedContainer.getNodeId()).allocateContainer(newRmContainer); return newRmContainer; }