You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Yeliang Cang (JIRA)" <ji...@apache.org> on 2017/07/11 12:57:00 UTC

[jira] [Commented] (YARN-6296) ReservationId.compareTo ignores id when clustertimestamp is the same

    [ https://issues.apache.org/jira/browse/YARN-6296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16082162#comment-16082162 ] 

Yeliang Cang commented on YARN-6296:
------------------------------------

Hi, [~haibochen], I have submit a patch like you suggested. Please check it out!

> ReservationId.compareTo ignores id when clustertimestamp is the same
> --------------------------------------------------------------------
>
>                 Key: YARN-6296
>                 URL: https://issues.apache.org/jira/browse/YARN-6296
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 3.0.0-alpha2
>            Reporter: Haibo Chen
>              Labels: newbie
>         Attachments: YARN-6296.001.patch
>
>
> Per YARN-6252
> {code:java}
>   public int compareTo(ReservationId other) {
>     if (this.getClusterTimestamp() - other.getClusterTimestamp() == 0) {
>       return getId() > getId() ? 1 : getId() < getId() ? -1 : 0;
>     } else {
>     }
>   }
> {code}
> compares id with itself. It should be
> {code}
> return this.getId() > other.getId() ? 1 : (this.getId() < other.getId() ? -1 : 0);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org