public List<HiveRelOptMaterialization> getPreprocessedMaterializedViewsFromRegistry (
      Set<TableName> tablesUsed, Supplier<String> validTxnsList, HiveTxnManager txnMgr) throws HiveException {
    // From cache
    List<HiveRelOptMaterialization> materializedViews =
        HiveMaterializedViewsRegistry.get().getRewritingMaterializedViews();
    if (materializedViews.isEmpty()) {
      return Collections.emptyList();
    }
    // Add to final result
    return filterAugmentMaterializedViews(materializedViews, tablesUsed, validTxnsList, txnMgr);
  }
Get the materialized views that have been enabled for rewriting from the
cache (registry). It will preprocess them to discard those that are
outdated and augment those that need to be augmented, e.g., if incremental
rewriting is enabled.

@return the list of materialized views available for rewriting from the registry
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java