private Materialization getMaterializationInvalidationInfo(MaterializedViewMetadata metadata)
      throws TException, HiveException {
    Optional<SourceTable> first = metadata.getSourceTables().stream().findFirst();
    if (!first.isPresent()) {
      // This is unexpected: all MV must have at least one source
      Materialization materialization = new Materialization();
      materialization.setSourceTablesCompacted(true);
      materialization.setSourceTablesUpdateDeleteModified(true);
      return new Materialization();
    } else {
      Table table = getTable(first.get().getTable().getDbName(), first.get().getTable().getTableName());
      if (!(table.isNonNative() && table.getStorageHandler().areSnapshotsSupported())) {
        // Mixing native and non-native acid source tables are not supported. If the first source is native acid
        // the rest is expected to be native acid
        return getMSC().getMaterializationInvalidationInfo(
            metadata.creationMetadata, conf.get(ValidTxnList.VALID_TXNS_KEY));
      }
    }

    boolean allHasAppendsOnly = allTablesHasAppendsOnly(metadata);
    Materialization materialization = new Materialization();
    // TODO: delete operations are not supported yet.
    // Set setSourceTablesCompacted to false when delete is supported
    materialization.setSourceTablesCompacted(!allHasAppendsOnly);
    materialization.setSourceTablesUpdateDeleteModified(!allHasAppendsOnly);
    return materialization;
  }
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