private void updateMetaState(TableName tableName, TableState.State newState) throws IOException {
    if (tableName.equals(TableName.META_TABLE_NAME)) {
      if (
        TableState.State.DISABLING.equals(newState) || TableState.State.DISABLED.equals(newState)
      ) {
        throw new IllegalArgumentIOException("Cannot disable meta table; " + newState);
      }
      // Otherwise, just return; no need to set ENABLED on meta -- it is always ENABLED.
      return;
    }
    boolean succ = false;
    try {
      MetaTableAccessor.updateTableState(master.getConnection(), tableName, newState);
      tableName2State.put(tableName, newState);
      succ = true;
    } finally {
      if (!succ) {
        this.tableName2State.remove(tableName);
      }
    }
  }
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