YARN-7023. Incorrect ReservationId.compareTo() implementation.
This closes #262 Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
parent
0d419c984f
commit
c5281a85e1
|
@ -94,10 +94,9 @@ public abstract class ReservationId implements Comparable<ReservationId> {
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ReservationId other) {
|
public int compareTo(ReservationId other) {
|
||||||
if (this.getClusterTimestamp() - other.getClusterTimestamp() == 0) {
|
if (this.getClusterTimestamp() - other.getClusterTimestamp() == 0) {
|
||||||
return getId() > getId() ? 1 : getId() < getId() ? -1 : 0;
|
return Long.compare(getId(), other.getId());
|
||||||
} else {
|
} else {
|
||||||
return this.getClusterTimestamp() > other.getClusterTimestamp() ? 1
|
return Long.compare(getClusterTimestamp(), other.getClusterTimestamp());
|
||||||
: this.getClusterTimestamp() < other.getClusterTimestamp() ? -1 : 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue