public boolean validateMaterializedViewsFromRegistry(
      List<Table> cachedMaterializedViewTables, Set<TableName> tablesUsed, 
      Supplier<String> validTxnsList, HiveTxnManager txnMgr) throws HiveException {
    try {
      // Final result
      boolean result = true;
      for (Table cachedMaterializedViewTable : cachedMaterializedViewTables) {
        // Retrieve the materialized view table from the metastore
        final Table materializedViewTable = getTable(
            cachedMaterializedViewTable.getDbName(), cachedMaterializedViewTable.getTableName());
        if (materializedViewTable == null || !materializedViewTable.isRewriteEnabled()) {
          // This could happen if materialized view has been deleted or rewriting has been disabled.
          // We remove it from the registry and set result to false.
          HiveMaterializedViewsRegistry.get().dropMaterializedView(cachedMaterializedViewTable);
          result = false;
        } else {
          final Boolean outdated = isOutdatedMaterializedView(cachedMaterializedViewTable, tablesUsed, 
              false, validTxnsList, txnMgr);
          if (outdated == null) {
            result = false;
            continue;
          }
          // If the cached materialized view was not outdated wrt the query snapshot,
          // then we know that the metastore version should be either the same or
          // more recent. If it is more recent, snapshot isolation will shield us
          // from the reading its contents after snapshot was acquired, but we will
          // update the registry so we have most recent version.
          // On the other hand, if the materialized view in the cache was outdated,
          // we can only use it if the version that was in the cache is the same one
          // that we can find in the metastore.
          if (outdated) {
            if (!cachedMaterializedViewTable.equals(materializedViewTable)) {
              // We ignore and update the registry
              HiveMaterializedViewsRegistry.get().refreshMaterializedView(conf, cachedMaterializedViewTable, materializedViewTable);
              result = false;
            } else {
              // Obtain additional information if we should try incremental rewriting / rebuild
              // We will not try partial rewriting if there were update/delete/compaction operations on source tables
              Materialization invalidationInfo = getMaterializationInvalidationInfo(materializedViewTable.getMVMetadata());
              if (invalidationInfo == null || invalidationInfo.isSourceTablesUpdateDeleteModified() ||
                  invalidationInfo.isSourceTablesCompacted()) {
                // We ignore (as it did not meet the requirements), but we do not need to update it in the
                // registry, since it is up-to-date
                result = false;
              }
            }
          } else if (!cachedMaterializedViewTable.equals(materializedViewTable)) {
            // Update the registry
            HiveMaterializedViewsRegistry.get().refreshMaterializedView(conf, cachedMaterializedViewTable, materializedViewTable);
          }
        }
      }
      return result;
    } catch (Exception e) {
      throw new HiveException(e);
    }
  }
Validate that the materialized views retrieved from registry are still up-to-date.
For those that are not, the method loads them from the metastore into the registry.

@return true if they are up-to-date, otherwise false
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java