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
|
||||
public int compareTo(ReservationId other) {
|
||||
if (this.getClusterTimestamp() - other.getClusterTimestamp() == 0) {
|
||||
return getId() > getId() ? 1 : getId() < getId() ? -1 : 0;
|
||||
return Long.compare(getId(), other.getId());
|
||||
} else {
|
||||
return this.getClusterTimestamp() > other.getClusterTimestamp() ? 1
|
||||
: this.getClusterTimestamp() < other.getClusterTimestamp() ? -1 : 0;
|
||||
return Long.compare(getClusterTimestamp(), other.getClusterTimestamp());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue