.partitionAskList(request.getAllocateRequest().getAskList()); request.getAllocateRequest().getResourceBlacklistRequest(), partitionedAsks.getOpportunistic(), applicationAttemptId, oppContainerContext, rmIdentifier, appSubmitter); request.getAllocateRequest().setAskList(partitionedAsks.getGuaranteed());
@Override public DistributedSchedulingAllocateResponse allocateForDistributedScheduling( DistributedSchedulingAllocateRequest request) throws YarnException, IOException { List<Container> distAllocContainers = request.getAllocatedContainers(); handleNewContainers(distAllocContainers, true); AllocateResponse response = allocate(request.getAllocateRequest()); DistributedSchedulingAllocateResponse dsResp = recordFactory .newRecordInstance(DistributedSchedulingAllocateResponse.class); dsResp.setAllocateResponse(response); dsResp.setNodesForScheduling(getLeastLoadedNodes()); return dsResp; }
@Override public DistributedSchedulingAllocateResponse allocateForDistributedScheduling( DistributedSchedulingAllocateRequest request) throws YarnException, IOException { List<ResourceRequest> askList = request.getAllocateRequest().getAskList(); List<Container> allocatedContainers = request.getAllocatedContainers(); Assert.assertEquals(1, allocatedContainers.size()); Assert.assertEquals(ExecutionType.OPPORTUNISTIC, allocatedContainers.get(0).getExecutionType()); Assert.assertEquals(1, askList.size()); Assert.assertTrue(askList.get(0) .getExecutionTypeRequest().getEnforceExecutionType()); DistributedSchedulingAllocateResponse resp = factory .newRecordInstance(DistributedSchedulingAllocateResponse.class); RemoteNode remoteNode1 = RemoteNode.newInstance( NodeId.newInstance("h1", 1234), "http://h1:4321"); RemoteNode remoteNode2 = RemoteNode.newInstance( NodeId.newInstance("h2", 1234), "http://h2:4321"); remoteNode2.setNodePartition("l1"); resp.setNodesForScheduling( Arrays.asList(remoteNode1, remoteNode2)); return resp; } };