EMPTY_CONTAINER_RELEASE_LIST, null, null); if (amContainerAllocation != null && amContainerAllocation.getContainers() != null) { assert (amContainerAllocation.getContainers().size() == 0);
EMPTY_CONTAINER_RELEASE_LIST, null, null); if (amContainerAllocation != null && amContainerAllocation.getContainers() != null) { assert (amContainerAllocation.getContainers().size() == 0);
public synchronized List<Container> getResources() throws IOException { if(LOG.isDebugEnabled()) { LOG.debug("getResources begin:" + " application=" + applicationId + " #ask=" + ask.size()); for (ResourceRequest request : ask) { LOG.debug("getResources:" + " application=" + applicationId + " ask-request=" + request); } } // Get resources from the ResourceManager Allocation allocation = resourceManager.getResourceScheduler().allocate( applicationAttemptId, new ArrayList<ResourceRequest>(ask), new ArrayList<ContainerId>(), null, null); System.out.println("-=======" + applicationAttemptId); System.out.println("----------" + resourceManager.getRMContext().getRMApps() .get(applicationId).getRMAppAttempt(applicationAttemptId)); List<Container> containers = allocation.getContainers(); // Clear state for next interaction with ResourceManager ask.clear(); if(LOG.isDebugEnabled()) { LOG.debug("getResources() for " + applicationId + ":" + " ask=" + ask.size() + " recieved=" + containers.size()); } return containers; }
List<Container> containers = allocation.getContainers();
if (amContainerAllocation.getContainers().size() == 0) { appAttempt.retryFetchingAMContainer(appAttempt); return RMAppAttemptState.SCHEDULED; appAttempt.setMasterContainer(amContainerAllocation.getContainers() .get(0)); RMContainerImpl rmMasterContainer = (RMContainerImpl)appAttempt.scheduler
if (amContainerAllocation.getContainers().size() == 0) { appAttempt.retryFetchingAMContainer(appAttempt); return RMAppAttemptState.SCHEDULED; appAttempt.setMasterContainer(amContainerAllocation.getContainers() .get(0)); RMContainerImpl rmMasterContainer = (RMContainerImpl)appAttempt.scheduler
if (amContainerAllocation.getContainers().size() == 0) { appAttempt.retryFetchingAMContainer(appAttempt); return RMAppAttemptState.SCHEDULED; appAttempt.setMasterContainer(amContainerAllocation.getContainers() .get(0)); RMContainerImpl rmMasterContainer = (RMContainerImpl)appAttempt.scheduler
applicationAttemptId, askCopy, schedulingRequests, release, blacklistAdditions, blacklistRemovals, updateRequests); List<Container> containers = normalAlloc.getContainers(); if(containers.size() > 0) { when(excessAlloc.getContainers()).thenReturn(containers); return excessAlloc;
when(container.getResource()).thenReturn(resource); Allocation allocation = mock(Allocation.class); when(allocation.getContainers()). thenReturn(Collections.singletonList(container)); when(scheduler.allocate(any(ApplicationAttemptId.class), any(List.class),
new ContainerUpdates()); if (amContainerAllocation != null && amContainerAllocation.getContainers() != null) { assert (amContainerAllocation.getContainers().size() == 0);
for (Container container : allocation.getContainers()) { Resources.addTo(allocatedResource, container.getResource()); Resources.subtractFrom(pendingResource, container.getResource());
when(container.getResource()).thenReturn(resource); Allocation allocation = mock(Allocation.class); when(allocation.getContainers()). thenReturn(Collections.singletonList(container)); when(
for (Container container : allocation.getContainers()) { Resources.addTo(allocatedResource, container.getResource()); Resources.subtractFrom(pendingResource, container.getResource());
when(amContainer.getResource()).thenReturn(resource); Allocation allocation = mock(Allocation.class); when(allocation.getContainers()). thenReturn(Collections.singletonList(amContainer)); when(scheduler.allocate(any(ApplicationAttemptId.class), any(List.class),
when(amContainer.getResource()).thenReturn(resource); Allocation allocation = mock(Allocation.class); when(allocation.getContainers()). thenReturn(Collections.singletonList(amContainer)); when(scheduler.allocate(any(ApplicationAttemptId.class), any(List.class),
response, allocation.getContainers());
Assert.assertEquals("allocation1", 0, allocation1.getContainers().size()); Assert.assertEquals("allocation2", 1, allocation2.getContainers().size()); List<Container> containerList = allocation2.getContainers(); for (Container container : containerList) { Assert.assertEquals("Container is allocated on n4", Assert.assertEquals("allocation3", 0, allocation3.getContainers().size()); Assert.assertEquals("allocation4", 0, allocation4.getContainers().size()); Assert.assertEquals("allocation5", 0, allocation5.getContainers().size()); Assert.assertEquals("allocation6", 1, allocation6.getContainers().size()); containerList = allocation6.getContainers(); for (Container container : containerList) { Assert.assertEquals("Container is allocated on n4",
Assert.assertEquals("allocation1", 0, allocation1.getContainers().size()); fs.allocate(appAttemptId1, emptyAsk, null, emptyId, null, null, NULL_UPDATE_REQUESTS); Assert.assertEquals("allocation2", 1, allocation2.getContainers().size()); List<Container> containerList = allocation2.getContainers(); for (Container container : containerList) { Assert.assertEquals("Container is allocated on n4", fs.allocate(appAttemptId1, emptyAsk, null, emptyId, null, null, NULL_UPDATE_REQUESTS); Assert.assertEquals("allocation3", 0, allocation3.getContainers().size()); fs.allocate(appAttemptId1, emptyAsk, null, emptyId, null, null, NULL_UPDATE_REQUESTS); Assert.assertEquals("allocation4", 0, allocation4.getContainers().size()); fs.allocate(appAttemptId1, emptyAsk, null, emptyId, null, null, NULL_UPDATE_REQUESTS); Assert.assertEquals("allocation5", 0, allocation5.getContainers().size()); fs.allocate(appAttemptId1, emptyAsk, null, emptyId, null, null, NULL_UPDATE_REQUESTS); Assert.assertEquals("allocation6", 1, allocation6.getContainers().size()); containerList = allocation6.getContainers(); for (Container container : containerList) { Assert.assertEquals("Container is allocated on n4",
Collections.<ContainerId> emptyList(), null, null).getContainers();
null, null, NULL_UPDATE_REQUESTS).getContainers().size(); CapacityScheduler.schedule(cs); ResourceRequest r2 = null; cs.allocate(appAttemptId1, Collections.<ResourceRequest>singletonList(r1), null, Collections.<ContainerId>emptyList(), null, null, NULL_UPDATE_REQUESTS).getContainers().size(); CapacityScheduler.schedule(cs);