YARN-7023. Incorrect ReservationId.compareTo() implementation.
This closes #262 Signed-off-by: Akira Ajisaka <aajisaka@apache.org> (cherry picked from commitc5281a85e1
) (cherry picked from commitb616462eef
)
This commit is contained in:
parent
798ff2f52b
commit
867a4b7d78
|
@ -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