protected String getQueryId() {
    try {
      return Hive.get().getConf().get(HiveConf.ConfVars.HIVE_QUERY_ID.varname);
    } catch (HiveException e) {
      LOG.error("Error getting query id. Query level and Global HMS caching will be disabled", e);
      return null;
    }
  }
Checks if cache is enabled and initialized

@return boolean
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreClientWithLocalCache.java