@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TaskRequest that = (TaskRequest) o; if (priority != null ? !priority.equals(that.priority) : that.priority != null) { return false; } if (task != null ? !task.equals(that.task) : that.task != null) { return false; } return true; }
private ContainerRequest assignWithoutLocality(Container allocated) { ContainerRequest assigned = null; Priority priority = allocated.getPriority(); if (PRIORITY_FAST_FAIL_MAP.equals(priority)) { LOG.info("Assigning container " + allocated + " to fast fail map"); assigned = assignToFailedMap(allocated); } else if (PRIORITY_REDUCE.equals(priority)) { if (LOG.isDebugEnabled()) { LOG.debug("Assigning container " + allocated + " to reduce"); } assigned = assignToReduce(allocated); } return assigned; }
private ContainerRequest assignWithoutLocality(Container allocated) { ContainerRequest assigned = null; Priority priority = allocated.getPriority(); if (PRIORITY_FAST_FAIL_MAP.equals(priority)) { LOG.info("Assigning container " + allocated + " to fast fail map"); assigned = assignToFailedMap(allocated); } else if (PRIORITY_REDUCE.equals(priority)) { if (LOG.isDebugEnabled()) { LOG.debug("Assigning container " + allocated + " to reduce"); } assigned = assignToReduce(allocated); } return assigned; }
private ContainerRequest assignWithoutLocality(Container allocated) { ContainerRequest assigned = null; Priority priority = allocated.getPriority(); if (PRIORITY_FAST_FAIL_MAP.equals(priority)) { LOG.info("Assigning container " + allocated + " to fast fail map"); assigned = assignToFailedMap(allocated); } else if (PRIORITY_REDUCE.equals(priority)) { if (LOG.isDebugEnabled()) { LOG.debug("Assigning container " + allocated + " to reduce"); } assigned = assignToReduce(allocated); } return assigned; }
Priority priority = allocated.getPriority(); ContainerRequest toBeReplaced = null; if (PRIORITY_FAST_FAIL_MAP.equals(priority)) { LOG.info("Replacing FAST_FAIL_MAP container " + allocated.getId()); Iterator<TaskAttemptId> iter = earlierFailedMaps.iterator(); return toBeReplaced; else if (PRIORITY_MAP.equals(priority) || PRIORITY_OPPORTUNISTIC_MAP.equals(priority)) { LOG.info("Replacing MAP container " + allocated.getId()); else if (PRIORITY_REDUCE.equals(priority)) { TaskAttemptId tId = reduces.keySet().iterator().next(); toBeReplaced = reduces.remove(tId);
Priority priority = allocated.getPriority(); ContainerRequest toBeReplaced = null; if (PRIORITY_FAST_FAIL_MAP.equals(priority)) { LOG.info("Replacing FAST_FAIL_MAP container " + allocated.getId()); Iterator<TaskAttemptId> iter = earlierFailedMaps.iterator(); return toBeReplaced; else if (PRIORITY_MAP.equals(priority)) { LOG.info("Replacing MAP container " + allocated.getId()); else if (PRIORITY_REDUCE.equals(priority)) { TaskAttemptId tId = reduces.keySet().iterator().next(); toBeReplaced = reduces.remove(tId);
/** * Updates priority of an application with the given ID. */ private void updateApplicationPriority(String applicationId, String priority) throws YarnException, IOException { ApplicationId appId = ApplicationId.fromString(applicationId); Priority newAppPriority = Priority.newInstance(Integer.parseInt(priority)); sysout.println("Updating priority of an application " + applicationId); Priority updateApplicationPriority = client.updateApplicationPriority(appId, newAppPriority); if (newAppPriority.equals(updateApplicationPriority)) { sysout.println("Successfully updated the application " + applicationId + " with priority '" + priority + "'"); } else { sysout .println("Updated priority of an application " + applicationId + " to cluster max priority OR keeping old priority" + " as application is in final states"); } }
Priority priority = allocated.getPriority(); ContainerRequest toBeReplaced = null; if (PRIORITY_FAST_FAIL_MAP.equals(priority)) { LOG.info("Replacing FAST_FAIL_MAP container " + allocated.getId()); Iterator<TaskAttemptId> iter = earlierFailedMaps.iterator(); return toBeReplaced; else if (PRIORITY_MAP.equals(priority)) { LOG.info("Replacing MAP container " + allocated.getId()); else if (PRIORITY_REDUCE.equals(priority)) { TaskAttemptId tId = reduces.keySet().iterator().next(); toBeReplaced = reduces.remove(tId);
/** * Updates priority of an application with the given ID. */ private void updateApplicationPriority(String applicationId, String priority) throws YarnException, IOException { ApplicationId appId = ApplicationId.fromString(applicationId); Priority newAppPriority = Priority.newInstance(Integer.parseInt(priority)); sysout.println("Updating priority of an aplication " + applicationId); Priority updateApplicationPriority = client.updateApplicationPriority(appId, newAppPriority); if (newAppPriority.equals(updateApplicationPriority)) { sysout.println("Successfully updated the application " + applicationId + " with priority '" + priority + "'"); } else { sysout .println("Updated priority of an application " + applicationId + " to cluster max priority OR keeping old priority" + " as application is in final states"); } }
while (iter.hasNext()) { SchedulingRequest schedReq = iter.next(); if (schedReq.getPriority().equals(container.getPriority()) && schedReq.getAllocationRequestId() == container .getAllocationRequestId()) {
private void maybeRescheduleContainerAtPriority(Priority priority) { for (Map.Entry<Object, CookieContainerRequest> entry : taskRequests.entrySet()) { Object task = entry.getKey(); CookieContainerRequest request = entry.getValue(); if (request.getPriority().equals(priority)) { LOG.info("Resending request for task again: " + task); deallocateTask(task, true, null, null); allocateTask(task, request.getCapability(), (request.getNodes() == null ? null : request.getNodes().toArray(new String[request.getNodes().size()])), (request.getRacks() == null ? null : request.getRacks().toArray(new String[request.getRacks().size()])), request.getPriority(), request.getCookie().getContainerSignature(), request.getCookie().getAppCookie()); break; } } }
newAppPriority, applicationId, future, callerUGI); if (app.getApplicationPriority().equals(appPriority)) { return;
@Override public int compare(TempAppPerPartition ta1, TempAppPerPartition ta2) { Priority p1 = Priority.newInstance(ta1.getPriority()); Priority p2 = Priority.newInstance(ta2.getPriority()); if (!p1.equals(p2)) { return p1.compareTo(p2); } return ta1.getApplicationId().compareTo(ta2.getApplicationId()); } }
if (other.getPriority() != null) return false; } else if (!priority.equals(other.getPriority())) return false; if (getNodeLabelExpression() == null) {
if (other.getPriority() != null) return false; } else if (!priority.equals(other.getPriority())) return false; if (getNodeLabelExpression() == null) {
if (other.getPriority() != null) return false; } else if (!priority.equals(other.getPriority())) return false; if (getNodeLabelExpression() == null) {
public static boolean isMatchingSchedulingRequests( SchedulingRequest schedReq1, SchedulingRequest schedReq2) { return schedReq1.getPriority().equals(schedReq2.getPriority()) && schedReq1.getExecutionType().getExecutionType().equals( schedReq1.getExecutionType().getExecutionType()) && schedReq1.getAllocationRequestId() == schedReq2.getAllocationRequestId(); }
@Override public AllocateResponse allocate(AllocateRequest request) throws YarnException, IOException { lastAsk = request.getAskList(); for (ResourceRequest req : lastAsk) { if (ResourceRequest.ANY.equals(req.getResourceName())) { Priority priority = req.getPriority(); if (priority.equals(RMContainerAllocator.PRIORITY_MAP)) { lastAnyAskMap = req.getNumContainers(); } else if (priority.equals(RMContainerAllocator.PRIORITY_REDUCE)){ lastAnyAskReduce = req.getNumContainers(); } } } AllocateResponse response = AllocateResponse.newInstance( request.getResponseId(), containersToComplete, containersToAllocate, Collections.<NodeReport>emptyList(), Resource.newInstance(512000, 1024), null, 10, null, Collections.<NMToken>emptyList()); // RM will always ensure that a default priority is sent to AM response.setApplicationPriority(Priority.newInstance(0)); containersToComplete.clear(); containersToAllocate.clear(); return response; }
rmApp.getQueue(), applicationId); if (application.getPriority().equals(appPriority)) { future.set(null); return appPriority;
@Override public int compare(FiCaSchedulerApp a1, FiCaSchedulerApp a2) { if (a1.getPriority() != null && !a1.getPriority().equals(a2.getPriority())) { return a1.getPriority().compareTo(a2.getPriority()); } int res = a1.getApplicationId() .compareTo(a2.getApplicationId()); return res; } });