@NonNull
  public TableState getTableState(TableName tableName) throws IOException {
    ReadWriteLock lock = tnLock.getLock(tableName);
    lock.readLock().lock();
    try {
      TableState currentState = readMetaState(tableName);
      if (currentState == null) {
        throw new TableNotFoundException("No state found for " + tableName);
      }
      return currentState;
    } finally {
      lock.readLock().unlock();
    }
  }
Return all tables in given states.
@param states filter by states
@return tables in given states
hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableStateManager.java