public HRegionLocation checkReopened(HRegionLocation oldLoc) {
    RegionStateNode node = getRegionStateNode(oldLoc.getRegion());
    // HBASE-20921
    // if the oldLoc's state node does not exist, that means the region is
    // merged or split, no need to check it
    if (node == null) {
      return null;
    }
    node.lock();
    try {
      if (oldLoc.getSeqNum() >= 0) {
        // in OPEN state before
        if (node.isInState(State.OPEN)) {
          if (node.getOpenSeqNum() > oldLoc.getSeqNum()) {
            // normal case, the region has been reopened
            return null;
          } else {
            // the open seq num does not change, need to reopen again
            return new HRegionLocation(node.getRegionInfo(), node.getRegionLocation(),
              node.getOpenSeqNum());
          }
        } else {
          // the state has been changed so we can make sure that the region has been reopened(not
          // finished maybe, but not a problem).
          return null;
        }
      } else {
        // in OPENING state before
        if (!node.isInState(State.OPEN, State.OPENING)) {
          // not in OPEN or OPENING state, then we can make sure that the region has been
          // reopened(not finished maybe, but not a problem)
          return null;
        } else {
          if (!node.getRegionLocation().equals(oldLoc.getServerName())) {
            // the region has been moved, so we can make sure that the region has been reopened.
            return null;
          }
          // normal case, we are still in OPENING state, or the reopen has been opened and the state
          // is changed to OPEN.
          long openSeqNum = node.isInState(State.OPEN) ? node.getOpenSeqNum() : -1;
          return new HRegionLocation(node.getRegionInfo(), node.getRegionLocation(), openSeqNum);
        }
      }
    } finally {
      node.unlock();
    }
  }
Check whether the region has been reopened. The meaning of the {@link HRegionLocation} is the
same with {@link #getRegionsOfTableForReopen(TableName)}.
<p/>
For a region which is in {@link State#OPEN} before, if the region state is changed or the open
seq num is changed, we can confirm that it has been reopened.
<p/>
For a region which is in {@link State#OPENING} before, usually it will be in {@link State#OPEN}
now and we will schedule a MRP to reopen it. But there are several exceptions:
<ul>
<li>The region is in state other than {@link State#OPEN} or {@link State#OPENING}.</li>
<li>The location of the region has been changed</li>
</ul>
Of course the region could still be in {@link State#OPENING} state and still on the same
server, then here we will still return a {@link HRegionLocation} for it, just like
{@link #getRegionsOfTableForReopen(TableName)}.
@param oldLoc the previous state/location of this region
@return null if the region has been reopened, otherwise a new {@link HRegionLocation} which
        means we still need to reopen the region.
@see #getRegionsOfTableForReopen(TableName)
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java