private static int compareTo(RegionPlan left, RegionPlan right) {
    int result = compareServerName(left.source, right.source);
    if (result != 0) {
      return result;
    }
    if (left.hri == null) {
      if (right.hri != null) {
        return -1;
      }
    } else if (right.hri == null) {
      return +1;
    } else {
      result = RegionInfo.COMPARATOR.compare(left.hri, right.hri);
    }
    if (result != 0) {
      return result;
    }
    return compareServerName(left.dest, right.dest);
  }
Compare the region info.
@param other region plan you are comparing against
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/RegionPlan.java