public void remove(Table materializedViewTable) {
    ConcurrentMap<String, HiveRelOptMaterialization> dbMap = materializedViews.get(materializedViewTable.getDbName());
    if (dbMap != null) {
      // Delete only if the create time for the input materialized view table and the table
      // in the map match. Otherwise, keep the one in the map.
      dbMap.computeIfPresent(materializedViewTable.getTableName(), (mvTableName, oldMaterialization) -> {
        Table oldTable = HiveMaterializedViewUtils.extractTable(oldMaterialization);
        if (materializedViewTable.equals(oldTable)) {
          remove(oldMaterialization, oldTable);
          return null;
        }
        return oldMaterialization;
      });

      if (dbMap.isEmpty()) {
        materializedViews.remove(materializedViewTable.getDbName());
      }
    }

    LOG.debug("Materialized view {}.{} removed from registry",
            materializedViewTable.getDbName(), materializedViewTable.getTableName());
  }
Collection for storing {@link HiveRelOptMaterialization}s.
Materialization can be lookup by
- the Materialized View fully qualified name
- query text.
This implementation contains two {@link ConcurrentHashMap} one for name based and one for query text based lookup.
The map contents are synchronized during each dml operation: Dml operations are performed initially on the map
which provides name based lookup. The map which provides query text based lookup is updated by lambda expressions
passed to {@link ConcurrentHashMap#compute(Object, BiFunction)}.
ql/src/java/org/apache/hadoop/hive/ql/metadata/MaterializedViewsCache.java