@Override public int compareTo(TaskRequest request) { return request.priority.compareTo(this.priority); }
@Override public int compareTo(AppPriorityACLGroup o) { return getMaxPriority().compareTo(o.getMaxPriority()); }
@Override public int compare(SchedulableEntity se1, SchedulableEntity se2) { Priority p1 = se1.getPriority(); Priority p2 = se2.getPriority(); if (p1 == null && p2 == null) { return 0; } else if (p1 == null) { return -1; } else if (p2 == null) { return 1; } return p1.compareTo(p2); } }
@Override public int compare(Schedulable s1, Schedulable s2) { int res = s1.getPriority().compareTo(s2.getPriority()); if (res == 0) { res = (int) Math.signum(s1.getStartTime() - s2.getStartTime()); } if (res == 0) { // In the rare case where jobs were submitted at the exact same time, // compare them by name (which will be the JobID) to get a deterministic // ordering, so we don't alternately launch tasks from different jobs. res = s1.getName().compareTo(s2.getName()); } return res; } }
@Override public int compare(Schedulable s1, Schedulable s2) { int res = s1.getPriority().compareTo(s2.getPriority()); if (res == 0) { res = (int) Math.signum(s1.getStartTime() - s2.getStartTime()); } if (res == 0) { // In the rare case where jobs were submitted at the exact same time, // compare them by name (which will be the JobID) to get a deterministic // ordering, so we don't alternately launch tasks from different jobs. res = s1.getName().compareTo(s2.getName()); } return res; } }
@Override public int compare(Schedulable s1, Schedulable s2) { int res = s1.getPriority().compareTo(s2.getPriority()); if (res == 0) { res = (int) Math.signum(s1.getStartTime() - s2.getStartTime()); } if (res == 0) { // In the rare case where jobs were submitted at the exact same time, // compare them by name (which will be the JobID) to get a deterministic // ordering, so we don't alternately launch tasks from different jobs. res = s1.getName().compareTo(s2.getName()); } return res; } }
@Override public int compareTo(SchedContainerChangeRequest other) { if (other == null) { return -1; } int rc = getPriority().compareTo(other.getPriority()); if (0 != rc) { return rc; } return getContainerId().compareTo(other.getContainerId()); }
@Override public int compare(ResourceRequest r1, ResourceRequest r2) { // Compare priority, host and capability int ret = r1.getPriority().compareTo(r2.getPriority()); if (ret == 0) { String h1 = r1.getResourceName(); String h2 = r2.getResourceName(); ret = h1.compareTo(h2); } if (ret == 0) { ret = r1.getCapability().compareTo(r2.getCapability()); } return ret; } }
@Override public int compare(ResourceRequest r1, ResourceRequest r2) { // Compare priority, host and capability int ret = r1.getPriority().compareTo(r2.getPriority()); if (ret == 0) { String h1 = r1.getResourceName(); String h2 = r2.getResourceName(); ret = h1.compareTo(h2); } if (ret == 0) { ret = r1.getCapability().compareTo(r2.getCapability()); } return ret; } }
@Override public int compare(ResourceRequest r1, ResourceRequest r2) { // Compare priority, host and capability int ret = r1.getPriority().compareTo(r2.getPriority()); if (ret == 0) { String h1 = r1.getResourceName(); String h2 = r2.getResourceName(); ret = h1.compareTo(h2); } if (ret == 0) { ret = r1.getCapability().compareTo(r2.getCapability()); } return ret; } }
@Override public int compare(RMContainer c1, RMContainer c2) { int ret = c1.getContainer().getPriority().compareTo( c2.getContainer().getPriority()); if (ret == 0) { return c2.getContainerId().compareTo(c1.getContainerId()); } return ret; } }
@Override public int compare(RMContainer c1, RMContainer c2) { int ret = c1.getContainer().getPriority().compareTo( c2.getContainer().getPriority()); if (ret == 0) { return c2.getContainerId().compareTo(c1.getContainerId()); } return ret; } }
@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()); } }
@Test public void testComparePriorities() { Priority high = Priority.newInstance(1); Priority low = Priority.newInstance(2); assertTrue(high.compareTo(low) > 0); }
@Test public void testComparePriorities(){ Priority high = Priority.newInstance(1); Priority low = Priority.newInstance(2); assertTrue(high.compareTo(low) > 0); }
public int compare(FSAppAttempt a1, FSAppAttempt a2) { int res = a1.getPriority().compareTo(a2.getPriority()); if (res == 0) { if (a1.getStartTime() < a2.getStartTime()) { res = -1; } else { res = (a1.getStartTime() == a2.getStartTime() ? 0 : 1); } } if (res == 0) { // If there is a tie, break it by app ID to get a deterministic order res = a1.getApplicationId().compareTo(a2.getApplicationId()); } return res; } }
public int compare(FSAppAttempt a1, FSAppAttempt a2) { int res = a1.getPriority().compareTo(a2.getPriority()); if (res == 0) { if (a1.getStartTime() < a2.getStartTime()) { res = -1; } else { res = (a1.getStartTime() == a2.getStartTime() ? 0 : 1); } } if (res == 0) { // If there is a tie, break it by app ID to get a deterministic order res = a1.getApplicationId().compareTo(a2.getApplicationId()); } return res; } }
public int compare(FSAppAttempt a1, FSAppAttempt a2) { int res = a1.getPriority().compareTo(a2.getPriority()); if (res == 0) { if (a1.getStartTime() < a2.getStartTime()) { res = -1; } else { res = (a1.getStartTime() == a2.getStartTime() ? 0 : 1); } } if (res == 0) { // If there is a tie, break it by app ID to get a deterministic order res = a1.getApplicationId().compareTo(a2.getApplicationId()); } return res; } }
private boolean isSameKindOfRequest(final AMRMClient.ContainerRequest r1, final AMRMClient.ContainerRequest r2) { return r1.getPriority().compareTo(r2.getPriority()) == 0 && r1.getCapability().compareTo(r2.getCapability()) == 0 && r1.getRelaxLocality() == r2.getRelaxLocality() && ListUtils.isEqualList(r1.getNodes(), r2.getNodes()) && ListUtils.isEqualList(r1.getRacks(), r2.getRacks()); }
@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; } });