Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-6296

ReservationId.compareTo ignores id when clustertimestamp is the same

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0-alpha2
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Per YARN-6252

        public int compareTo(ReservationId other) {
          if (this.getClusterTimestamp() - other.getClusterTimestamp() == 0) {
            return getId() > getId() ? 1 : getId() < getId() ? -1 : 0;
          } else {
          }
        }
      

      compares id with itself. It should be

      return this.getId() > other.getId() ? 1 : (this.getId() < other.getId() ? -1 : 0);
      

        Attachments

        1. YARN-6296.001.patch
          1 kB
          Yeliang Cang

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                haibochen Haibo Chen
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: