public void populateCacheForView(List<Pair<String, String>> tables, HiveConf conf,
      HiveTxnManager txnMgr, String dbName, String viewName) {
    if (!conf.getBoolVar(ConfVars.HIVE_OPTIMIZE_VIEW_CACHE_ENABLED)) {
      return;
    }

    String completeViewName = dbName + "." + viewName;
    LOG.debug("Found view while parsing: " + completeViewName);
    Set<String> underlyingTablesAndViews = getUniqueNames(tables);
    // If the tables passed in match our cache, assume the cache has already
    // been populated.
    if (underlyingTablesAndViews.equals(underlyingTableHints.getIfPresent(completeViewName))) {
      LOG.debug("View already cached.");
      return;
    }
    // populate the metastore cache for this view.
    populateCache(tables, conf, txnMgr);
    // cache the names of the tables for the given view in our server-wide cache.
    underlyingTableHints.put(completeViewName, underlyingTablesAndViews);
  }
Populates the cache for the given table pairs associated with a viewName.
If the table names provided match the table names that we think are associated
with the view, we just return, because we presume that they have already been
popuated via the "populateCache" method. If they are different, we populate the cache
with the new associated tables and change our associated tables for the view.
ql/src/java/org/apache/hadoop/hive/ql/parse/CacheTableHelper.java