private CompletableFuture<Void> transitStateAndUpdate(RegionStateNode regionNode,
    RegionState.State newState, RegionState.State... expectedStates) {
    RegionState.State state = regionNode.getState();
    try {
      regionNode.transitionState(newState, expectedStates);
    } catch (UnexpectedStateException e) {
      return FutureUtils.failedFuture(e);
    }
    CompletableFuture<Void> future = regionStateStore.updateRegionLocation(regionNode);
    FutureUtils.addListener(future, (r, e) -> {
      if (e != null) {
        // revert
        regionNode.setState(state);
      }
    });
    return future;
  }
Resolve a cached {@link RegionInfo} from the encoded region name as a {@code String}.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java