@Override
    public int compare(HbckRegionInfo l, HbckRegionInfo r) {
      if (l == r) {
        // same instance
        return 0;
      }

      int tableCompare = l.getTableName().compareTo(r.getTableName());
      if (tableCompare != 0) {
        return tableCompare;
      }

      int startComparison =
        RegionSplitCalculator.BYTES_COMPARATOR.compare(l.getStartKey(), r.getStartKey());
      if (startComparison != 0) {
        return startComparison;
      }

      // Special case for absolute endkey
      byte[] endKey = r.getEndKey();
      endKey = (endKey.length == 0) ? null : endKey;
      byte[] endKey2 = l.getEndKey();
      endKey2 = (endKey2.length == 0) ? null : endKey2;
      int endComparison = RegionSplitCalculator.BYTES_COMPARATOR.compare(endKey2, endKey);

      if (endComparison != 0) {
        return endComparison;
      }

      // use regionId as tiebreaker.
      // Null is considered after all possible values so make it bigger.
      if (l.getHdfsEntry() == null && r.getHdfsEntry() == null) {
        return 0;
      }
      if (l.getHdfsEntry() == null && r.getHdfsEntry() != null) {
        return 1;
      }
      // l.hdfsEntry must not be null
      if (r.getHdfsEntry() == null) {
        return -1;
      }
      // both l.hdfsEntry and r.hdfsEntry must not be null.
      return Long.compare(l.getHdfsEntry().hri.getRegionId(), r.getHdfsEntry().hri.getRegionId());
    }
Stores the regioninfo retrieved from Online region servers.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/HbckRegionInfo.java