mirror of https://github.com/apache/druid.git
negating compare is bad
This commit is contained in:
parent
137ad50bf1
commit
c8b8e3f6e9
|
@ -799,7 +799,7 @@ public class RemoteTaskRunner implements TaskRunner, TaskLogStreamer
|
|||
ZkWorker zkWorker, ZkWorker zkWorker2
|
||||
)
|
||||
{
|
||||
int retVal = -Ints.compare(zkWorker.getCurrCapacityUsed(), zkWorker2.getCurrCapacityUsed());
|
||||
int retVal = Ints.compare(zkWorker2.getCurrCapacityUsed(), zkWorker.getCurrCapacityUsed());
|
||||
if (retVal == 0) {
|
||||
retVal = zkWorker.getWorker().getHost().compareTo(zkWorker2.getWorker().getHost());
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ public class PrioritizedExecutorService extends AbstractExecutorService implemen
|
|||
@Override
|
||||
public int compareTo(PrioritizedListenableFutureTask otherTask)
|
||||
{
|
||||
return -Ints.compare(getPriority(), otherTask.getPriority());
|
||||
return Ints.compare(otherTask.getPriority(), getPriority());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class HighestPriorityTierSelectorStrategy extends AbstractTierSelectorStr
|
|||
@Override
|
||||
public int compare(Integer o1, Integer o2)
|
||||
{
|
||||
return -Ints.compare(o1, o2);
|
||||
return Ints.compare(o2, o1);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue