public static List<String> filterCatalogNamesIfEnabled(
      boolean isFilterEnabled, MetaStoreFilterHook filterHook,
      List<String> catalogNames) throws MetaException{

    if (isFilterEnabled) {
      return filterHook.filterCatalogs(catalogNames);
    }

    return catalogNames;
  }
Filter list of catalog names 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 catalogNames: the list of catalog names
@return the list of catalog names that the current user has access or
        original list if filtering is disabled;
@throws MetaException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java