Search in sources :

Example 6 with DistributedSchedulingAllocateResponse

use of org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateResponse in project hadoop by apache.

the class OpportunisticContainerAllocatorAMService method allocateForDistributedScheduling.

@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;
}
Also used : DistributedSchedulingAllocateResponse(org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateResponse) AllocateResponse(org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse) RMContainer(org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer) Container(org.apache.hadoop.yarn.api.records.Container) DistributedSchedulingAllocateResponse(org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateResponse)

Aggregations

DistributedSchedulingAllocateResponse (org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateResponse)6 AllocateResponse (org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse)5 Container (org.apache.hadoop.yarn.api.records.Container)4 AllocateRequest (org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest)3 DistributedSchedulingAllocateRequest (org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateRequest)3 RMContainer (org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer)3 Configuration (org.apache.hadoop.conf.Configuration)2 FinishApplicationMasterRequest (org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest)2 FinishApplicationMasterResponse (org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse)2 RegisterApplicationMasterRequest (org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest)2 RegisterApplicationMasterResponse (org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse)2 ResourceRequest (org.apache.hadoop.yarn.api.records.ResourceRequest)2 RegisterDistributedSchedulingAMResponse (org.apache.hadoop.yarn.server.api.protocolrecords.RegisterDistributedSchedulingAMResponse)2 Test (org.junit.Test)2 InetSocketAddress (java.net.InetSocketAddress)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Server (org.apache.hadoop.ipc.Server)1 ApplicationMasterProtocolPB (org.apache.hadoop.yarn.api.ApplicationMasterProtocolPB)1