public static List<TableMeta> filterTableMetasIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook,
      List<TableMeta> tableMetas) throws MetaException, NoSuchObjectException {
    if (tableMetas == null || tableMetas.isEmpty()) {
      return tableMetas;
    }

    if (isFilterEnabled) {
      return filterHook.filterTableMetas(tableMetas);
    }

    return tableMetas;
  }
Filter list of meta data of tables if filtering is enabled. Otherwise, return original list
@param isFilterEnabled true: filtering is enabled; false: filtring is disabled.
@param filterHook: the object that does filtering
@param tableMetas: the list of meta data of tables
@return the list of table meta data that current user has access if filtering is enabled;
        otherwise, the original list
@throws MetaException
@throws NoSuchObjectException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java