public static ObjectCache getCache(Configuration conf, String queryId, boolean isPlanCache, boolean llapCacheAlwaysEnabled) {
    if (HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {
      if (LlapProxy.isDaemon()) { // daemon
        if (isLlapCacheEnabled(conf, isPlanCache, llapCacheAlwaysEnabled)) {
          // LLAP object cache, unlike others, does not use globals. Thus, get the existing one.
          return getLlapObjectCache(queryId);
        } else { // no cache
          return new ObjectCacheWrapper(
              new org.apache.hadoop.hive.ql.exec.mr.ObjectCache(), queryId);
        }
      } else { // container
        if (org.apache.hadoop.hive.ql.exec.tez.ObjectCache.isObjectRegistryConfigured()) {
          return new ObjectCacheWrapper(
              new org.apache.hadoop.hive.ql.exec.tez.ObjectCache(), queryId);
        } else {
          // Tez processor needs to configure object registry first.
          return null;
        }
      }
    } else { // mr
      return new ObjectCacheWrapper(
          new  org.apache.hadoop.hive.ql.exec.mr.ObjectCache(), queryId);
    }
  }
Returns the appropriate cache
@param conf
@param queryId
@param isPlanCache
@param llapCacheAlwaysEnabled  Whether to always return LLAP cache regardless
       of config settings disabling LLAP cache. Valid only if running LLAP.
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/ObjectCacheFactory.java