public List<HiveRelOptMaterialization> getPreprocessedMaterializedViews(
      Set<TableName> tablesUsed, Supplier<String> validTxnsList, HiveTxnManager txnMgr) throws HiveException {
    // From metastore
    List<Table> materializedViewTables =
        getAllMaterializedViewObjectsForRewriting();
    if (materializedViewTables.isEmpty()) {
      return Collections.emptyList();
    }
    // Return final result
    return getValidMaterializedViews(materializedViewTables, tablesUsed, false, true, 
        validTxnsList, txnMgr, EnumSet.of(CALCITE));
  }
Get the materialized views that have been enabled for rewriting from the
metastore. If the materialized view is in the cache, we do not need to
parse it to generate a logical plan for the rewriting. Instead, we
return the version present in the cache. Further, information provided
by the invalidation cache is useful to know whether a materialized view
can be used for rewriting or not.

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