/** * Set the <code>schedulingRequests</code> of the request. * @see AllocateRequest#setSchedulingRequests(List) * @param schedulingRequests <code>SchedulingRequest</code> of the request * @return {@link AllocateRequestBuilder} */ @Public @Unstable public AllocateRequestBuilder schedulingRequests( List<SchedulingRequest> schedulingRequests) { allocateRequest.setSchedulingRequests(schedulingRequests); return this; }
public AllocateResponse allocate( List<ResourceRequest> resourceRequest, List<ContainerId> releases) throws Exception { final AllocateRequest req = AllocateRequest.newInstance(0, 0F, resourceRequest, releases, null); if (!schedulingRequests.isEmpty()) { req.setSchedulingRequests(schedulingRequests); schedulingRequests.clear(); } return allocate(req); }
@Override public void allocate(ApplicationAttemptId appAttemptId, AllocateRequest request, AllocateResponse response) throws YarnException { // Copy the scheduling request since we will clear it later after sending // to dispatcher List<SchedulingRequest> schedulingRequests = new ArrayList<>(request.getSchedulingRequests()); dispatchRequestsForPlacement(appAttemptId, schedulingRequests); reDispatchRetryableRequests(appAttemptId); schedulePlacedRequests(appAttemptId); // Remove SchedulingRequest from AllocateRequest to avoid SchedulingRequest // added to scheduler. request.setSchedulingRequests(Collections.emptyList()); nextAMSProcessor.allocate(appAttemptId, request, response); handleRejectedRequests(appAttemptId, response); }
public AllocateResponse allocate(List<ResourceRequest> resourceRequest, List<SchedulingRequest> newSchedulingRequests, List<ContainerId> releases) throws Exception { final AllocateRequest req = AllocateRequest.newInstance(0, 0F, resourceRequest, releases, null); if (newSchedulingRequests != null) { addSchedulingRequest(newSchedulingRequests); } if (!schedulingRequests.isEmpty()) { req.setSchedulingRequests(schedulingRequests); schedulingRequests.clear(); } return allocate(req); }