private RMContainer recoverAndCreateContainer(NMContainerStatus status, RMNode node, String queueName) { Container container = Container.newInstance(status.getContainerId(), node.getNodeID(), node.getHttpAddress(), status.getAllocatedResource(), status.getPriority(), null); container.setVersion(status.getVersion()); container.setExecutionType(status.getExecutionType()); container.setAllocationRequestId(status.getAllocationRequestId()); container.setAllocationTags(status.getAllocationTags()); ApplicationAttemptId attemptId = container.getId().getApplicationAttemptId(); RMContainer rmContainer = new RMContainerImpl(container, SchedulerRequestKey.extractFrom(container), attemptId, node.getNodeID(), applications.get(attemptId.getApplicationId()).getUser(), rmContext, status.getCreationTime(), status.getNodeLabelExpression()); ((RMContainerImpl) rmContainer).setQueueName(queueName); return rmContainer; }