public SortedSet<RegionState> getRegionsInTransitionOrderedByTimestamp() {
    final SortedSet<RegionState> rit = new TreeSet<RegionState>(REGION_STATE_STAMP_COMPARATOR);
    for (RegionStateNode node : regionInTransition.values()) {
      rit.add(node.toRegionState());
    }
    return rit;
  }
Get the number of regions in transition.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java