@Override public void allocate(ApplicationAttemptId appAttemptId, AllocateRequest request, AllocateResponse response) throws YarnException { if (request.getSchedulingRequests() != null && !request.getSchedulingRequests().isEmpty()) { if (!(scheduler instanceof CapacityScheduler)) { String message = "Found non empty SchedulingRequest of " + "AllocateRequest for application=" + appAttemptId.toString() + ", however the configured scheduler=" + scheduler.getClass().getCanonicalName() + " cannot handle placement constraints, rejecting this " + "allocate operation"; LOG.warn(message); throw new YarnException(message); } } nextAMSProcessor.allocate(appAttemptId, request, response); } }
@Override public void allocate(ApplicationAttemptId appAttemptId, AllocateRequest request, AllocateResponse response) throws YarnException { if (request.getSchedulingRequests() != null && !request .getSchedulingRequests().isEmpty()) { String message = "Found non empty SchedulingRequest in " + "AllocateRequest for application=" + appAttemptId.toString() + ", but the configured " + YarnConfiguration.RM_PLACEMENT_CONSTRAINTS_HANDLER + " cannot handle placement constraints. Rejecting this " + "allocate operation"; LOG.warn(message); throw new YarnException(message); } nextAMSProcessor.allocate(appAttemptId, request, response); } }
@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); }
try { allocation = getScheduler().allocate(appAttemptId, ask, request.getSchedulingRequests(), release, blacklistAdditions, blacklistRemovals, containerUpdateRequests); } catch (SchedulerInvalidResoureRequestException e) {